/* Shop page (shop.html), the home-page buy strip (.teaser in index.html) and the
   colour swatches they share. The quantity stepper (.qty) lives in cart.css. */

/* ---------- Colour swatches (shop page + buy strip) ---------- */
.swatches { border: 0; margin: 0; padding: 0; min-width: 0; }
.swatches legend { padding: 0; margin-bottom: 10px; display: flex; align-items: baseline; gap: 14px; }
.swatch-name { font-size: 14px; letter-spacing: 0.06em; color: var(--text); }
.swatch-row { display: flex; gap: 6px; margin-left: -7px; }
.swatch { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.swatch-dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c);
  border: 1px solid rgba(255, 255, 255, 0.16);
  /* the selected ring: a gap in the page colour, then a hairline */
  box-shadow: 0 0 0 4px transparent, 0 0 0 5px transparent;
  transition: box-shadow 0.3s, transform 0.3s var(--ease-out);
}
.swatch:hover .swatch-dot { transform: scale(1.08); }
.swatch input:checked + .swatch-dot { box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--text); transform: none; }
.swatch input:focus-visible + .swatch-dot { outline: 1px solid var(--pop); outline-offset: 8px; }

/* ---------- Price with a currency toggle (shop page + buy strip) ----------
   The toggle beside the price shows only on small screens, where the one in the
   navigation is hidden (.hide-sm in base.css, same breakpoint), so a phone visitor
   can switch between pounds and euros before anything is in the cart. */
.price-row { display: flex; align-items: center; gap: 18px; margin: 18px 0 0; }
.price-row .product-price, .price-row .teaser-price { margin: 0; }
.price-row .currency-toggle { display: none; }
@media (max-width: 720px) { .price-row .currency-toggle { display: inline-flex; } }

/* ---------- Shop page ---------- */
.shop { padding: clamp(104px, 15vh, 150px) 0 clamp(72px, 12vh, 140px); min-height: 100vh; min-height: 100svh; }

.shop-tabs { display: flex; gap: clamp(24px, 4vw, 48px); border-bottom: 1px solid var(--line); margin-bottom: clamp(28px, 6vh, 64px); }
.shop-tab {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 0; font-size: 13px; font-weight: 450; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); white-space: nowrap; transition: color 0.3s;
}
.shop-tab:hover { color: var(--text); }
.shop-tab[aria-selected="true"] { color: var(--text); }
.shop-tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease-out);
}
.shop-tab[aria-selected="true"]::after { transform: scaleX(1); }
/* What is new: the one accent of this page's own. (The other that may show is in
   the navigation: the count on the cart.) Its fine outline is the accent at 42%,
   3.2 to 1 against the page: any fainter and it is not seen as a line. */
.tag-soon {
  font-size: 10px; font-weight: 500; letter-spacing: 0.16em; line-height: 1; text-transform: uppercase;
  color: var(--pop); border: 1px solid color-mix(in srgb, var(--pop) 42%, transparent);
  padding: 5px 9px 4px; border-radius: var(--radius);
}

.product {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px); align-items: start;
}
.product[hidden] { display: none; }

/* Gallery */
.gallery { min-width: 0; }
@media (min-width: 901px) and (min-height: 720px) {
  .gallery { position: sticky; top: 96px; }   /* stays in view while the facts scroll */
}
.gallery-stage {
  position: relative; aspect-ratio: 4 / 3;
  /* a faint gold glow behind the wallet, nothing else */
  background: radial-gradient(52% 46% at 50% 54%, rgba(220, 166, 45, 0.075), rgba(220, 166, 45, 0) 72%);
}
.gallery-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.5s var(--ease-out); }
.gallery-3d { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease-out); }
.gallery-3d[hidden] { display: none; }
.gallery-3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; outline-offset: -1px; }
.gallery-3d canvas.is-dragging { cursor: grabbing; }
.gallery-stage[data-mode="3d"] .gallery-3d { opacity: 1; }
.gallery-stage[data-mode="3d"] .gallery-img { opacity: 0; }
.gallery-stage[data-mode="3d-loading"] .gallery-img { opacity: 0.35; }
/* The graphics context was lost: the photo stands in until the model can draw again. */
.gallery-stage[data-lost] .gallery-3d { opacity: 0; }
.gallery-stage[data-lost] .gallery-img { opacity: 1; }
.gallery-hint {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0; text-align: center;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
  pointer-events: none;
}
.gallery-hint[hidden] { display: none; }

.gallery-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 14px); margin-top: clamp(12px, 2vh, 20px); }
.thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 10px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: border-color 0.3s, background 0.3s;
}
.thumb[hidden] { display: none; }
.thumb img { width: 100%; height: 100%; object-fit: contain; opacity: 0.7; transition: opacity 0.3s; }
.thumb:hover { border-color: var(--line-strong); }
.thumb:hover img, .thumb[aria-pressed="true"] img { opacity: 1; }
.thumb[aria-pressed="true"] { border-color: var(--gold); }
.thumb-3d { font-size: 14px; font-weight: 450; letter-spacing: 0.18em; color: var(--text-muted); padding-left: 0.18em; }
.thumb-3d:hover, .thumb-3d[aria-pressed="true"] { color: var(--text); }

/* Buy column */
.buy { min-width: 0; padding-top: clamp(0px, 2vh, 24px); }
.product-title { margin: 14px 0 0; font-size: clamp(44px, 5.4vw, 76px); font-weight: 300; line-height: 1.02; letter-spacing: -0.01em; }
.product-title strong { font-weight: 600; }
.product-price { margin: 18px 0 0; font-size: 24px; font-weight: 350; font-variant-numeric: tabular-nums; min-height: 1.6em; }
.product-price-soon { color: var(--text-muted); }
.product-lede { margin: 14px 0 0; max-width: 34ch; color: var(--text-muted); }
.buy .swatches { margin-top: clamp(28px, 4.5vh, 44px); }
.buy-row { display: flex; align-items: center; gap: 14px; margin-top: clamp(24px, 3.5vh, 32px); }
.buy-add { flex: 1; max-width: 300px; }

.facts { margin: clamp(36px, 6vh, 56px) 0 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.facts dt { font-size: 11px; font-weight: 450; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-muted); }
.facts dd { margin: 0; font-size: 15px; line-height: 1.45; }

/* Leather Case: there is no photo yet, so the brand mark rests in the same faint
   glow the gallery uses. It comes up slowly out of the dark when the tab opens. */
.soon-visual {
  position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(52% 46% at 50% 54%, rgba(220, 166, 45, 0.075), rgba(220, 166, 45, 0) 72%);
}
.soon-mark { width: clamp(84px, 21%, 148px); height: auto; opacity: 0.7; }
.product-soon:not([hidden]) .soon-visual { animation: soon-dawn 4s cubic-bezier(0.45, 0, 0.2, 1) both; }
@keyframes soon-dawn { from { opacity: 0; } to { opacity: 1; } }

/* One column on narrow screens. The exception is a phone held sideways (wide but
   very short): see the next block. */
@media (max-width: 639px), (max-width: 900px) and (min-height: 501px) {
  .shop { padding-top: 88px; }
  .shop-tabs { margin-bottom: 20px; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  /* never taller than about three quarters of the screen */
  .gallery-stage { width: min(100%, calc(72svh * 4 / 3)); margin-inline: auto; }
  .buy { padding-top: 0; }
  .buy-add { max-width: none; }
  .product-lede { max-width: 40ch; }
  .product-soon .soon-visual { max-height: 46vh; width: 100%; }
}
/* A phone held sideways keeps two columns, so the price and the button sit beside
   the photo instead of three screens below it. */
@media (min-width: 640px) and (max-width: 900px) and (max-height: 500px) {
  .shop { padding-top: 84px; }
  .shop-tabs { margin-bottom: 18px; }
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .buy { padding-top: 0; }
  .product-title { margin-top: 8px; font-size: 40px; }
  .product-price { font-size: 22px; }
  .price-row { margin-top: 10px; }
  .product-lede { margin-top: 8px; }
  .buy .swatches { margin-top: 16px; }
  .buy-row { margin-top: 14px; }
}
@media (max-width: 420px) {
  .shop-tab { letter-spacing: 0.14em; font-size: 12px; gap: 8px; }
  .tag-soon { letter-spacing: 0.12em; padding: 4px 7px 3px; }
  .facts > div { grid-template-columns: 92px minmax(0, 1fr); }
}
/* The narrowest phones (320 px): the two tabs and the tag still fit on one line. */
@media (max-width: 340px) {
  .shop-tabs { gap: 14px; }
  .shop-tab { letter-spacing: 0.08em; gap: 6px; }
  .tag-soon { letter-spacing: 0.08em; padding: 4px 6px 3px; }
}

/* ---------- Home-page buy strip ---------- */
.teaser { padding: clamp(96px, 18vh, 200px) 0; border-top: 1px solid var(--line); }
.teaser-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 80px); align-items: center;
}
.teaser-visual {
  position: relative; aspect-ratio: 4 / 3; display: block;
  background: radial-gradient(52% 46% at 50% 54%, rgba(220, 166, 45, 0.09), rgba(220, 166, 45, 0) 72%);
}
.teaser-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.teaser-title { margin: 14px 0 0; font-size: clamp(48px, 6.4vw, 96px); font-weight: 300; line-height: 1; letter-spacing: -0.01em; }
.teaser-title strong { font-weight: 600; }
.teaser-price { margin: 18px 0 0; font-size: 24px; font-weight: 350; font-variant-numeric: tabular-nums; min-height: 1.6em; }
.teaser .swatches { margin-top: clamp(24px, 4vh, 40px); }
.teaser-cta { margin-top: clamp(24px, 4vh, 36px); }
/* The link is "Leather Case"; "coming soon" stands beside it as the same small tag
   as on the shop page (in the accent colour, and not underlined: an underlined
   phrase in a second colour reads as a plain web link). */
.teaser-secondary { margin: 22px 0 0; font-size: 14px; letter-spacing: 0.04em; display: flex; align-items: center; gap: 12px; }
.teaser-dot { display: none; }
.teaser-secondary a { color: var(--text-muted); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color 0.3s, border-color 0.3s; }
.teaser-secondary a:hover { color: var(--text); border-color: var(--gold); }

/* Slow reveal as the strip scrolls into view (classes set by teaser.js; skipped with
   reduced motion). It starts dark and takes a few seconds: gentle curve, no snap. */
.teaser.is-waiting .teaser-visual { opacity: 0; transform: translateY(18px) scale(0.985); }
.teaser.is-waiting .teaser-copy > * { opacity: 0; transform: translateY(10px); }
.teaser.is-revealing .teaser-visual { transition: opacity 3.6s cubic-bezier(0.45, 0, 0.2, 1), transform 4.2s cubic-bezier(0.3, 0, 0.1, 1); }
.teaser.is-revealing .teaser-copy > * { transition: opacity 2.6s cubic-bezier(0.45, 0, 0.2, 1) 1s, transform 3s cubic-bezier(0.3, 0, 0.1, 1) 1s; }
.teaser.is-revealing .teaser-copy > :nth-child(n+3) { transition-delay: 1.4s; }
.teaser.is-revealing .teaser-copy > :nth-child(n+5) { transition-delay: 1.8s; }
/* A control reached with the keyboard is never invisible: whatever holds the focus
   shows at once, without waiting for (or restarting) the slow reveal. */
.teaser.is-waiting .teaser-copy > :focus-within,
.teaser.is-revealing .teaser-copy > :focus-within { opacity: 1; transform: none; transition-duration: 0.25s; transition-delay: 0s; }

/* One column on narrow screens; a phone held sideways keeps the two columns (as on
   the shop page above). */
@media (max-width: 639px), (max-width: 900px) and (min-height: 501px) {
  .teaser-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; text-align: center; }
  .teaser-visual { width: min(100%, calc(72svh * 4 / 3)); margin-inline: auto; }
  .teaser .price-row { justify-content: center; }
  .teaser-secondary { justify-content: center; }
  .teaser .swatches legend { justify-content: center; }
  .teaser .swatch-row { justify-content: center; margin-left: 0; }
}
@media (min-width: 640px) and (max-width: 900px) and (max-height: 500px) {
  .teaser { padding: 64px 0; }
  .teaser-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
  .teaser-title { font-size: 44px; }
  .teaser .swatches { margin-top: 16px; }
  .teaser-cta { margin-top: 16px; }
  .teaser-secondary { margin-top: 14px; }
}
