/* ============================================================
   Item details page (shop-item.html)
   Left: a large photo stage with arrows, a counter and thumbnails.
   Right: category, price, the buy button, the item's details as tiles and an "About this item" section.
   ============================================================ */
.product-page:has(.pd) { display: block; padding: 0; }
.pd {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.125rem, 2.4vw, 2.5rem);
  width: min(82.5rem, 100%); margin: 0 auto; padding: 1vh 3vw 4vh; box-sizing: border-box; align-items: start;
}

/* ---- photos ---- */
.pd-media { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.pd-stage {
  position: relative; display: grid; place-items: center; overflow: hidden;
  height: clamp(20rem, 58vh, 40rem);
  background:
    radial-gradient(60% 55% at 50% 45%, rgba(148,190,229,.16) 0%, transparent 70%),
    linear-gradient(160deg, rgba(42,8,26,.92) 0%, rgba(16,4,11,.95) 100%);
  border: 1px solid rgba(255,255,255,.12);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.375rem), calc(100% - 1.375rem) 100%, 0 100%);
}
.pd-stage img {   /* the whole photo always shows: it is fitted inside the stage, never cropped */
  position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain;
  filter: drop-shadow(0 1.625rem 2.375rem rgba(0,0,0,.6));
}
.pd-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 2.75rem; height: 2.75rem; display: grid; place-items: center; cursor: pointer;
  font: 400 1.875rem/1 var(--ff-ui), sans-serif; color: rgba(255,255,255,.85);
  background: rgba(12,4,10,.55); border: 1px solid rgba(255,255,255,.18); transition: background .18s ease, color .18s ease;
}
.pd-nav:hover, .pd-nav:focus-visible { color: #fff; background: rgba(154,29,87,.85); outline: none; }
.pd-nav--prev { left: 0.875rem; }
.pd-nav--next { right: 0.875rem; }
.pd-count {
  position: absolute; left: 1rem; bottom: 0.875rem; padding: 0.25rem 0.625rem;
  font: 600 0.6875rem var(--ff-ui), sans-serif; letter-spacing: .16em; color: rgba(255,255,255,.8); background: rgba(12,4,10,.6);
}
.pd-thumbs { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.pd-thumbs button {
  width: 4.75rem; height: 4.75rem; padding: 0.375rem; cursor: pointer; box-sizing: border-box;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); opacity: .7;
  transition: opacity .18s ease, border-color .18s ease;
}
.pd-thumbs button:hover { opacity: 1; }
.pd-thumbs button[aria-current] { opacity: 1; border-color: var(--sky); box-shadow: inset 0 0 0 1px var(--sky); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---- details ---- */
.pd-info {
  display: flex; flex-direction: column; gap: 1.125rem; min-width: 0; padding: 1.5rem 1.625rem 1.625rem;
  background: linear-gradient(160deg, rgba(36,8,22,.88) 0%, rgba(14,4,10,.92) 100%);
  border: 1px solid rgba(255,255,255,.12);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.375rem), calc(100% - 1.375rem) 100%, 0 100%);
}
.pd-cat {
  margin: 0; align-self: flex-start; padding: 0.3125rem 0.75rem;
  font: 600 0.6875rem var(--ff-ui), sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
}
.pd-price .product-price { display: flex; align-items: baseline; gap: 0.75rem; font: 400 clamp(2.8rem, 4.4vw, 4rem)/1 var(--ff-display), sans-serif; letter-spacing: .02em; color: #fff; }
.pd-price .mem-price-line { font-size: .55em; }
.pd-info .product-buy { display: flex; flex-direction: column; gap: 0.625rem; }
.pd-info .product-buy .buy-btn { width: 100%; min-height: 3.375rem; font-size: 0.875rem; justify-content: center; }
.pd-info .product-buy .buy-btn:empty { display: none; }
.pd-info .mem-hint { margin: -0.375rem 0 0; font-size: 0.8125rem; line-height: 1.5; color: rgba(255,255,255,.65); opacity: 1; }
.pd-info .mem-ship { margin: 0; }
.pd-info .mem-ship input { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.18); }

.pd-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.125rem, 1fr)); gap: 0.5rem; margin: 0; }
.pd-fact { margin: 0; padding: 0.75rem 0.875rem; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); min-width: 0; }
.pd-fact dt { margin: 0 0 0.25rem; font: 600 0.625rem var(--ff-ui), sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.pd-fact dd { margin: 0; font: 400 1.35rem/1.1 var(--ff-display), sans-serif; letter-spacing: .03em; color: #fff; overflow-wrap: anywhere; }

.pd-about { padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.pd-about h2 { margin: 0 0 0.5rem; font: 600 0.75rem var(--ff-ui), sans-serif; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.pd-about .product-desc { margin: 0; max-width: 62ch; font-size: 0.9375rem; line-height: 1.7; color: rgba(255,255,255,.82); }

/* ---- desktop: the page fits the screen exactly (no page scroll); the photo stage takes the height left over ---- */
@media (min-width: 901px) {
  html:not(.m-app) .page-body:has(.pd) { display: flex; overflow: hidden; padding: 1vh 3vw 2.5vh; }
  html:not(.m-app) .product-page:has(.pd) { flex: 1; min-height: 0; display: flex; }
  html:not(.m-app) .pd { flex: 1; min-height: 0; height: 100%; padding: 0; align-items: stretch; }
  html:not(.m-app) .pd-media { min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
  html:not(.m-app) .pd-stage { height: auto; min-height: 0; }
  html:not(.m-app) .pd-info { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(148,190,229,.45) transparent; }
}

/* ---- tablets and phones: one column, photos first ---- */
@media (max-width: 900px) {
  .pd { grid-template-columns: minmax(0, 1fr); padding: 0.5rem var(--m-pad, 0.75rem) 1.5rem; }
  .pd-stage { height: clamp(16.25rem, 48vh, 28.75rem); }
  .pd-info { padding: 1.125rem 1rem 1.25rem; gap: 0.875rem; }
  .pd-thumbs button { width: 3.875rem; height: 3.875rem; }
}

/* ---- desktop: the details always fit their box. Everything in it is sized from --s, which the page lowers step by step
   (shop-item.html, fitDetails) until the content fits, so the box never scrolls. Scrolling is only a last resort for
   content that cannot fit even at the smallest size (e.g. the delivery form on a very short window). ---- */
@media (min-width: 901px) {
  html:not(.m-app) .pd-info { --s: 1; gap: calc(1.125rem * var(--s)); padding: calc(1.5rem * var(--s)) calc(1.625rem * var(--s)); }
  html:not(.m-app) .pd-cat { font-size: calc(0.6875rem * var(--s)); padding: calc(0.3125rem * var(--s)) calc(0.75rem * var(--s)); }
  html:not(.m-app) .pd-price .product-price { font-size: calc(min(4.4vw, 4rem) * var(--s)); }
  html:not(.m-app) .pd-info .product-buy .buy-btn { min-height: calc(3.375rem * var(--s)); font-size: calc(0.875rem * var(--s)); }
  html:not(.m-app) .pd-info .mem-hint { font-size: calc(0.8125rem * var(--s)); }
  html:not(.m-app) .pd-info .mem-ship { gap: calc(0.5rem * var(--s)); }
  html:not(.m-app) .pd-info .mem-ship input { min-height: calc(2.625rem * var(--s)); font-size: calc(0.875rem * var(--s)); }
  html:not(.m-app) .pd-facts { gap: calc(0.5rem * var(--s)); }
  html:not(.m-app) .pd-fact { padding: calc(0.75rem * var(--s)) calc(0.875rem * var(--s)); }
  html:not(.m-app) .pd-fact dt { font-size: calc(0.625rem * var(--s)); margin-bottom: calc(0.25rem * var(--s)); }
  html:not(.m-app) .pd-fact dd { font-size: calc(1.35rem * var(--s)); }
  html:not(.m-app) .pd-about { padding-top: calc(1rem * var(--s)); }
  html:not(.m-app) .pd-about h2 { font-size: calc(0.75rem * var(--s)); margin-bottom: calc(0.5rem * var(--s)); }
  html:not(.m-app) .pd-about .product-desc { font-size: calc(0.9375rem * var(--s)); line-height: 1.6; }
}

/* Price: a lighter, cleaner figure (Oswald, not the heavy display face) that lines up with the label above it */
.pd-price { display: flex; flex-direction: column; gap: calc(0.25rem * var(--s, 1)); }
.pd-price::before { content: "Price"; font: 600 calc(0.625rem * var(--s, 1)) var(--ff-ui), sans-serif; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); }
html body .pd-price .product-price {
  display: flex; align-items: baseline; gap: .4em; margin: 0;
  font: 500 calc(2.1rem * var(--s, 1))/1.05 var(--ff-ui), sans-serif; letter-spacing: .01em; color: #fff;
}
html body .pd-price .mem-price-line { font-size: .6em; font-weight: 400; color: rgba(255,255,255,.55); opacity: 1; margin: 0; }
html body .pd-price .mem-member-price { color: #fff; }
html body .pd-info .buy-price { font: 500 1.05em var(--ff-ui), sans-serif; letter-spacing: .04em; }
