:root {
  --ink: #171715;
  --paper: #f5f3ed;
  --white: #fff;
  --line: #d7d3ca;
  --muted: #706d65;
  --accent: #b85037;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, a { color: inherit; }
button { font: inherit; }

.site-header { height: 60px; padding: 0 clamp(16px, 3vw, 48px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245,243,237,.94); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; letter-spacing: .13em; }
.brand b { color: var(--accent); font-weight: 600; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-style: italic; }
nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); font-size: 11px; letter-spacing: .12em; }
nav a { text-decoration: none; }
.bag { border: 0; background: none; cursor: pointer; letter-spacing: .12em; }
.bag span { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 4px; border-radius: 50%; background: var(--ink); color: white; }

.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.product-stage { display: grid; grid-template-columns: minmax(410px, 1.15fr) minmax(470px, .85fr); height: calc(100svh - 60px); min-height: 620px; background: var(--white); overflow: hidden; }
.viewer-panel { min-width: 0; display: grid; place-items: center; align-content: center; padding: 18px; background: #f8f8f6; border-right: 1px solid var(--line); overflow: hidden; }
.spin-viewer { position: relative; width: auto; height: min(78svh, 720px); max-width: 100%; aspect-ratio: 768/1344; overflow: hidden; background: white; cursor: ew-resize; user-select: none; touch-action: pan-y; outline: none; box-shadow: 0 18px 50px rgba(28,25,20,.08); }
.spin-viewer:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 24px 60px rgba(28,25,20,.08); }
.spin-viewer canvas { width: 100%; height: 100%; display: block; pointer-events: none; }
.viewer-badge { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-family: var(--serif); font-size: 14px; }
.drag-guide { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: rgba(255,255,255,.9); font-size: 9px; letter-spacing: .14em; white-space: nowrap; transition: opacity .25s; }
.spin-viewer.interacted .drag-guide { opacity: 0; }
.load-indicator { position: absolute; inset: 0; display: grid; place-items: center; background: white; font-size: 10px; letter-spacing: .2em; transition: opacity .25s; pointer-events: none; }
.load-indicator.hidden { opacity: 0; pointer-events: none; }
.frame-meter { width: min(100%, 380px); height: 2px; margin-top: 9px; background: var(--line); }
.frame-meter span { display: block; height: 100%; width: 3.125%; background: var(--accent); transition: width .06s linear; }

.product-info { min-width: 0; min-height: 0; padding: clamp(16px, 2.3vw, 32px); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 16px; overflow: hidden; }
.product-summary { min-width: 0; }
.product-title-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.product-title-row h1 { margin: 0; max-width: 520px; font-family: var(--serif); font-size: clamp(28px, 2.7vw, 42px); font-weight: 400; line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
.price { flex: none; margin: 0 0 3px; font-size: 13px; letter-spacing: .06em; }
.description { max-width: 650px; margin: 10px 0 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.details { display: grid; grid-template-columns: .7fr 1.4fr .7fr; margin: 0 0 12px; border-block: 1px solid var(--line); }
.details div { min-width: 0; padding: 8px 10px; border-right: 1px solid var(--line); }
.details div:first-child { padding-left: 0; }
.details div:last-child { border-right: 0; }
.details dt { margin-bottom: 4px; font-size: 8px; letter-spacing: .16em; }
.details dd { margin: 0; font-family: var(--serif); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-row { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(150px, .7fr); align-items: center; gap: 12px; }
.size-row { display: flex; align-items: center; gap: 5px; }
.size-row > span { margin-right: 6px; font-size: 9px; letter-spacing: .16em; }
.size-row button { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; font-size: 9px; }
.size-row button.selected { border-color: var(--ink); background: var(--ink); color: white; }
.primary-button { width: 100%; min-height: 40px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--ink); background: var(--ink); color: white; cursor: pointer; font-size: 10px; letter-spacing: .13em; transition: .2s; }
.primary-button:hover { background: var(--accent); border-color: var(--accent); }

.related-items { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 8px; border-top: 1px solid var(--line); padding-top: 11px; }
.related-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.related-heading .eyebrow { margin: 0; }
.related-heading h2 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 400; }
.related-heading h2 span { margin-left: 7px; color: var(--muted); font-family: var(--sans); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; }
.product-grid { min-height: 0; height: min(29svh, 240px); display: grid; grid-template-columns: repeat(6, minmax(52px, 1fr)); grid-auto-rows: 88px; gap: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; padding-right: 4px; }
.product-card { position: relative; min-width: 0; min-height: 0; border: 1px solid transparent; padding: 0; background: #f5f3ed; text-align: left; cursor: pointer; overflow: hidden; }
.product-card[aria-current="true"] { border-color: var(--accent); }
.card-image { position: absolute; inset: 0; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover img, .product-card:focus-visible img { transform: scale(1.06); }
.card-name { position: absolute; inset: auto 0 0; padding: 12px 5px 4px; color: white; background: linear-gradient(transparent, rgba(0,0,0,.62)); font-family: var(--serif); font-size: clamp(7px, .58vw, 10px); line-height: 1.05; opacity: 0; transition: opacity .2s; }
.product-card:hover .card-name, .product-card:focus-visible .card-name, .product-card[aria-current="true"] .card-name { opacity: 1; }

@media (max-width: 1050px) {
  .product-stage { grid-template-columns: minmax(390px, 1fr) minmax(420px, 1fr); }
  .product-info { padding: 16px; }
  .product-title-row h1 { font-size: 28px; }
  .purchase-row { grid-template-columns: 1fr; gap: 8px; }
  .primary-button { min-height: 36px; }
}

@media (max-width: 820px) {
  nav a { display: none; }
  .product-stage { height: auto; min-height: calc(100svh - 60px); grid-template-columns: 1fr; overflow: visible; }
  .viewer-panel { height: 54svh; min-height: 390px; border-right: 0; border-bottom: 1px solid var(--line); }
  .spin-viewer { height: min(49svh, 500px); }
  .product-info { overflow: visible; padding: 20px; gap: 20px; }
  .product-title-row h1 { font-size: clamp(26px, 7vw, 38px); }
  .description { font-size: 13px; }
  .purchase-row { grid-template-columns: 1fr; }
  .related-items { min-height: 205px; }
  .product-grid { height: 178px; grid-template-columns: repeat(10, 76px); grid-template-rows: repeat(2, 84px); grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; padding: 0 0 5px; }
  .product-card { scroll-snap-align: start; }
  .card-name { font-size: 8px; opacity: 1; }
}

@media (max-width: 480px) {
  .site-header { height: 54px; }
  .brand { font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; }
  nav { gap: 6px; }
  .product-stage { min-height: calc(100svh - 54px); }
  .viewer-panel { height: 49svh; min-height: 340px; padding: 10px; }
  .spin-viewer { height: min(45svh, 430px); }
  .product-info { padding: 18px 16px 24px; }
  .product-title-row { align-items: start; }
  .product-title-row h1 { font-size: 27px; }
  .details { grid-template-columns: .65fr 1.5fr .65fr; }
  .details div { padding-inline: 6px; }
  .size-row { flex-wrap: wrap; }
  .related-items { min-height: 186px; }
  .product-grid { height: 160px; grid-template-columns: repeat(10, 68px); grid-template-rows: repeat(2, 75px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
