/* /product-page/<slug> and /grozs — product page with numbered choice blocks, and the cart.
   Design: veikals-prece-izvele.html, variant "A. Soli pa solim". The frame colour of the blocks is one
   variable (--pp-frame, in shop.css, shared with /veikals). */

.pp, .cart { padding: 3rem 0 6rem; background: var(--paper); color: var(--ink); }

/* ---------- Breadcrumbs ---------- */
.pp-crumbs { display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; margin-bottom: 1.6rem; font-size: 1.35rem; color: var(--pp-muted); }
.pp-crumbs a { color: var(--pp-head); text-decoration: none; }
.pp-crumbs a:hover { text-decoration: underline; }
.pp-crumbs__cart { margin-left: auto; font-weight: var(--heavy); }

.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2.8rem; align-items: start; }

/* ---------- Gallery ---------- */
.pp-gallery { position: sticky; top: 1.6rem; }
.pp-stage {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border: .2rem solid var(--pp-frame); border-radius: 2.4rem; background: var(--white);
}
.pp-slide, .pp-slide picture { position: absolute; inset: 0; }
.pp-slide[hidden] { display: none; }
.pp-slide img, .pp-slide video { width: 100%; height: 100%; object-fit: cover; }
.pp-slide video { position: absolute; inset: 0; background: #000; }
.pp-play { /* covers the video poster; darkens and shows a round play icon on hover */
  position: absolute; inset: 0; display: grid; place-items: center; width: 100%; padding: 0;
  border: 0; background: none; color: transparent; transition: background-color .2s ease, color .2s ease;
}
.pp-play:hover, .pp-play:focus-visible { background: rgba(0, 0, 0, .35); color: var(--white); }
.pp-play svg { width: 5.4rem; height: 5.4rem; }
.pp-ribbon {
  position: absolute; top: 1.4rem; left: 1.4rem; padding: .5rem 1.2rem; border-radius: 10rem;
  background: var(--pp-frame); color: var(--white); font-size: 1.3rem; line-height: 1.6rem;
}
.pp-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.pp-thumb {
  display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden;
  border: .15rem solid var(--pp-line); border-radius: 1.4rem; background: var(--white);
}
.pp-thumb picture, .pp-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pp-thumb[aria-pressed="true"] { border: .2rem solid var(--pp-frame); }
.pp-thumb:hover { border-color: var(--pp-frame); }

/* ---------- Title and price ---------- */
.pp-name { font-weight: var(--heavy); font-size: 2.8rem; line-height: 3.4rem; color: var(--pp-head); }
.pp-price { margin: .6rem 0 1.6rem; font-weight: var(--heavy); font-size: 2.6rem; line-height: 3.2rem; color: var(--pp-head); }

/* ---------- Choice blocks ---------- */
.pp-block {
  min-width: 0; margin: 0; padding: 1.8rem 1.8rem 1.6rem;
  border: .2rem solid var(--pp-frame); border-radius: 2.2rem; background: var(--white);
}
.pp-block + .pp-block { margin-top: 1.4rem; }
.pp-block__head { display: flex; align-items: center; gap: 1rem; width: 100%; margin-bottom: 1.2rem; padding: 0; float: left; }
.pp-block__head + * { clear: both; }
.pp-step {
  display: grid; place-items: center; flex: none; width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: var(--pp-frame); color: var(--white); font-weight: var(--heavy); font-size: 1.4rem; line-height: 1;
}
.pp-block__title { font-weight: var(--heavy); font-size: 1.7rem; line-height: 2.2rem; color: var(--pp-head); }
.pp-block__value { margin-left: auto; font-size: 1.4rem; line-height: 1.8rem; color: var(--pp-muted); text-align: right; }
.pp-block__value.is-set { color: var(--green-500); }

/* colour cards */
.pp-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.8rem, 1fr)); gap: 1rem; }
.pp-color {
  display: flex; flex-direction: column; align-items: center; gap: .8rem; padding: 1.2rem .8rem;
  border: .15rem solid var(--pp-line); border-radius: 1.6rem; background: var(--white);
  font-size: 1.45rem; line-height: 1.8rem; text-align: center; cursor: pointer;
}
.pp-color:hover { border-color: var(--pp-frame); }
.pp-color:has(input:checked) { border: .2rem solid var(--pp-frame); background: var(--pp-frame-soft); padding: 1.15rem .75rem; }
.pp-color:has(input:focus-visible), .pp-size:has(input:focus-visible) { outline: 2px solid var(--pp-frame); outline-offset: 2px; }
.pp-color__swatch { width: 3.8rem; height: 3.8rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.pp-swatch--000000 { background: #000000; }
.pp-swatch--11734b { background: #11734b; }
.pp-swatch--5a3286 { background: #5a3286; }
.pp-swatch--7f4e9f { background: #7f4e9f; }

/* size buttons */
.pp-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.6rem, 1fr)); gap: .8rem; }
.pp-size { cursor: pointer; }
.pp-size span {
  display: grid; place-items: center; min-height: 4.4rem; padding: .6rem .4rem;
  border: .15rem solid var(--pp-line); border-radius: 1.2rem; background: var(--white);
  font-weight: var(--heavy); font-size: 1.5rem; line-height: 1.8rem; text-align: center;
}
.pp-size:hover span { border-color: var(--pp-frame); }
.pp-size input:checked + span { border-color: var(--pp-frame); background: var(--pp-frame); color: var(--white); }
.pp-hint { margin-top: 1.4rem; text-align: right; }
.pp-link {
  padding: 0; border: 0; background: none; color: var(--pp-frame);
  font: inherit; font-weight: var(--heavy); font-size: 1.35rem; line-height: 1.8rem;
  text-decoration: underline; text-underline-offset: .3rem; cursor: pointer;
}
.pp-link[hidden] { display: none; }

/* quantity and extra lines */
.pp-qtyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; }
.pp-qty { display: inline-flex; align-items: center; overflow: hidden; border: .15rem solid var(--pp-line); border-radius: 10rem; }
.pp-qty button { width: 4rem; height: 4rem; border: 0; background: var(--white); color: var(--pp-head); font: inherit; font-weight: var(--heavy); font-size: 1.8rem; }
.pp-qty button:hover { background: var(--pp-frame-soft); }
.pp-qty input {
  width: 4rem; height: 4rem; border: 0; background: var(--white); color: var(--ink);
  font: inherit; font-weight: var(--heavy); font-size: 1.6rem; text-align: center; appearance: textfield; -moz-appearance: textfield;
}
.pp-qty input::-webkit-inner-spin-button, .pp-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pp-lines { display: flex; flex-direction: column; gap: .8rem; }
.pp-lines:not(:empty) { margin-top: 1.2rem; }
.pp-line { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.2rem; border-radius: 1.2rem; background: var(--pp-frame-soft); font-size: 1.45rem; line-height: 1.8rem; }
.pp-line .pp-line__dot { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.pp-line button { margin-left: auto; padding: 0 .4rem; border: 0; background: none; color: var(--pp-muted); font-size: 2rem; line-height: 1; }

/* summary */
.pp-summary__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.2rem; font-size: 1.5rem; }
.pp-summary__row b { font-weight: var(--heavy); font-size: 2.2rem; color: var(--pp-head); white-space: nowrap; }
.pp-cart {
  width: 100%; padding: 1.3rem 2.2rem; border: 0; border-radius: 10rem; background: var(--pp-frame); color: var(--white);
  font: inherit; font-weight: var(--heavy); font-size: 1.55rem; line-height: 2rem; transition: opacity .2s ease;
}
.pp-cart:hover { opacity: .9; }
.pp-cart:disabled { opacity: .45; cursor: not-allowed; }
.pp-msg { min-height: 2rem; margin-top: 1rem; font-size: 1.35rem; line-height: 2rem; color: var(--green-500); }
.pp-msg a { color: var(--pp-head); font-weight: var(--heavy); }
.pp-perk { display: flex; align-items: center; gap: .8rem; margin-top: .4rem; font-size: 1.4rem; line-height: 2rem; }
.pp-perk svg { flex: none; width: 1.8rem; height: 1.8rem; color: var(--green-500); }
.pp-info { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--pp-line); }
.pp-info summary { display: flex; justify-content: space-between; font-weight: var(--heavy); font-size: 1.5rem; line-height: 2rem; color: var(--pp-head); list-style: none; cursor: pointer; }
.pp-info summary::-webkit-details-marker { display: none; }
.pp-info summary::after { content: "+"; font-size: 2rem; line-height: 2rem; }
.pp-info[open] summary::after { content: "–"; }
.pp-info__body { margin-top: 1rem; font-size: 1.45rem; line-height: 2.2rem; }

/* size chart dialog */
.pp-chart { width: min(90vw, 80rem); padding: 2rem; border: .2rem solid var(--pp-frame); border-radius: 2.2rem; background: var(--white); }
.pp-chart::backdrop { background: rgba(0, 0, 0, .45); }
.pp-chart__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.pp-chart h2 { font-weight: var(--heavy); font-size: 2rem; line-height: 2.6rem; color: var(--pp-head); }
.pp-chart__close { width: 3.6rem; height: 3.6rem; border: 0; border-radius: 50%; background: var(--pp-frame-soft); color: var(--pp-head); font-size: 2.4rem; line-height: 1; }
.pp-chart picture, .pp-chart img { display: block; width: 100%; height: auto; }

/* ---------- Cart page ---------- */
.cart h1 { margin-bottom: 2rem; font-weight: var(--heavy); font-size: 3.5rem; line-height: 4.2rem; color: var(--pp-head); }
.cart__empty a, .cart__back { color: var(--pp-head); font-weight: var(--heavy); }
.cart__list { display: flex; flex-direction: column; gap: 1.2rem; }
.cart-line { display: grid; grid-template-columns: 8.8rem 1fr auto auto; gap: 1.6rem; align-items: center; }
.cart-line picture, .cart-line img { display: block; width: 8.8rem; height: 8.8rem; border-radius: 1.2rem; object-fit: cover; }
.cart-line__name { font-weight: var(--heavy); font-size: 1.6rem; line-height: 2.2rem; color: var(--pp-head); text-decoration: none; }
.cart-line__name:hover { text-decoration: underline; }
.cart-line__opts, .cart-line__unit { font-size: 1.35rem; line-height: 2rem; color: var(--pp-muted); }
.cart-line__qty { display: flex; align-items: center; gap: .8rem; }
.cart-line__qty form { display: contents; }
.cart-line__qty .pp-qty output { min-width: 3.4rem; font-weight: var(--heavy); font-size: 1.6rem; text-align: center; }
.cart-line__remove { padding: 0; border: 0; background: none; color: var(--pp-muted); font: inherit; font-size: 1.3rem; text-decoration: underline; }
.cart-line__total { min-width: 8rem; font-weight: var(--heavy); font-size: 1.7rem; color: var(--pp-head); text-align: right; white-space: nowrap; }
.cart__summary { max-width: 42rem; margin: 2rem 0 0 auto; }
.cart__checkout { display: block; margin-bottom: 1.2rem; text-align: center; text-decoration: none; }
.cart__note { margin-top: 1rem; font-size: 1.35rem; line-height: 2rem; color: var(--pp-muted); }

/* ---------- Back to the shop ---------- */
.product-back { height: 10.5rem; padding-top: 2.2rem; background: var(--green-900); }
.product-back__link {
  display: grid; place-items: center; width: 23rem; height: 6rem; margin-inline: auto;
  border-radius: 5rem; background: var(--lilac-300); color: var(--cream);
  font-size: 1.6rem; line-height: 1; text-decoration: none;
  transition: background-color .4s ease, color .4s ease;
}
.product-back__link:hover { background: #3f7652; color: var(--white); }

@media (prefers-reduced-motion: reduce) { .pp-cart, .pp-play { transition: none; } }

@media (max-width: 600px) {
  .pp, .cart { padding: 2rem 0 4rem; }
  .pp .column, .cart .column { padding: 0 1.6rem; }
  .pp-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .pp-gallery { position: static; }
  .pp-stage { border-radius: 1.8rem; }
  .pp-thumbs { gap: .8rem; }
  .pp-name { font-size: 2.2rem; line-height: 2.8rem; }
  .pp-price { font-size: 2.2rem; line-height: 2.8rem; }
  .pp-block { padding: 1.4rem 1.2rem 1.4rem; border-radius: 1.8rem; }
  .pp-colors { grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr)); gap: .8rem; }
  .pp-color { font-size: 1.35rem; }
  .pp-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pp-block__value { font-size: 1.3rem; }
  .pp-qtyrow .pp-link { text-align: left; }

  .cart h1 { font-size: 2.6rem; line-height: 3.2rem; }
  .cart-line { grid-template-columns: 6.4rem 1fr; gap: .8rem 1.2rem; }
  .cart-line picture, .cart-line img { width: 6.4rem; height: 6.4rem; }
  .cart-line__qty { grid-column: 2; }
  .cart-line__total { grid-column: 2; text-align: left; }
  .cart__summary { max-width: none; }

  .product-back { height: 20rem; padding-top: 2rem; }
  .product-back__link { width: 17rem; height: 4.2rem; }
}
