/* ============================================================
   Dark theme for the shop, product and checkout pages.
   Loaded AFTER css/styles.css: the shop's own layout and
   components are reused; this file only re-colours them.
   ============================================================ */
:root {
  color-scheme: dark;              /* native form controls (checkboxes, selects, date pickers) go dark too */
  --bg:       #000;                /* same pure black as the photos and the story pages */
  --bg-2:     #0e0c0a;             /* panels */
  --bg-3:     #17130f;             /* deeper panels */
  --ink:      #efe7dc;             /* cream text */
  --muted:    #a59a8c;
  --line:     #2a241e;             /* hairlines */
  --accent:   #c0645e;             /* wine red, lifted for dark */
  --accent-2: #d07a72;
  --gold:     #c9a46a;
  --white:    #0b0a08;             /* "white" surfaces (inputs, tags, toast text) become near-black */
  --shadow:   0 24px 60px -28px rgba(0, 0, 0, 0.9);
}

/* Hard-coded colours in styles.css that the tokens don't reach */
.nav { background: rgba(0, 0, 0, 0.78); }
.footer { background: #0a0908; border-top: 1px solid var(--line); }
.pdp__stock--in { color: #7fc493; }            /* #3f7d4f is too dark on black */
.confirm__check, .cart-count { color: #000; }

/* Primary buttons: cream on black (styles.css inverts ink/white, which now
   gives cream text on cream — set it explicitly) */
.btn--primary { background: var(--ink); color: #000; border-color: var(--ink); }
.btn--primary:hover { background: var(--gold); border-color: var(--gold); color: #000; }

/* ---------- Bottles ----------
   Images are the background-free cut-outs (see dark-images.js), so they sit
   ON the dark panel. Shown whole (contain) — never cropped — with a soft warm
   glow behind, like the story pages.                                      */
.card__media, .pdp__main {
  background:
    radial-gradient(60% 55% at 50% 45%, rgba(239, 221, 196, 0.08), transparent 75%),
    radial-gradient(70% 18% at 50% 92%, rgba(201, 164, 106, 0.12), transparent 80%),
    var(--bg-2);
}
.card__media img, .pdp__main img {
  object-fit: contain; padding: 8% 0;
  filter: drop-shadow(0 0 1px rgba(255, 236, 210, 0.25)) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.6));
}
/* cards: the bottle starts below the "Organic" tag (tag bottom ~2.1rem) */
.card__media img { padding-top: 2.9rem; }
.pdp__thumb { background: var(--bg-2); }
.pdp__thumb img { object-fit: contain; }
/* Cart and checkout thumbnails crop the tall whole-bottle photo; aim at the label (lower part of every bottle). */
.line__media img, .summary__line .thumb img { object-position: 50% 88%; }

/* The second gallery image is the landscape dark close-up: show it whole */
.lightbox img { background: #000; }

/* Age gate panel sits on a near-black page: give it an edge */
.age-gate { background: rgba(0, 0, 0, 0.9); }
.age-gate__panel { background: var(--bg-2); border: 1px solid var(--line); }

/* ---------- Product page hero (dark-product.js) ----------
   Same framing as the wine pages: the close-up is as tall as the hero (max
   1080 px), pinned to the right edge of a centred 1600 px frame; the bottle's
   left edge sits 0.561 × that height from the photo's right edge, and the text
   column is capped so it never reaches it.                                 */
.pdp-hero {
  --hero-h: clamp(560px, calc(100vh - 66px), 1080px);
  --fl: max(0px, calc((100% - 1600px) / 2));          /* empty margin each side of the frame */
  --il: clamp(1.5rem, 6vw, 6rem);                       /* text inset from the frame's left edge */
  position: relative; height: var(--hero-h); overflow: hidden; background: #000;
  display: flex; align-items: center;
}
@supports (height: 100svh) { .pdp-hero { --hero-h: clamp(560px, calc(100svh - 66px), 1080px); } }
.pdp-hero__photo { position: absolute; top: 0; bottom: 0; left: 0; right: var(--fl); }
.pdp-hero__photo img { position: absolute; top: 0; right: 0; height: 100%; width: auto; max-width: none; }
.pdp-hero__info {
  position: relative; z-index: 1;
  margin-left: calc(var(--fl) + var(--il));
  width: min(34rem, calc(100% - var(--fl) - var(--il) - var(--hero-h) * 0.561 - 3rem));
}
.pdp-hero__info .eyebrow { margin-bottom: 2rem; }
.pdp-hero__info .pdp__name { font-size: clamp(2.4rem, 4.6vw, 4.2rem); line-height: 1.04; }
.pdp-hero__info .pdp__desc { color: var(--muted); }
/* Wider than the frame: fade the photo's right edge into black (the bottle runs off the image there) */
@media (min-width: 1601px) {
  .pdp-hero__photo { -webkit-mask-image: linear-gradient(to left, transparent, #000 3%); mask-image: linear-gradient(to left, transparent, #000 3%); }
}
/* Below the hero: less top padding, the details follow straight on */
.pdp-hero + main.section { padding-top: clamp(3rem, 6vw, 5rem); }

/* Narrow or upright screens: photo on top, text below (as on the wine pages) */
@media (max-width: 800px), (max-aspect-ratio: 6/5) {
  .pdp-hero { height: auto; display: block; }
  .pdp-hero__photo { position: relative; right: 0; height: 52vh; }
  .pdp-hero__photo img { height: 100%; }
  .pdp-hero__info { margin: 0; width: auto; padding: 1.5rem 1.5rem 0; }
}

/* Shop and Cart as outline icons in the header (same pair as the home page) */
.nav__actions .cart-btn { width: 44px; height: 44px; padding: 0; justify-content: center; color: var(--ink); }
.nav__actions .cart-btn svg { width: 22px; height: 22px; }
