/* ==========================================================================
   Product page (/product/:slug)
   Mobile: full-bleed swipe gallery, then the buy box.
   Desktop: gallery sticks on the left while the info column scrolls.
   ========================================================================== */

.pdp-crumbs { padding-top: var(--sp-4); margin-bottom: var(--sp-3); }
.pdp { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); padding-bottom: var(--sp-8); }
@media (min-width: 960px) {
  .pdp { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2.5rem, 4vw, 4.5rem); align-items: start; }
  .pdp__gallery { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
}

/* ---------- Gallery ---------- */
.pdp__gallery { margin-inline: calc(var(--gutter) * -1); }
.gallery__wrap { position: relative; }
.gallery__main {
  position: relative;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--tile);
  aspect-ratio: 1;
}
.gallery__main::-webkit-scrollbar { display: none; }
.gallery__main:focus-visible { outline-offset: -3px; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; cursor: zoom-in; border: 0; padding: 0; background: none; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }

.gallery__count {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  padding: 4px 10px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.9); color: var(--black);
  box-shadow: inset 0 0 0 1px rgba(22, 22, 26, 0.08);
  font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.gallery__nav {
  position: absolute; top: 50%; z-index: 2;
  display: none; place-items: center;
  width: 44px; height: 44px; margin-top: -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--black);
  box-shadow: 0 4px 16px rgba(22, 22, 26, 0.14);
  opacity: 0;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.gallery__nav .icon { width: 20px; height: 20px; }
.gallery__nav--prev { left: 14px; }
.gallery__nav--prev .icon { transform: rotate(180deg); }
.gallery__nav--next { right: 14px; }
.gallery__nav:hover { transform: scale(1.06); }
.gallery__wrap:hover .gallery__nav, .gallery__nav:focus-visible { opacity: 1; }

.gallery__dots { display: flex; justify-content: center; gap: 6px; margin-top: var(--sp-3); }
.gallery__dots span { width: 6px; height: 6px; border-radius: 99px; background: var(--line-strong); transition: width var(--dur) var(--ease), background var(--dur) var(--ease); }
.gallery__dots span.is-active { width: 20px; background: var(--ink); }
.gallery__thumbs { display: none; }
.sk-block { background: var(--bg-soft); }

@media (min-width: 960px) {
  .pdp__gallery { margin: 0; display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-3); }
  .gallery__main { border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line); }
  .gallery__wrap { grid-column: 2; }
  .gallery__nav { display: grid; }
  .gallery__dots { display: none; }
  .gallery__thumbs { grid-column: 1; grid-row: 1; display: grid; gap: var(--sp-2); align-content: start; }
  .gallery__thumbs button {
    position: relative; aspect-ratio: 1; overflow: hidden;
    border-radius: var(--radius); background: var(--tile);
    box-shadow: inset 0 0 0 1px var(--line);
    opacity: 0.65;
    transition: opacity var(--dur), box-shadow var(--dur);
  }
  .gallery__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
  .gallery__thumbs button:hover { opacity: 1; }
  .gallery__thumbs button.is-active { opacity: 1; box-shadow: inset 0 0 0 2px var(--ink); }
}

/* ---------- Info ---------- */
.pdp__info { display: grid; gap: var(--sp-5); align-content: start; }
.pdp__head { display: grid; gap: var(--sp-3); }
.pdp__eyebrow { display: flex; align-items: center; gap: var(--sp-3); }
.pdp__eyebrow a {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-muted);
}
.pdp__eyebrow a:hover { color: var(--ink); }
.pdp__eyebrow .badge--best { box-shadow: inset 0 0 0 1px var(--line-strong); }
.pdp__title { font-size: clamp(2.1rem, 1.5rem + 2.2vw, 3.25rem); line-height: 1; }
.pdp__price { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.pdp__price .price { font-size: var(--fs-2xl); font-family: var(--font-body); letter-spacing: -0.01em; }
.pdp__price s { color: var(--ink-faint); font-size: var(--fs-lg); }
.pdp__save { padding: 4px 10px; border-radius: 99px; background: var(--lime); color: var(--black); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.04em; }
.pdp__cod { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-muted); }
.pdp__cod .icon { width: 18px; height: 18px; color: var(--accent-text); }
.pdp__cod strong { color: var(--ink); }

.pdp__perks {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  list-style: none; margin: 0; padding: var(--sp-4) 0 0;
  border-top: 1px solid var(--line);
}
.pdp__perks li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-elev);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-xs); font-weight: 700;
}
.pdp__perks .icon { width: 16px; height: 16px; color: var(--accent-text); }

/* Options */
.pdp__opt { display: grid; gap: var(--sp-2); }
.opt-label { display: flex; gap: 6px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.opt-label span { font-weight: 600; letter-spacing: 0.04em; text-transform: none; font-size: var(--fs-sm); color: var(--ink-muted); }
.finish-opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.finish-opt {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm);
  transition: box-shadow var(--dur) var(--ease);
}
.finish-opt img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); background: var(--tile); }
.finish-opt:hover { box-shadow: inset 0 0 0 1px var(--ink-faint); }
.finish-opt[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.finish-opt__name { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.finish-opt__name .swatch { width: 12px; height: 12px; border-width: 0; }
.finish-opt small { display: block; color: var(--ink-muted); font-weight: 500; }

.len-opts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.len-opt {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px;
  border-radius: var(--radius-pill); background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: var(--fs-sm);
}
.len-opts small { color: var(--ink-muted); font-size: var(--fs-xs); }

/* Buy box */
.pdp__buybox { display: grid; gap: var(--sp-3); }
.stock-line { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; }
.stock-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #23a75f; box-shadow: 0 0 0 3px rgba(35, 167, 95, 0.18); }
.stock-line--low { color: #a35a00; }
.stock-line--low::before { background: #e08a00; box-shadow: 0 0 0 3px rgba(224, 138, 0, 0.2); }
.stock-line--out::before { background: var(--danger); box-shadow: none; }

.buy { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2); }
.buy .qty { border-radius: var(--btn-radius); height: 54px; background: var(--bg-elev); border-color: var(--line-strong); }
.buy .qty button { width: 42px; height: 52px; }
.buy .btn { min-height: 54px; padding-inline: 1.1rem; }
@media (max-width: 389px) { .buy .atc-price { display: none; } }
.buy__now { grid-column: 1 / -1; }
.buy__wa { grid-column: 1 / -1; display: inline-flex; justify-content: center; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-muted); padding: 6px; }
.buy__wa .icon { color: #1faa53; width: 18px; height: 18px; }
.buy__wa:hover { color: var(--ink); }

/* Delivery / exchange card */
.pdp__ship {
  display: grid; gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm);
}
.pdp__ship-row { display: grid; grid-template-columns: 22px 1fr; gap: var(--sp-3); align-items: start; }
.pdp__ship-row .icon { width: 20px; height: 20px; color: var(--ink); margin-top: 1px; }
.pdp__ship-row p { display: grid; gap: 1px; line-height: 1.45; }
.pdp__ship-row span { color: var(--ink-muted); }
.pdp__bar { margin: calc(var(--sp-2) * -1) 0 0 calc(22px + var(--sp-3)); height: 5px; }

/* Accordions */
.pdp__details { border-top: 1px solid var(--line); }
.pdp__details summary { font-size: var(--fs-md); padding: var(--sp-4) 0; }
.pdp__details details p, .pdp__details details li { color: var(--ink-muted); font-size: var(--fs-sm); }
.pdp__details .rich { padding-bottom: var(--sp-5); display: grid; gap: var(--sp-3); }
.pdp__details .rich ul { padding-left: 1.1rem; margin: 0; display: grid; gap: 4px; }
.pdp__details .rich strong { color: var(--ink); }
.pdp__details .spec { list-style: none; padding: 0 !important; gap: 0 !important; }
.pdp__details .spec li {
  display: flex; justify-content: space-between; gap: var(--sp-4);
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.pdp__details .spec li:last-child { border-bottom: 0; }
.pdp__details .spec strong { font-weight: 600; text-align: right; }

/* ---------- Sticky add-to-cart ---------- */
.sticky-atc {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom));
  z-index: 55;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--gutter);
  background: var(--drawer-bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 30px -12px rgba(22, 22, 26, 0.18);
  transform: translateY(120%);
  transition: transform 250ms var(--ease);
}
.sticky-atc.is-visible { transform: none; }
.sticky-atc img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius); background: var(--tile); box-shadow: inset 0 0 0 1px var(--line); }
.sticky-atc p { font-size: var(--fs-sm); font-weight: 700; line-height: 1.25; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-atc p span { display: block; font-weight: 500; color: var(--ink-muted); }
.sticky-atc .btn { min-height: 44px; padding: 0 1.2rem; }
@media (min-width: 1024px) {
  .sticky-atc { left: auto; right: var(--gutter); bottom: var(--sp-4); width: min(440px, 40vw); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 8px 8px 8px 10px; box-shadow: var(--shadow-md); }
  .sticky-atc img { border-radius: 50%; }
}

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-drawer); background: #fff; }
.lightbox__track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox__track::-webkit-scrollbar { display: none; }
.lightbox__track img { flex: 0 0 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.lightbox__close { position: absolute; top: 12px; right: 12px; z-index: 2; background: var(--black); color: #fff; }
.lightbox__close:hover { background: var(--black); }

.pdp-missing { display: grid; justify-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-9) 0; }
