/* Collection viewer: main photograph, variant rail, then selection details. */
.variant-badge { position:absolute; right:14px; bottom:14px; padding:6px 11px; border-radius:999px; background:var(--surface); color:var(--olive); font-size:12px; font-weight:700; }
.product-dialog { width:min(1240px, calc(100% - 40px)); max-height:calc(100dvh - 40px); color:var(--ink); overscroll-behavior:contain; }
body:has(.product-dialog[open]) { overflow:hidden; }
.product-detail { grid-template-columns:minmax(0, 1.9fr) minmax(290px, 1fr); align-items:start; }
.product-detail-copy { min-width:0; padding:56px 28px 32px; overflow-wrap:anywhere; }
.product-detail-copy h2 { font-size:clamp(28px, 2.7vw, 38px); }
.product-detail-copy > p:not(.eyebrow) { font-size:14px; }
.product-detail-copy .request-add { padding:18px 0; margin:18px 0 0; }
.product-detail-copy .request-add label { font-size:13px; }
.product-detail-copy .request-add select { width:100%; min-width:0; }
.product-detail-copy .detail-action { width:100%; justify-content:center; margin-top:14px; }
.spec-list { font-size:13px; }
.spec-list div { gap:12px; }
.detail-gallery { position:sticky; top:0; min-width:0; padding:26px; background:#f1ece4; border-radius:26px 0 0 26px; }
.gallery-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; margin-bottom:16px; color:var(--olive); font-size:13px; font-weight:700; }
.gallery-heading button { min-height:40px; padding:8px 14px; border:1px solid #c6bba9; border-radius:999px; color:var(--ink); background:var(--surface); cursor:pointer; }
.gallery-layout { display:grid; grid-template-columns:minmax(0, 1fr) 92px; gap:14px; align-items:stretch; }
.gallery-layout:has(.gallery-thumbs[hidden]) { grid-template-columns:minmax(0, 1fr); }
.gallery-stage { position:relative; height:clamp(330px, 52vw, 550px); min-width:0; overflow:hidden; display:grid; place-items:center; border-radius:18px; background:#e5ddd1; }
.gallery-stage > img { position:absolute; inset:0; width:100%; height:100%; min-width:0; min-height:0; object-fit:scale-down; cursor:zoom-in; user-select:none; }
.gallery-stage.is-zoomed { touch-action:none; }
.gallery-stage.is-zoomed > img { cursor:grab; }
.gallery-stage.is-dragging > img { cursor:grabbing; }
.gallery-stage > img:focus-visible { outline:3px solid var(--terracotta); outline-offset:-4px; }
.gallery-zoom-tools { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:-4px 0 12px; }
.gallery-zoom-tools button { min-height:40px; min-width:40px; padding:6px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--ink); cursor:pointer; }
.gallery-zoom-tools output { min-width:48px; text-align:center; font-size:13px; font-variant-numeric:tabular-nums; }
.gallery-zoom-tools span { margin-left:4px; font-size:12px; color:var(--muted); }
.gallery-placeholder { padding:36px; color:var(--muted); text-align:center; }
.gallery-controls { position:absolute; inset:auto 12px 12px; display:flex; align-items:center; justify-content:space-between; gap:10px; pointer-events:none; }
.gallery-controls button { width:44px; height:44px; border:1px solid var(--line); border-radius:50%; color:var(--ink); background:var(--surface); cursor:pointer; pointer-events:auto; font-size:20px; }
.gallery-controls span { padding:5px 12px; border-radius:999px; background:var(--surface); font-size:12px; font-variant-numeric:tabular-nums; }
.gallery-thumbs { display:flex; flex-direction:column; gap:10px; max-height:clamp(330px, 52vw, 550px); overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:2px 4px 2px 2px; }
.gallery-thumbs button { flex:none; width:100%; padding:4px; border:2px solid transparent; border-radius:12px; color:var(--ink); background:var(--surface); cursor:pointer; text-align:center; }
.gallery-thumbs button:hover { border-color:#b5aa99; }
.gallery-thumbs button[aria-pressed="true"] { border-color:var(--olive); background:#e6eadf; }
.gallery-thumbs img, .gallery-no-photo { width:100%; height:72px; border-radius:7px; object-fit:cover; }
.gallery-thumbs span { display:block; padding-top:5px; font-size:11px; line-height:1.3; overflow-wrap:anywhere; }
.gallery-thumbs .gallery-no-photo { display:grid; place-items:center; padding:10px; background:#e9e2d7; color:var(--muted); }
.gallery-caption { margin:16px 0 4px; font-weight:700; overflow-wrap:anywhere; }
.gallery-hint, [data-gallery-error] { margin:0; font-size:12px; color:var(--muted); }
[data-gallery-error]:not(:empty) { margin-top:10px; color:var(--terracotta-dark); }
.product-dialog button:focus-visible, .product-dialog select:focus-visible, .product-dialog a:focus-visible { outline:3px solid var(--terracotta); outline-offset:3px; }
.product-dialog button:disabled { opacity:.45; cursor:default; }
.product-dialog [hidden] { display:none !important; }
.gallery-expanded { width:min(1500px, calc(100% - 24px)); }
.gallery-expanded .product-detail { grid-template-columns:1fr; }
.gallery-expanded .product-detail-copy { display:none; }
.gallery-expanded .detail-gallery { position:relative; padding-top:56px; border-radius:26px; }
.gallery-expanded .gallery-stage, .gallery-expanded .gallery-thumbs { height:calc(100dvh - 280px); max-height:calc(100dvh - 280px); min-height:230px; }
.gallery-expanded .gallery-layout { grid-template-columns:minmax(0,1fr) 110px; }
.gallery-expanded .gallery-layout:has(.gallery-thumbs[hidden]) { grid-template-columns:1fr; }
.gallery-expanded .gallery-thumbs img { height:88px; }
@media (max-width:980px) {
  .product-dialog { width:calc(100% - 24px); }
  .product-detail { grid-template-columns:minmax(0, 1.4fr) minmax(260px, 1fr); }
  .detail-gallery { padding:20px 16px; }
  .gallery-layout { grid-template-columns:minmax(0,1fr) 76px; gap:10px; }
  .gallery-thumbs img, .gallery-no-photo { height:60px; }
  .product-detail-copy { padding:56px 20px 24px; }
}
@media (max-width:760px) {
  .product-dialog { width:calc(100% - 16px); max-height:calc(100dvh - 16px); border-radius:20px; }
  .product-detail { grid-template-columns:minmax(0,1fr); }
  .detail-gallery { position:relative; padding:56px 16px 20px; border-radius:20px 20px 0 0; }
  .gallery-heading { margin-bottom:12px; }
  .gallery-zoom-tools span { flex-basis:100%; margin-left:0; }
  .gallery-layout, .gallery-expanded .gallery-layout { grid-template-columns:minmax(0,1fr); }
  .gallery-stage { height:clamp(240px, 78vw, 470px); }
  .gallery-thumbs { flex-direction:row; max-height:none; padding:2px 2px 6px; scroll-snap-type:x proximity; }
  .gallery-thumbs button { width:82px; scroll-snap-align:start; }
  .gallery-thumbs img, .gallery-no-photo { height:66px; }
  .product-detail-copy { padding:24px 20px; }
  .product-detail-copy h2 { font-size:32px; }
  .gallery-expanded .gallery-stage { height:calc(100dvh - 410px); max-height:none; min-height:240px; }
  .gallery-expanded .gallery-thumbs { height:auto; max-height:140px; min-height:0; }
  .gallery-expanded .gallery-thumbs img { height:66px; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } .product-card { transition:none; } }

