/* ==========================================================================
   HOUSE OF ELKI - PRODUCT PAGE (one template for every product)
   Builds on styles.css tokens and shared pieces. Components mirror product.html.
   ========================================================================== */

[hidden] { display: none !important; }

/* ---------- Breadcrumb ---------- */
.crumbs { padding-block: 22px 6px; font-size: .8125rem; color: var(--text-muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs li + li::before { content: ""; width: 5px; height: 5px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); opacity: .6; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; border-bottom: 1px solid transparent; }
.crumbs a:hover { color: var(--navy); border-bottom-color: var(--ochre); }
.crumbs [aria-current] { color: var(--navy); font-weight: 500; }

/* ---------- Layout ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(32px, 5.5vw, 88px); align-items: start; padding-block: 12px clamp(56px, 8vw, 104px); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; position: sticky; top: 100px; align-self: start; }
.thumbs { display: grid; gap: 12px; align-content: start; }
.thumb { position: relative; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--navy) 8%, var(--paper)); opacity: .72; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--navy); }
.stage { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-lg); overflow: hidden; background: color-mix(in srgb, var(--navy) 8%, var(--paper)); }
.stage > img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s var(--ease); }
.stage > img.is-contain { object-fit: contain; }
.stage > img.is-swapping { opacity: 0; }
.stage-chip { position: absolute; left: 18px; top: 18px; }
.stage-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(246, 243, 240, .92); color: var(--navy); transition: background-color .2s var(--ease), transform .2s var(--ease); }
.stage-btn:hover { background: var(--paper); transform: scale(1.06); }
.stage-btn .icon { width: 20px; height: 20px; }
.stage-expand { position: absolute; right: 16px; top: 16px; }
.stage-nav { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: var(--r-pill); background: rgba(34, 47, 77, .78); color: var(--ink); font-size: .8125rem; font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.stage-nav .stage-btn { width: 36px; height: 36px; }
.stage-nav .stage-btn .icon { width: 18px; height: 18px; }

/* ---------- Buy box ---------- */
.buy { display: grid; gap: 24px; min-width: 0; }
.buy-head { display: grid; gap: 14px; }
.buy h1 { font-size: clamp(2.25rem, 4.2vw, 3.5rem); line-height: 1; }
.sku { font-size: .8125rem; color: var(--text-muted); letter-spacing: .02em; }
.price-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.price-big { font-family: var(--font-display); font-size: clamp(2rem, 3vw, 2.5rem); font-weight: 600; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.gst { font-size: .8125rem; color: var(--text-muted); }
.buy .lead { max-width: 56ch; }

.options { display: grid; gap: 22px; }
.opt-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.opt-label b { font-family: var(--font-body); font-size: .9375rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--navy); }
.sw-tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.sw-tile { position: relative; width: 64px; height: 64px; padding: 0; border: 1px solid var(--hairline); border-radius: 16px; overflow: hidden; background: var(--c, var(--paper)); transition: transform .2s var(--ease); }
.sw-tile img { width: 100%; height: 100%; object-fit: cover; }
.sw-tile:hover { transform: translateY(-2px); }
.sw-tile::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0 var(--navy); transition: box-shadow .2s var(--ease); }
.sw-tile[aria-checked="true"] { outline: 2px solid var(--navy); outline-offset: 3px; }
.sw-tile[data-stock="out"] { opacity: .5; }
.sw-tile[data-stock="out"]::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(135deg, transparent 47%, var(--navy) 48% 52%, transparent 53%); }
.chips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.size-opt { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px; padding: 8px 20px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--navy) 28%, transparent); background: var(--paper); text-align: left; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.size-opt b { font-weight: 500; font-size: .9375rem; }
.size-opt small { font-size: .8125rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.size-opt:hover { border-color: var(--navy); }
.size-opt[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.size-opt[aria-checked="true"] small { color: var(--soft); }

.stock { display: flex; align-items: center; gap: 10px; font-size: .875rem; margin-top: -6px; min-height: 1.4em; }
.stock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #3F7A4D; flex: none; }
.stock.low::before { background: var(--ochre); }
.stock.out::before { background: var(--terracotta); }
.stock.low { color: color-mix(in srgb, var(--ochre) 55%, var(--navy)); }

.buy-row { display: flex; gap: 12px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; height: 56px; border: 1px solid color-mix(in srgb, var(--navy) 30%, transparent); border-radius: var(--r-sm); background: var(--paper); flex: none; }
.qty button { width: 48px; height: 100%; border: 0; background: none; display: grid; place-items: center; transition: background-color .2s var(--ease); }
.qty button:hover:not(:disabled) { background: color-mix(in srgb, var(--navy) 8%, transparent); }
.qty button:disabled { opacity: .35; cursor: default; }
.qty input { width: 64px; height: 100%; border: 0; background: none; text-align: center; font: inherit; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--navy); }
.qty input:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; border-radius: 4px; }
.add { flex: 1; min-height: 56px; gap: 14px; font-size: 1rem; }
.add[disabled] { background: color-mix(in srgb, var(--navy) 30%, var(--paper)); cursor: not-allowed; }
.add.is-added { background: var(--navy); }
.add-total { padding-left: 14px; border-left: 1px solid rgba(246, 243, 240, .45); font-variant-numeric: tabular-nums; font-weight: 600; }
.add-total:empty { display: none; }
.wish-lg { width: 56px; flex: none; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--navy) 30%, transparent); background: var(--paper); display: grid; place-items: center; transition: background-color .2s var(--ease), color .2s var(--ease); }
.wish-lg:hover { background: color-mix(in srgb, var(--navy) 8%, transparent); }
.wish-lg .icon { width: 22px; height: 22px; }
.wish-lg[aria-pressed="true"] { color: var(--terracotta); border-color: var(--terracotta); }
.wish-lg[aria-pressed="true"] .icon { fill: currentColor; }

/* gift */
.gift { display: block; position: relative; cursor: pointer; }
.gift input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.gift-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.gift-card > .icon { width: 26px; height: 26px; color: var(--terracotta); stroke-width: 1.4; }
.gift-card b { display: block; font-size: .9375rem; font-weight: 500; }
.gift-card small { display: block; font-size: .8125rem; color: var(--text-muted); }
.gift-tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--navy) 30%, transparent); color: transparent; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease); }
.gift-tick .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.gift input:checked + .gift-card { border-color: var(--navy); background: color-mix(in srgb, var(--gold) 14%, var(--paper)); }
.gift input:checked + .gift-card .gift-tick { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.gift input:focus-visible + .gift-card { outline: 2px solid var(--navy); outline-offset: 3px; }
.gift-fields { display: grid; gap: 10px; padding: 18px 4px 4px; }
.gift-fields label { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.gift-fields textarea { width: 100%; resize: vertical; min-height: 92px; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--navy) 28%, transparent); background: var(--paper); font: inherit; font-size: .9375rem; color: var(--navy); }
.gift-fields textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.gift-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: .8125rem; color: var(--text-muted); }
.gift-fields .check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: .875rem; letter-spacing: 0; text-transform: none; color: var(--navy); cursor: pointer; }
.gift-fields .check input { width: 20px; height: 20px; accent-color: var(--navy); margin: 0; }

/* pincode */
.pincheck { display: grid; gap: 10px; }
.pincheck > label { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.pin-row { display: flex; gap: 10px; }
.pin-field { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--navy) 28%, transparent); border-radius: var(--r-sm); background: var(--paper); }
.pin-field:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.pin-field .icon { width: 18px; height: 18px; color: var(--text-muted); }
.pin-field input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: .9375rem; color: var(--navy); outline: 0; }
.pin-row .btn { min-height: 48px; }
.pin-result { font-size: .875rem; min-height: 1.4em; }
.pin-result.ok { color: #2F6A3D; }
.pin-result.err { color: var(--terracotta); }
.pin-result small { display: block; color: var(--text-muted); font-size: .75rem; margin-top: 2px; }

.perks { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--hairline); }
.perks li { display: grid; gap: 8px; justify-items: start; padding: 18px 16px 18px 0; font-size: .8125rem; color: var(--text-muted); line-height: 1.35; }
.perks li + li { padding-left: 16px; border-left: 1px solid var(--hairline); }
.perks .icon { width: 24px; height: 24px; color: var(--terracotta); stroke-width: 1.4; }
.perks b { display: block; color: var(--navy); font-size: .875rem; font-weight: 500; }

.acc details { border-bottom: 1px solid var(--hairline); }
.acc summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: ""; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .25s var(--ease); flex: none; }
.acc details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.acc .acc-body { padding: 0 0 22px; color: var(--text-muted); font-size: .9375rem; line-height: 1.65; }
.acc .acc-body p + p, .acc .acc-body ul { margin-top: 10px; }
.acc .acc-body ul { padding-left: 18px; list-style: disc; }
.acc .acc-body li + li { margin-top: 6px; }
.acc .note { font-size: .75rem; opacity: .8; }

/* ---------- Specs bento ---------- */
.specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.specs li { display: grid; gap: 14px; align-content: start; padding: 24px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--surface); }
.specs .icon { width: 30px; height: 30px; color: var(--terracotta); stroke-width: 1.3; }
.specs small { display: block; font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.specs b { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; line-height: 1.15; margin-top: 4px; }

/* ---------- Craft story ---------- */
.story-sec { padding-top: 0; }
.story-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.story-map { position: relative; margin: 0; width: min(100%, 440px); margin-inline: auto; }
.story-map > img { width: 100%; height: auto; opacity: .9; }
.story-pin { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--terracotta-lift); border: 3px solid var(--paper); box-shadow: 0 0 0 9px rgba(216, 119, 92, .28); transform: translate(-50%, -50%); }
.story-cap { position: absolute; left: 0; bottom: 0; padding: 10px 16px; border-radius: var(--r-sm); background: var(--paper); color: var(--navy); font-size: .8125rem; font-weight: 500; }
.story-copy { display: grid; gap: 22px; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px 40px; margin: 0; padding-block: 20px; border-block: 1px solid rgba(246, 241, 233, .18); }
.facts dt { font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.facts dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.facts div { min-width: 0; }
.passport--paper { position: static; width: 100%; max-width: 360px; background: var(--paper); color: var(--navy); box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .55); }
.passport--paper small { color: var(--terracotta); }
.passport--paper dt { color: var(--text-muted); }
.passport--paper dd { color: var(--navy); }
.passport--paper .qr { background: var(--navy); color: var(--paper); }
.passport--paper em { color: var(--text-muted); }

/* ---------- Related ---------- */
.rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.rel-grid .card { scroll-snap-align: none; }
.card-link { position: absolute; inset: 0; }

/* ---------- Not found ---------- */
.nf { padding-block: 96px; display: grid; gap: 20px; justify-items: start; }

/* ---------- Sticky buy bar + toast + lightbox ---------- */
.stickybar { position: fixed; inset: auto 0 0 0; z-index: 40; display: none; align-items: center; gap: 12px; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 96%, transparent); border-top: 1px solid var(--hairline); box-shadow: 0 -10px 30px -18px rgba(34, 47, 77, .35); transform: translateY(110%); transition: transform .3s var(--ease); }
.stickybar.show { transform: none; }
.stickybar img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.sb-info { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sb-info b { font-size: .875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-info small { font-size: .8125rem; color: var(--text-muted); }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 18px; max-width: min(92vw, 520px); padding: 14px 20px; border-radius: 12px; background: var(--navy); color: var(--ink); font-size: .9375rem; box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast a { flex: none; color: var(--gold); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.lightbox { padding: 0; border: 0; background: transparent; max-width: min(1100px, 94vw); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(27, 38, 63, .84); }
.lightbox img { display: block; max-width: 100%; max-height: 88vh; margin: auto; border-radius: var(--r-md); }
.lb-close { position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--paper); color: var(--navy); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199px) {
  .specs { grid-template-columns: repeat(2, 1fr); }
  .rel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1023px) {
  .pdp { grid-template-columns: minmax(0, 1fr); }
  .gallery { position: static; grid-template-columns: minmax(0, 1fr); }
  .thumbs { order: 2; grid-auto-flow: column; grid-auto-columns: 72px; overflow-x: auto; padding: 4px; scrollbar-width: none; }
  .thumbs::-webkit-scrollbar { display: none; }
  .thumb { width: 72px; height: 72px; }
  .stage { aspect-ratio: 4 / 3.6; }
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .stickybar { display: flex; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
@media (max-width: 599px) {
  .stage { aspect-ratio: 1 / 1; border-radius: var(--r-md); }
  .buy-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 12px; }
  .add { grid-column: 1 / -1; order: 3; }
  .qty { width: 100%; }
  .qty input { flex: 1; width: auto; }
  .sw-tile { width: 56px; height: 56px; }
  .sw-tiles { gap: 12px; }
  .perks { grid-template-columns: 1fr; }
  .perks li, .perks li + li { grid-template-columns: 28px 1fr; align-items: center; padding: 14px 0; border-left: 0; }
  .perks li + li { border-top: 1px solid var(--hairline); }
  .facts { grid-template-columns: 1fr 1fr; }
  .specs { gap: 12px; }
  .specs li { padding: 18px; }
  .rel-grid { gap: 14px; }
  .pin-row { flex-wrap: wrap; }
  .pin-row .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .stage > img, .stickybar, .toast { transition-duration: .01ms !important; }
  .sw-tile:hover, .stage-btn:hover { transform: none; }
}

/* ---------- Build Your Box action ---------- */
.box-add { width: 100%; min-height: 48px; gap: 10px; }
.box-add .icon { width: 18px; height: 18px; }
.box-add[aria-pressed="true"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }

/* branding methods that suit this piece (filled by product.js from ELKI.branding) */
.pdp-brand { display: grid; gap: 12px; margin-top: 16px; padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--hairline); background: color-mix(in srgb, var(--gold) 10%, var(--paper)); }
.pdp-brand-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.3125rem; font-weight: 600; color: var(--navy); }
.pdp-brand-title .icon { width: 20px; height: 20px; color: var(--terracotta); }
.pdp-brand ul { display: flex; flex-wrap: wrap; gap: 6px; }
.pdp-brand li { padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--navy) 22%, transparent); background: var(--paper); font-size: .8125rem; }
.pdp-brand-foot { font-size: .8125rem; color: var(--text-muted); }
.pdp-brand-foot a { color: var(--navy); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* "Made by hand" and "Product information" panels (rows only appear when a value exists, see products.js) */
.acc-dl { display: grid; margin: 0; border-top: 1px solid var(--hairline); }
.acc-dl div { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.acc-dl dt { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); padding-top: 2px; }
.acc-dl dd { margin: 0; }
.acc-dl a { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.acc-note { margin-top: 14px !important; padding-left: 14px; border-left: 2px solid var(--terracotta); font-size: .875rem; }
.acc .tbc, .tbc { background: color-mix(in srgb, var(--gold) 30%, transparent); padding: 0 3px; border-radius: 3px; }

/* reserve the page before product.js renders it, so the footer does not jump (was CLS 0.71) */
main#main { min-height: calc(100vh - 117px); }

/* ---- Touch targets (UI/UX pass, Nov 2026) ---- */
.qty button { flex: 0 0 48px; }                       /* stays 48px wide when the stepper stretches on phones */
@media (pointer: coarse) {
  .stage-nav .stage-btn { width: 44px; height: 44px; }
  .crumbs a { min-height: 44px; }
  .gift-fields .check { min-height: 44px; }
}
.qty input { min-width: 0; }                          /* lets the stepper shrink on 320px phones now that its buttons are fixed at 48px */
