/* ==========================================================================
   Product page (/product/:slug)
   ========================================================================== */

.pdp-crumbs { padding-top: var(--sp-4); margin-bottom: var(--sp-3); }
.pdp { display: grid; gap: var(--sp-5); padding-bottom: var(--sp-7); }
@media (min-width: 960px) {
  .pdp { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--sp-8); align-items: start; }
  .pdp__info { position: sticky; top: calc(var(--header-h) + var(--sp-4)); }
}

/* ---------- Gallery ---------- */
.pdp__gallery { margin-inline: calc(var(--gutter) * -1); }
.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__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__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); transition: width var(--dur) var(--ease), background var(--dur) var(--ease); }
.gallery__dots span.is-active { width: 20px; background: var(--lime); }
.gallery__count {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  padding: 3px 10px; border-radius: 99px; background: rgba(10, 10, 11, 0.7); color: #fff;
  font-size: var(--fs-xs); font-weight: 700; pointer-events: none;
}
.gallery__wrap { position: relative; }
.gallery__thumbs { display: none; }
.sk-block { background: var(--bg-soft); }

@media (min-width: 960px) {
  .pdp__gallery { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: var(--sp-3); }
  .gallery__thumbs { display: grid; gap: var(--sp-2); align-content: start; }
  .gallery__thumbs button { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); border: 1.5px solid transparent; background: var(--tile); opacity: 0.6; transition: opacity var(--dur), border-color var(--dur); }
  .gallery__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
  .gallery__thumbs button.is-active, .gallery__thumbs button:hover { opacity: 1; border-color: var(--lime); }
  .gallery__main { border-radius: var(--radius); }
  .gallery__dots { display: none; }
  .gallery__wrap { grid-column: 2; }
  .gallery__thumbs { grid-column: 1; grid-row: 1; }
}

/* ---------- Info ---------- */
.pdp__info { display: grid; gap: var(--sp-4); align-content: start; }
.pdp__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pdp__badges .badge { font-size: 10px; }
.pdp__title { font-size: clamp(2rem, 1.5rem + 2vw, 3rem); }
.pdp__meta { color: var(--ink-muted); font-size: var(--fs-sm); margin-top: -8px; }
.pdp__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-3); }
.pdp__price .price { font-size: var(--fs-2xl); font-family: var(--font-body); }
.pdp__save { padding: 3px 10px; border-radius: 99px; background: var(--lime); color: var(--black); font-size: var(--fs-xs); font-weight: 800; }
.pdp__cod { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: -8px; }
.pdp__cod strong { color: var(--ink); }

.opt-label { font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--sp-2); }
.opt-label span { font-weight: 500; color: var(--ink-muted); }
.finish-opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); max-width: 26rem; }
.finish-opt {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: var(--sp-3);
  padding: 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: var(--fs-sm);
  transition: border-color var(--dur);
}
.finish-opt img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--tile); }
.finish-opt[aria-current="true"] { border-color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime); }
.finish-opt:hover { border-color: var(--ink-muted); }
.finish-opt small { display: block; font-weight: 500; color: var(--ink-muted); }
.pill-opt { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border: 1.5px solid var(--lime); border-radius: var(--radius-pill); font-weight: 700; font-size: var(--fs-sm); }

.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: #35d07f; box-shadow: 0 0 0 3px rgba(53, 208, 127, 0.2); }
.stock-line--low::before { background: var(--lime); box-shadow: 0 0 0 3px rgba(214, 245, 106, 0.25); }
.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: 52px; }
.buy .qty button { width: 42px; height: 50px; }
.buy .btn { min-height: 52px; }
.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: 700; color: var(--ink-muted); padding: 4px; }
.buy__wa .icon { color: #25d366; width: 18px; height: 18px; }
.buy__wa:hover { color: var(--ink); }

.delivery-box { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); font-size: var(--fs-sm); }
.delivery-box p { display: grid; grid-template-columns: 22px 1fr; gap: var(--sp-3); align-items: start; }
.delivery-box .icon { width: 20px; height: 20px; color: var(--lime); }
.delivery-box strong { color: var(--ink); }
.delivery-box span { color: var(--ink-muted); }

.trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.trust-grid div { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--radius); background: var(--bg-soft); font-size: var(--fs-xs); font-weight: 700; }
.trust-grid .icon { width: 18px; height: 18px; color: var(--lime); flex: none; }

.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-4); 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); }

/* ---------- Sticky add-to-cart (mobile) ---------- */
.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: 48px 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 -10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(120%);
  transition: transform 250ms var(--ease);
}
.sticky-atc.is-visible { transform: none; }
.sticky-atc img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--tile); }
.sticky-atc p { font-size: var(--fs-sm); font-weight: 700; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-atc p span { display: block; font-weight: 600; color: var(--ink-muted); }
.sticky-atc .btn { min-height: 44px; padding: 0 1.1rem; }
@media (min-width: 1024px) {
  .sticky-atc { bottom: 0; grid-template-columns: 48px 1fr auto; max-width: none; }
}

/* ---------- 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: rgba(10, 10, 11, 0.8); color: #fff; }

.pdp-missing { display: grid; justify-items: center; gap: var(--sp-4); text-align: center; padding: var(--sp-9) 0; }
