/* ============================================================
   BLUE — product detail page (pd-*)
   Renders one product from ?id= via product.js.
   ============================================================ */

/* ---------------------------------------------- breadcrumbs */
.pd-crumbs { padding: clamp(18px, 3vw, 28px) 0 0; }
.pd-crumbs .container {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.pd-crumbs a { color: var(--ink-soft); transition: color .2s; }
.pd-crumbs a:hover { color: var(--royal); }
.pd-crumbs [aria-current] { color: var(--ink); }
.pd-crumb-sep { color: rgba(14, 31, 56, .28); }

/* ---------------------------------------------- main grid */
.pd {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 48px; align-items: start;
  padding-block: clamp(20px, 3vw, 36px) clamp(56px, 7vw, 96px);
}

/* ---------------------------------------------- gallery */
.pd-gallery { display: grid; gap: 14px; }
.pd-hero {
  position: relative; margin: 0;
  aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden;
  background: var(--powder-2);
}
.pd-hero img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--ease-out);
  will-change: transform;
}
.pd-badge { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; }

.pd-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pd-tile {
  aspect-ratio: 1 / 1; border-radius: var(--r-md); overflow: hidden;
  background: var(--powder-2); position: relative;
}
.pd-tile img { width: 100%; height: 100%; object-fit: cover; }
.pd-crop-tl { object-position: top left; transform: scale(1.9); transform-origin: top left; }
.pd-crop-br { object-position: bottom right; transform: scale(1.9); transform-origin: bottom right; }
/* real thumbnails (click to promote to the main image) */
.pd-thumb { border: 0; padding: 0; margin: 0; cursor: pointer; display: block; }
.pd-thumb img { transition: transform .7s var(--ease-out); }
.pd-thumb:hover img { transform: scale(1.06); }
.pd-thumb:focus-visible { outline: 2px solid var(--royal); outline-offset: 2px; }

.pd-tile-info {
  background: var(--navy); color: #E9EFF8;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 3px; padding: 18px;
  transition: background .3s;
}
.pd-tile-info:hover { background: var(--navy-2); }
.pd-ti-n { font-size: clamp(1.6rem, 2.6vw, 2.7rem); line-height: 1; color: #fff; }
[dir="rtl"] .pd-tile-info:hover .arr { transform: translateX(-4px); }
.pd-ti-t { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(233, 239, 248, .6); }
.pd-ti-cta { margin-top: 10px; font-size: var(--text-xs); font-weight: 700; color: var(--sky); display: inline-flex; gap: 6px; }
.pd-ti-cta .arr { transition: transform .3s var(--ease-out); }
.pd-tile-info:hover .arr { transform: translateX(4px); }

/* ---------------------------------------------- buy panel */
.pd-buy {
  position: sticky; top: calc(var(--header-h) + 24px);
  display: grid; gap: 15px; align-content: start;
}
.pd-name { font-size: var(--text-2xl); }
.pd-rating { width: max-content; }
.pd-rating:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.pd-tag { color: var(--ink-soft); max-width: 42ch; }

.pd-price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 2px; }
.pd-price { font-size: clamp(1.7rem, 1.35rem + 1.3vw, 2.2rem); }
.pd-was { color: var(--ink-soft); text-decoration: line-through; font-size: var(--text-md); }
.pd-price-row .chip-sale { transform: translateY(-4px); }

.pd-lab {
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}

/* size selector */
.pd-sizes { border: 0; margin: 0; padding: 0; min-width: 0; }
.pd-sizes legend { padding: 0; margin-bottom: 10px; }
.pd-size-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pd-size {
  position: relative; display: grid; gap: 1px;
  padding: 12px 15px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer;
  transition: border-color .2s, box-shadow .25s var(--ease-out), transform .25s var(--ease-out);
}
.pd-size:hover { border-color: var(--royal); transform: translateY(-1px); }
.pd-size input { position: absolute; opacity: 0; pointer-events: none; }
.pd-size.active { border-color: var(--royal); box-shadow: 0 0 0 1px var(--royal), var(--shadow-sm); }
.pd-size:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(var(--royal-rgb), .28); }
.pd-size-l { font-weight: 700; font-size: var(--text-sm); }
.pd-size-d { font-size: var(--text-xs); color: var(--ink-soft); }
.pd-size-p { font-size: var(--text-xs); font-weight: 700; color: var(--royal); margin-top: 5px; }

/* feel row */
.pd-feel { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 2px; }
.pd-feel-label { font-size: var(--text-sm); font-weight: 600; }

/* quantity */
.pd-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pd-qty {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper);
}
.pd-qty button {
  width: 38px; height: 38px; border: 0; background: none;
  font-size: 17px; color: var(--ink); border-radius: 50%;
  transition: background .2s;
}
.pd-qty button:hover { background: var(--powder-2); }
.pd-qty b { min-width: 28px; text-align: center; font-size: var(--text-sm); }

/* add to cart */
.pd-add { width: 100%; justify-content: center; padding-block: 17px; font-size: .95rem; }

/* reassurance */
.pd-assure {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 16px 0 4px; border-top: 1px solid var(--line-soft);
}
.pd-assure li {
  display: grid; justify-items: center; gap: 7px; text-align: center;
  font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft); line-height: 1.35;
}
.pd-assure svg { width: 21px; height: 21px; color: var(--royal); }

/* accordion */
.pd-acc { border-top: 1px solid var(--line); margin-top: 4px; }
.pd-acc-item { border-bottom: 1px solid var(--line); }
.pd-acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 17px 2px; border: 0; background: none; text-align: start;
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--ink);
}
.pd-acc-x {
  font-family: var(--font-body); font-size: 1.25rem; font-weight: 300; line-height: 1;
  color: var(--royal); transition: transform .35s var(--ease-out);
}
.pd-acc-item.open .pd-acc-x { transform: rotate(45deg); }
.pd-acc-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease-out); }
.pd-acc-item.open .pd-acc-panel { grid-template-rows: 1fr; }
.pd-acc-inner { overflow: hidden; min-height: 0; }
.pd-acc-body { padding: 0 2px 20px; font-size: var(--text-sm); color: var(--ink-soft); line-height: 1.7; }
.pd-acc-layers { list-style: none; margin: 0; padding: 0; counter-reset: pdl; display: grid; gap: 9px; }
.pd-acc-layers li {
  counter-increment: pdl;
  display: flex; gap: 12px; align-items: baseline;
  font-weight: 600; color: var(--ink);
}
.pd-acc-layers li::before {
  content: counter(pdl, decimal-leading-zero);
  font-family: var(--font-display); font-weight: 600; font-size: .8rem; color: var(--brass);
}

/* ---------------------------------------------- construction (on-navy) */
/* real cutaway render — framed on a light card so it reads on the navy section */
.pd-cut {
  margin: 0 auto clamp(26px, 5vw, 52px); max-width: 720px;
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  padding: clamp(14px, 2.6vw, 30px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.pd-cut[hidden] { display: none; }
.pd-cut img { width: 100%; height: auto; display: block; }
.pd-layers { list-style: none; margin: 0; padding: 0; max-width: 980px; border-bottom: 1px solid rgba(233, 239, 248, .14); }
.pd-layer {
  display: grid; grid-template-columns: 72px 1fr 1.3fr;
  gap: 6px 28px; align-items: baseline;
  padding: clamp(20px, 3vw, 30px) 0;
  border-top: 1px solid rgba(233, 239, 248, .14);
}
.pd-layer-n { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--brass); }
.pd-layer-t { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.65rem); color: #fff; }
.pd-layer-d { color: rgba(233, 239, 248, .65); font-size: var(--text-sm); max-width: 56ch; }

/* ---------------------------------------------- reviews */
.pd-revs { background: var(--powder-2); }
.pd-rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.pd-rev {
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 28px 28px 24px; display: grid; gap: 12px; align-content: start;
  box-shadow: var(--shadow-sm);
}
.pd-rev-t { font-size: 1.25rem; line-height: 1.25; }
.pd-rev-b { font-size: var(--text-sm); color: var(--ink-soft); }
.pd-rev-f {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 4px;
}

/* ---------------------------------------------- mobile sticky bar */
.pd-stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 244, 238, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  box-shadow: 0 -10px 30px -18px rgba(14, 31, 56, .3);
  transform: translateY(110%); transition: transform .45s var(--ease-out);
}
.pd-stickybar.show { transform: none; }
.pd-sb-info { display: grid; line-height: 1.35; min-width: 0; }
.pd-sb-name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-sb-price { font-size: var(--text-sm); font-weight: 700; color: var(--royal); }
.pd-stickybar .btn-sm { flex-shrink: 0; }
@media (min-width: 961px) { .pd-stickybar { display: none; } }

/* ---------------------------------------------- responsive */
@media (max-width: 960px) {
  .pd { grid-template-columns: 1fr; gap: 38px; }
  .pd-buy { position: static; }
  .pd-name { font-size: var(--text-2xl); }
  /* lift the toast clear of the sticky buy bar */
  body:has(.pd-stickybar.show) .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 640px) {
  .pd-strip { gap: 10px; }
  .pd-gallery { gap: 10px; }
  .pd-tile-info { padding: 12px; }
  .pd-ti-cta { margin-top: 6px; font-size: 10px; }
  .pd-layer { grid-template-columns: 46px 1fr; }
  .pd-layer-n { grid-row: 1 / span 2; align-self: start; }
  .pd-layer-t, .pd-layer-d { grid-column: 2; }
  .pd-rev { padding: 22px 20px 20px; }
}

/* ---------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pd-hero img, .pd-acc-panel, .pd-acc-x, .pd-stickybar, .pd-size, .pd-ti-cta .arr { transition: none; }
}
