/* Shared interface tokens. Each product keeps the material palette from its own template. */
body[data-shop-retail] {
  color-scheme:light;
  --shop-ink:#19191c;
  --shop-muted:#56565e;
  --shop-canvas:#f5f5f7;
  --shop-border:#d8d8de;
  --sans:"MERATIA Navigation",system-ui,sans-serif;
  font-family:var(--sans);
}
body[data-shop-retail]:not([data-shop-retail="product"]) {
  --ink:var(--shop-ink);
  --paper:var(--shop-canvas);
  --oat:#eeeef1;
  --stone:var(--shop-muted);
  --olive:#19191c;
  --line:var(--shop-border);
  --pine:var(--shop-ink);
  --pale:#eeeef1;
  --sc-ink:var(--shop-ink);
  --sc-secondary:var(--shop-muted);
  --sc-paper:#fff;
  --sc-rule:var(--shop-border);
  --serif:var(--sans);
  color:var(--shop-ink);
  background:var(--shop-canvas);
  font-family:var(--sans);
}
body[data-shop-retail] main :is(h1,h2,h3),body[data-shop-retail] dialog :is(h2,h3) {
  font-family:var(--sans);font-style:normal;font-weight:600;letter-spacing:-.045em;
}
body[data-shop-retail] :is(a,button,summary,input,select,textarea):focus-visible {
  outline-color:#326da7;
}

/* Keep typography, native variant semantics and consistent shopping controls.
   Hero lighting, image surfaces and selection colors come from each family. */
body[data-shop-retail="product"] #product-title {
  font:600 clamp(36px,3.85vw,65px)/1.03 var(--sans);letter-spacing:-.055em;
}
body[data-shop-retail="product"] .variant-choice:has(input:checked) :is(.swatch-label,.swatch-availability) {
  border:0;box-shadow:none;background:transparent;
}
body[data-shop-retail="product"] .variant-choice .swatch-availability {color:inherit;opacity:.87}
body[data-shop-retail="product"] :is(.use-scenes-controls,#grid36-motion) button[aria-pressed=true],
body[data-shop-retail="product"] .storage-motion-replay {background:#242428;color:#fff;border-color:#242428}

/* The purchase action uses one treatment across the PDP, mobile bar and quick view. */
body[data-shop-retail] #buy-link.button,body[data-shop-retail] #collection-preview .studio-buy,
body[data-shop-retail] .m-buybar a,body[data-shop-retail] [data-managed-product] .buy {
  background:#19191c;color:#fff;border:1px solid #19191c;border-radius:999px;box-shadow:none;text-shadow:none;
  font-family:var(--sans);font-weight:600;
}
body[data-shop-retail] #buy-link.button[href]:hover,body[data-shop-retail] #collection-preview .studio-buy[href]:hover,
body[data-shop-retail] .m-buybar a[href]:hover,body[data-shop-retail] [data-managed-product] .buy[href]:hover {background:#34343a;color:#fff;border-color:#34343a}
body[data-shop-retail] #buy-link.button[aria-disabled=true],body[data-shop-retail] .m-buybar a[aria-disabled=true] {background:#e0e0e5;color:#595961;border-color:#d9d9de}
body[data-shop-retail] .m-buybar {background:rgba(250,250,252,.97);color:var(--shop-ink)}
body[data-shop-retail] .m-buybar :is(b,span) {color:var(--shop-ink)}

body[data-shop-retail="directory"] {background:var(--shop-canvas)}
body[data-shop-retail="directory"] .shop-directory .collection-card,
body[data-shop-retail="directory"] .wtb-item {background:#fff}
body[data-shop-retail="directory"] #collection-preview :is(.preview-description,.preview-status) {color:var(--shop-muted)}
body[data-shop-retail="managed"] main :is(.cover,.photo),body[data-shop-retail="managed"] dialog {background:#fff;color:var(--shop-ink)}
body[data-shop-retail="managed"] main h1 {font-size:clamp(37px,5vw,72px);line-height:1.03}

body[data-shop-retail="information"] .sc-tools :is(.quiz,.category-image,.size-item img) {background:#fff}
body[data-shop-retail="information"] .sc-tools input[type=radio] {accent-color:#19191c}
body[data-shop-retail="information"] .sc-tools .signup-row :is(input,textarea) {border-color:#aaaab2}
body[data-shop-retail="information"] :is(.sc-cta,.outline-button,.signup-row button,dialog .button) {background:#19191c;color:#fff;border-color:#19191c}
body[data-shop-retail="information"] :is(.sc-cta,.outline-button,.signup-row button,dialog .button):hover {background:#34343a;border-color:#34343a}
body[data-shop-retail="information"] :is(.sc-text-link,.sc-figure a):hover {color:#44444a}
body[data-shop-retail="information"] dialog::backdrop {background:#14141899}

/* The v033 navigation sheet also supplied the variant tile layout. Keep that
   layout on product pages when the new header stylesheet is used. */
:where(body[data-shop-retail="product"]) .variant-fieldset {min-inline-size:0}
:where(body[data-shop-retail="product"]) .variant-options {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:4px}
:where(body[data-shop-retail="product"]) .variant-choice {display:block;min-width:0;min-height:44px}
:where(body[data-shop-retail="product"]) .variant-choice input {top:12px;left:12px;transform:none;width:16px;height:16px;z-index:1}
:where(body[data-shop-retail="product"]) .variant-choice .swatch-content {display:flex;flex-direction:column;align-items:stretch;gap:8px;height:100%;min-width:0;min-height:148px;padding:10px}
:where(body[data-shop-retail="product"]) .variant-choice .swatch-content>img {width:100%;height:88px;object-fit:contain;background:#fff}
:where(body[data-shop-retail="product"]) .variant-choice .swatch-label {display:block;min-height:0;padding:0;border:0;background:transparent;font-size:12px;line-height:1.5}
:where(body[data-shop-retail="product"]) .variant-choice .swatch-availability {display:block;font-size:10px;line-height:1.5;font-weight:400;color:inherit}
:where(body[data-shop-retail="product"]) .variant-choice :is(.swatch-label,.swatch-availability) {min-width:0;white-space:normal;overflow-wrap:anywhere}
@media(min-width:770px) {
  :where(body[data-shop-retail="product"]) .variant-options {grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Review repair: finder anchor clears shared sticky navigation. */
#finder{scroll-margin-top:100px}.shop-finder-link{white-space:nowrap}
@media(max-width:760px){#finder{scroll-margin-top:90px}}

/* === PDP UX & Visual Refinements === */

/* 1. Gallery stage arrows, photo counter & refined zoom trigger */
body[data-shop-retail="product"] .gallery-stage {
  border-radius: 16px; overflow: hidden;
  border: 1px solid rgba(25,25,28,.08);
}
body[data-shop-retail="product"][data-theme="collector"] .gallery-stage,
body[data-shop-retail="product"][data-binder-world] .gallery-stage {
  border-color: rgba(255,255,255,.12);
}
body[data-shop-retail="product"] .gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(25,25,28,.12);
  background: rgba(255,255,255,.92); color: #19191c; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(15,18,24,.12); backdrop-filter: blur(8px);
  opacity: .9; transition: opacity .16s ease, transform .16s ease, background .16s ease;
}
body[data-shop-retail="product"] .gallery-nav svg { width: 18px; height: 18px; }
body[data-shop-retail="product"] .gallery-prev { left: 12px; }
body[data-shop-retail="product"] .gallery-next { right: 12px; }
body[data-shop-retail="product"] .gallery-nav:hover { opacity: 1; background: #fff; transform: translateY(-50%) scale(1.05); }
body[data-shop-retail="product"] .gallery-counter {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums; background: rgba(25,25,28,.72); color: #fff;
  backdrop-filter: blur(6px); pointer-events: none;
}
body[data-shop-retail="product"] .enlarge {
  right: 12px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: 1px solid rgba(25,25,28,.14);
  color: #19191c; box-shadow: 0 3px 10px rgba(15,18,24,.10);
  backdrop-filter: blur(8px); font-size: 18px; line-height: 1;
}
body[data-shop-retail="product"] .thumb { border-radius: 8px; overflow: hidden; transition: border-color .16s ease, transform .16s ease; }
body[data-shop-retail="product"] .thumb[aria-pressed="true"] { border-width: 2px; }

/* Lightbox prev/next arrows */
#image-dialog .dialog-media-wrap { position: relative; }
#image-dialog .dialog-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(25,25,28,.14);
  background: rgba(255,255,255,.94); color: #19191c; display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
}
#image-dialog .dialog-nav svg { width: 20px; height: 20px; }
#image-dialog .dialog-prev { left: 12px; }
#image-dialog .dialog-next { right: 12px; }
#image-dialog .dialog-nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }

/* 2. Refined Variant Cards + Custom High-Contrast Light & Dark Radio Indicators */
body[data-shop-retail="product"] .variant-group-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px;
}
body[data-shop-retail="product"] .variant-group-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px;
  border-radius: 999px; border: 1px solid rgba(25,25,28,.16); background: rgba(255,255,255,.85);
  color: #242429; font: 600 12.5px/1 var(--sans); cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
body[data-shop-retail="product"] .variant-group-chip span { font-size: 11px; opacity: .68; font-weight: 500; }
body[data-shop-retail="product"] .variant-group-chip[aria-pressed="true"] {
  background: #19191c; border-color: #19191c; color: #fff;
}
body[data-shop-retail="product"] .variant-options { gap: 9px; padding: 2px; }
body[data-shop-retail="product"] .variant-choice .swatch-content {
  min-height: 112px; padding: 9px 10px 10px; border-radius: 10px; gap: 6px;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
body[data-shop-retail="product"] .variant-options[data-density="compact"] .swatch-content {
  min-height: 94px; padding: 8px;
}
@media(min-width:770px) {
  body[data-shop-retail="product"] .variant-options[data-density="compact"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
body[data-shop-retail="product"] .variant-options[data-density="compact"] .swatch-content > img {
  height: 68px;
}
body[data-shop-retail="product"] .variant-choice .swatch-content > img {
  height: 76px; border-radius: 6px;
}
body[data-shop-retail="product"] .variant-choice .swatch-label {
  font-weight: 600; font-size: 12.5px; line-height: 1.3;
}
body[data-shop-retail="product"] .variant-choice .swatch-availability {
  display: inline-block; width: fit-content; margin-top: 2px; padding: 2px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 600; line-height: 1.3;
  background: rgba(25,25,28,.08); opacity: 1;
}
/* Custom crisp radio indicator that works in both light & dark themes */
body[data-shop-retail="product"] .variant-choice input[type="radio"] {
  -webkit-appearance: none; appearance: none;
  position: absolute; top: 10px; left: 10px; width: 18px; height: 18px;
  border-radius: 50%; border: 1.5px solid rgba(25,25,28,.35);
  background: rgba(255,255,255,.94); margin: 0; z-index: 2; cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .16s ease, background-color .16s ease;
}
body[data-shop-retail="product"] .variant-choice input[type="radio"]:checked {
  border-color: #19191c; background: #19191c;
}
body[data-shop-retail="product"] .variant-choice input[type="radio"]:checked::after {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff;
}
body[data-shop-retail="product"] .variant-choice:has(input:checked) .swatch-content {
  border-width: 1.5px;
  box-shadow: 0 4px 14px -8px rgba(20,25,35,.22);
}

/* Dark collector theme PDP fixes (color-9-pocket & lightning binder) */
body[data-shop-retail="product"][data-theme="collector"] .variant-choice .swatch-content,
body[data-shop-retail="product"][data-binder-world] .variant-choice .swatch-content {
  border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04);
}
body[data-shop-retail="product"][data-theme="collector"] .variant-choice:has(input:checked) .swatch-content,
body[data-shop-retail="product"][data-binder-world] .variant-choice:has(input:checked) .swatch-content {
  border-color: var(--el-a, #ff9b43); background: rgba(255,255,255,.10);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--el-a, #ff9b43) 55%, transparent);
}
body[data-shop-retail="product"][data-theme="collector"] .variant-choice input[type="radio"],
body[data-shop-retail="product"][data-binder-world] .variant-choice input[type="radio"] {
  border-color: rgba(25,25,28,.45); background: rgba(255,255,255,.92);
}
body[data-shop-retail="product"][data-theme="collector"] .variant-choice input[type="radio"]:checked,
body[data-shop-retail="product"][data-binder-world] .variant-choice input[type="radio"]:checked {
  border-color: var(--el-a, #ff9b43); background: var(--el-a, #ff9b43);
}
body[data-shop-retail="product"][data-theme="collector"] .variant-choice input[type="radio"]:checked::after,
body[data-shop-retail="product"][data-binder-world] .variant-choice input[type="radio"]:checked::after {
  background: #12141a;
}
body[data-shop-retail="product"][data-theme="collector"] .variant-choice .swatch-availability,
body[data-shop-retail="product"][data-binder-world] .variant-choice .swatch-availability {
  background: rgba(255,255,255,.14); color: #f4f5f8;
}
body[data-shop-retail="product"][data-theme="collector"] .shop-crumbs,
body[data-shop-retail="product"][data-binder-world] .shop-crumbs {
  color: #c2c6d0;
}

/* Dark theme mobile sticky buy bar */
body[data-shop-retail="product"] .m-buybar[data-theme="dark"] {
  background: rgba(16,19,26,.94); border-top-color: rgba(255,255,255,.14); color: #f4f5f7;
}
body[data-shop-retail="product"] .m-buybar[data-theme="dark"] b { color: #fff; }
body[data-shop-retail="product"] .m-buybar[data-theme="dark"] span { color: #b6bcc8; }
body[data-shop-retail="product"] .m-buybar[data-theme="dark"] a {
  background: #f5f5f7; color: #14161c; border-color: #f5f5f7;
}
body[data-shop-retail="product"] .m-buybar[data-theme="dark"] a[aria-disabled="true"] {
  background: rgba(255,255,255,.16); color: #b6bcc8; border-color: transparent;
}

/* 3. Fix scene-heading negative margin collision with preceding section (esp. tower-world on mobile) */
body[data-shop-retail="product"] .scene-heading {
  margin-top: 0 !important;
  position: relative; z-index: 1;
}
body[data-shop-retail="product"] #scene-section {
  padding-top: clamp(44px, 5vw, 72px);
}

/* 4. Cleaner, tighter A+ Listing Stack with smooth Expand/Collapse toggle */
body[data-shop-retail="product"] .listing-stack {
  max-width: 960px; margin-inline: auto; gap: 20px;
}
body[data-shop-retail="product"] .listing-stack img {
  border-radius: 12px; box-shadow: 0 10px 30px -22px rgba(20,24,34,.22);
}
body[data-shop-retail="product"] .listing-extra {
  display: grid; gap: 20px; width: 100%;
}
body[data-shop-retail="product"] .listing-more-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  justify-self: center; margin-top: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1px solid rgba(25,25,28,.2); background: #fff;
  color: #19191c; font: 600 13.5px/1 var(--sans); cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
body[data-shop-retail="product"] .listing-more-btn:hover { background: #f2f2f6; border-color: #19191c; }
body[data-shop-retail="product"][data-theme="collector"] .listing-more-btn,
body[data-shop-retail="product"][data-binder-world] .listing-more-btn {
  background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); color: #f4f5f7;
}
body[data-shop-retail="product"][data-theme="collector"] .listing-more-btn:hover,
body[data-shop-retail="product"][data-binder-world] .listing-more-btn:hover {
  background: rgba(255,255,255,.15);
}

@media(max-width:699px) {
  body[data-shop-retail="product"] .gallery-stage { border-radius: 0; border-inline: 0; }
  body[data-shop-retail="product"] .gallery-nav { width: 34px; height: 34px; }
  body[data-shop-retail="product"] .gallery-prev { left: 8px; }
  body[data-shop-retail="product"] .gallery-next { right: 8px; }
  body[data-shop-retail="product"] .variant-choice .swatch-content { min-height: 98px; padding: 8px; }
  body[data-shop-retail="product"] .variant-choice .swatch-content > img { height: 64px; }
}
