/* =====================================================================
   Product page (product_details.php) — premium storefront layout.
   Every class is prefixed `pdp-` so nothing here can touch the other shop
   pages. Tokens match the homepage / header (cobalt #1466E0, ink #0C1B3A).
   ===================================================================== */
[v-cloak] { display: none !important; }

.pdp {
  --ink: #0C1B3A; --muted: #4E5B78; --muted2: #8791A8;
  --line: rgba(12, 27, 58, .10); --line2: rgba(12, 27, 58, .16);
  --brand: #1466E0; --brand-d: #0F55C2; --bg: #F6F8FC;
  --green: #0E8A5B; --green-bg: #E6F6EF; --red: #C0341D; --red-bg: #FDECEA; --gold: #F5A524;
  max-width: 1320px; margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 56px;
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
.pdp *, .pdp *::before, .pdp *::after { box-sizing: border-box; }
.pdp a { text-decoration: none; }
.pdp h1, .pdp h2, .pdp h3 { font-family: "Archivo", system-ui, sans-serif; letter-spacing: -.02em; color: var(--ink); }

/* breadcrumbs */
.pdp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--muted2); margin: 0 0 18px; }
.pdp-crumbs a { color: var(--muted); font-weight: 600; }
.pdp-crumbs a:hover { color: var(--brand); }
.pdp-crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }

/* main two-column layout */
.pdp-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 44px; align-items: start; }

/* ── gallery ────────────────────────────────────────────────────────── */
.pdp-gallery { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 14px; align-items: start; }
.pdp-thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 600px; overflow-y: auto; scrollbar-width: none; }
.pdp-thumbs::-webkit-scrollbar { display: none; }
.pdp-thumb {
  width: 78px; height: 78px; padding: 0; border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer;
  border: 2px solid var(--line); transition: border-color .15s, transform .15s; flex: none;
}
.pdp-thumb:hover { border-color: var(--line2); }
.pdp-thumb.is-on { border-color: var(--brand); }
.pdp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pdp-stage { position: relative; border-radius: 24px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.pdp-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pdp-track::-webkit-scrollbar { display: none; }
.pdp-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: #fff; }
.pdp-slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pdp-badge {
  position: absolute; top: 16px; left: 16px; z-index: 2;
  background: var(--red-bg); color: var(--red); font-weight: 800; font-size: 12.5px;
  padding: 6px 11px; border-radius: 999px; letter-spacing: .01em;
}
.pdp-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  color: var(--ink); font-size: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transition: opacity .18s; box-shadow: 0 6px 18px -8px rgba(12, 27, 58, .35);
}
.pdp-stage:hover .pdp-arrow { opacity: 1; }
.pdp-arrow--prev { left: 12px; } .pdp-arrow--next { right: 12px; }
.pdp-count { display: none; position: absolute; right: 12px; bottom: 12px; z-index: 2; background: rgba(12, 27, 58, .72); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pdp-dots { display: none; justify-content: center; gap: 6px; padding: 12px 0 2px; }
.pdp-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line2); transition: all .2s; }
.pdp-dots i.is-on { width: 20px; border-radius: 6px; background: var(--brand); }

/* ── buy box ────────────────────────────────────────────────────────── */
.pdp-buy { position: sticky; top: 92px; }
.pdp-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.pdp-eyebrow .pdp-feat { background: #FFF3D6; color: #9A6200; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; text-transform: none; font-size: 11.5px; }
.pdp-title { font-size: clamp(24px, 2.8vw, 34px); line-height: 1.16; font-weight: 800; margin: 0 0 12px; }
.pdp-rating { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.pdp-rating .pdp-stars { color: var(--gold); letter-spacing: 1.5px; font-size: 15px; }
.pdp-rating a { color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.pdp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.pdp-price__now { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: clamp(32px, 4vw, 42px); letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.pdp-price__was { font-size: 17px; color: var(--muted2); text-decoration: line-through; }
.pdp-save { display: inline-block; background: var(--green-bg); color: var(--green); font-weight: 800; font-size: 13px; padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; }

.pdp-stock { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.pdp-stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.pdp-stock.is-low { color: #B25E00; } .pdp-stock.is-low::before { background: #F59E0B; box-shadow: 0 0 0 4px #FEF3C7; }
.pdp-stock.is-out { color: var(--red); } .pdp-stock.is-out::before { background: #EF4444; box-shadow: 0 0 0 4px var(--red-bg); }
.pdp-sku { color: var(--muted2); font-weight: 500; margin-left: 4px; }

.pdp-bulk { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 20px; }
.pdp-bulk h3 { font-size: 14px; margin: 0 0 8px; font-weight: 800; }
.pdp-bulk table { width: 100%; font-size: 13.5px; border-collapse: collapse; }
.pdp-bulk th { color: var(--muted2); font-weight: 600; text-align: left; padding: 3px 0; font-size: 12px; }
.pdp-bulk td { padding: 5px 0; border-top: 1px solid var(--line); }
.pdp-bulk td:last-child { font-weight: 800; color: var(--green); }

.pdp-buyrow { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.pdp-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line2); border-radius: 14px; overflow: hidden; background: #fff; height: 54px; }
.pdp-qty button { width: 46px; height: 100%; border: 0; background: transparent; font-size: 20px; font-weight: 700; color: var(--muted); cursor: pointer; }
.pdp-qty button:hover { background: var(--bg); color: var(--ink); }
.pdp-qty input { width: 46px; border: 0; text-align: center; font-weight: 800; font-size: 16px; outline: none; background: transparent; -moz-appearance: textfield; color: var(--ink); }
.pdp-qty input::-webkit-outer-spin-button, .pdp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pdp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 54px; padding: 0 22px; border-radius: 14px; font: 800 16px "Public Sans", system-ui, sans-serif;
  cursor: pointer; border: 1.5px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s; width: 100%;
}
.pdp-btn--primary { background: var(--brand); color: #fff; box-shadow: 0 14px 28px -12px rgba(20, 102, 224, .7); }
.pdp-btn--primary:hover { background: var(--brand-d); transform: translateY(-1px); }
.pdp-btn--ghost { background: #fff; color: var(--ink); border-color: var(--ink); }
.pdp-btn--ghost:hover { background: var(--ink); color: #fff; }
.pdp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.pdp-trust { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.pdp-trust div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: var(--muted); }
.pdp-trust i { color: var(--brand); font-size: 18px; line-height: 1; margin-top: 1px; flex: none; }
.pdp-trust b { display: block; color: var(--ink); font-weight: 700; font-size: 13.5px; }

/* ── content sections ───────────────────────────────────────────────── */
.pdp-section { margin-top: 52px; }
.pdp-section > h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; margin: 0 0 18px; }
.pdp-about { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pdp-prose { font-size: 15px; line-height: 1.75; color: var(--muted); }
.pdp-prose p { margin: 0 0 12px; }
.pdp-prose strong { color: var(--ink); }
.pdp-lead { font-size: 16.5px; line-height: 1.65; color: var(--ink); margin: 0 0 16px; font-weight: 500; }
.pdp-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.pdp-video { border-radius: 18px; overflow: hidden; margin-top: 18px; }

/* reviews */
.pdp-reviews .review-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; background: #fff; }
.pdp-reviews .rating-bar-row .bar-fill { background: var(--gold); }

/* related */
.pdp-related { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.pdp-rcard { background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.pdp-rcard:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px rgba(12, 27, 58, .35); }
.pdp-rcard__img { aspect-ratio: 1 / 1; background: #fff; }
.pdp-rcard__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pdp-rcard__body { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.pdp-rcard__name { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pdp-rcard__price { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 16px; color: var(--ink); }

/* ── mobile sticky buy bar ──────────────────────────────────────────── */
.pdp-bar { display: none; }

/* ── server-rendered preview → skeletons ────────────────────────────── */
#pdSsr .pdp-slide { aspect-ratio: 1 / 1; }
.pdp-skel { position: relative; overflow: hidden; background: #EEF2F8; border-radius: 12px; }
.pdp-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent); animation: pdpShimmer 1.3s infinite; }
@keyframes pdpShimmer { 100% { transform: translateX(100%); } }
.pdp-skel--btn { height: 54px; border-radius: 14px; margin-bottom: 12px; }
.pdp-skel--line { height: 12px; margin-bottom: 10px; }
html.pd-ready #pdSsr { display: none; }
@media (prefers-reduced-motion: reduce) { .pdp-skel::after { animation: none; } }

/* ── tablet / mobile ────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .pdp { padding-top: 14px; padding-bottom: 96px; }
  .pdp-grid { grid-template-columns: 1fr; gap: 22px; }
  .pdp-gallery { grid-template-columns: 1fr; }
  .pdp-thumbs { display: none; }
  .pdp-arrow { display: none; }
  .pdp-stage { border-radius: 20px; margin: 0 -4px; }
  .pdp-count { display: block; }
  .pdp-dots { display: flex; }
  .pdp-buy { position: static; }
  .pdp-about { grid-template-columns: 1fr; gap: 20px; }
  .pdp-section { margin-top: 40px; }
  .pdp-related { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin: 0 -16px; padding: 4px 16px 8px; scrollbar-width: none; }
  .pdp-related::-webkit-scrollbar { display: none; }
  .pdp-rcard { flex: 0 0 62%; scroll-snap-align: start; }
  .pdp-trust { grid-template-columns: 1fr; }
  /* the in-page Add to cart stays; the bar below is a second, always-visible one */
  .pdp-bar {
    display: flex; align-items: center; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px -18px rgba(12, 27, 58, .35);
  }
  .pdp-bar__price { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
  .pdp-bar__price b { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 20px; color: var(--ink); }
  .pdp-bar__price s { font-size: 12px; color: var(--muted2); }
  .pdp-bar .pdp-btn { height: 50px; flex: 1; }
}
@media (max-width: 420px) {
  .pdp-title { font-size: 23px; }
  .pdp-buyrow { grid-template-columns: 1fr; }
  .pdp-qty { width: 100%; justify-content: space-between; }
  .pdp-qty input { flex: 1; }
}

.pdp-about--solo { grid-template-columns: 1fr; }
.pdp-rcard { color: inherit; }

/* ── full-screen image viewer ───────────────────────────────────────── */
.pdp-slide img { cursor: zoom-in; }
html.pdp-lock { overflow: hidden; }
.pdp-zoom { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 14, 30, .95); outline: none; display: flex; }
.pdp-zoom__scroll { flex: 1; display: flex; overflow: auto; padding: 60px 14px 70px; -webkit-overflow-scrolling: touch; }
.pdp-zoom__scroll img { margin: auto; display: block; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; border-radius: 6px; background: #fff; }
.pdp-zoom__scroll.is-zoomed img { max-width: none; max-height: none; width: 230%; cursor: zoom-out; }
.pdp-zoom__x, .pdp-zoom__nav {
  position: absolute; z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 19px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(6px);
}
.pdp-zoom__x:hover, .pdp-zoom__nav:hover { background: rgba(255, 255, 255, .24); }
.pdp-zoom__x { top: 14px; right: 14px; }
.pdp-zoom__nav { top: 50%; transform: translateY(-50%); }
.pdp-zoom__nav--prev { left: 14px; } .pdp-zoom__nav--next { right: 14px; }
.pdp-zoom__hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: rgba(255, 255, 255, .78); font: 600 13px "Public Sans", system-ui, sans-serif; pointer-events: none; padding: 0 70px; }
@media (max-width: 960px) { .pdp-zoom__nav { display: none; } .pdp-zoom__scroll { padding: 56px 8px 64px; } }
