/* =========================================================================
   GETU Shopping - chrome CSS
   -------------------------------------------------------------------------
   Two jobs:
     1. what cannot live on a Bricks element (#brx-header is Bricks' own
        wrapper - no global class can reach it);
     2. the shared component CSS from the reference's assets/css/style.css,
        carried over verbatim so the ported header markup means the same thing
        here as it does there.

   Loaded after getu-tailwind.css, so these rules win where they overlap.
   Ports to production unchanged: no URLs, no ids, no environment assumptions.
   ========================================================================= */

/* ---- Sticky header ------------------------------------------------------
   The whole wrapper sticks, offset upward by exactly the announcement bar's
   height, so the bar scrolls away and the nav row comes to rest at top: 0 -
   which is what the reference does, where the nav is a direct child of <body>.
   The offset reads the same variable as the bar's height; never hardcode it. */
#brx-header {
  position: sticky;
  top: calc(-1 * var(--getu-announce-h));
  z-index: 50;
}

/* ---- Reference variable aliases -----------------------------------------
   The reference's markup writes shadow-[var(--shadow-float)] inline. Rather
   than rewrite the markup (and lose verbatim parity), map the reference's
   names onto the design-system tokens. The tokens stay the single source of
   truth; these are only the names the ported HTML asks for. */
#brx-header,
.getu-vanilla-scope {
  --shadow-float: var(--getu-shadow-float);
  --shadow-raised: var(--getu-shadow-raised);
  --ease-out: var(--getu-ease-out);
  --ease-spring: var(--getu-ease-spring);
}

/* ---- Preflight equivalent ------------------------------------------------
   Tailwind's preflight is off: it would fight Bricks' own base layer and undo
   the theme style. But the reference's markup leans on parts of it, and every
   time one was missing it showed up as a wrong number, never as an error.
   This block is those parts, and nothing more.

   Specificity is the whole game here, and it cuts both ways:
     - A reset must LOSE to a Tailwind utility, or it eats the value the
       markup asked for. Hence :where(), which contributes zero.
     - A reset must WIN against Bricks' element-level styling, or it never
       applies at all. Hence the plain #brx-header selectors.
   Each rule below picks a side deliberately; both mistakes have been made
   here already, and each one cost a full measurement round.
   ------------------------------------------------------------------------ */

/* Icons. NOT :where(): at zero specificity a Bricks element rule wins and the
   icons fall back to display: inline, which builds a line box (line-height 24
   plus descender) instead of hugging the 20px icon - measured as icon buttons
   7px too tall. No utility sets display on an svg here, so winning is free.
   The cart button hid this for a while: it is a flex container, and flex
   blockifies its children whatever the svg's own display says. */
#brx-header svg,
#brx-header img,
.getu-vanilla-scope svg,
.getu-vanilla-scope img {
  display: block;
  vertical-align: middle;
}

/* Lists. The browser's default padding-inline-start: 40px - measured as a nav
   exactly 40px too wide. The ported markup carries no list styling of its own. */
:where(#brx-header, .getu-vanilla-scope) :where(ul, ol) {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Borders. Tailwind's border utilities set border-WIDTH and nothing else; the
   border-style: solid they rely on comes from preflight. Without it the style
   stays `none`, every width resolves to 0, and the mega panel, search panel
   and mobile menu all lose their 1px border.

   All three declarations are mandatory, and here is the trap: the INITIAL
   value of border-width is `medium` (3px), harmless only while the style is
   `none`. Setting the style alone hands every element in the header a 3px
   border - measured, once, at 424 diffs. Preflight sets width AND style AND
   colour together for exactly this reason; anything less is not a reset but a
   new bug. The colour is preflight's default, which is what the reference
   computes on every element with no border utility of its own. */
:where(#brx-header, .getu-vanilla-scope) :where(*),
:where(#brx-header, .getu-vanilla-scope) :where(*)::before,
:where(#brx-header, .getu-vanilla-scope) :where(*)::after {
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

/* Form controls. Preflight gives them `font: inherit; line-height: inherit;
   color: inherit`, which is why the reference's fields inherit the unitless
   1.5 and size themselves off their own font-size (16px -> 24px, 13.5px ->
   20.25px), and read in the page's own ink colour rather than the browser's.
   Without font/line-height a Bricks form rule pins line-height to 40px -
   measured as a search field 70px tall instead of 54px. Without colour, a
   `<select>` with no `text-*` utility of its own (e.g. the shop's `#sort`)
   falls back to the browser's native control text colour
   (`rgb(158,158,158)`, mid-grey) instead of inheriting the reference's ink
   (`rgb(36,16,21)`) - task-6 report, shop-parity residual. The inherited
   context is already identical, so inherit lands on exactly the reference's
   numbers.
   NOT :where(): it has to beat Bricks' form styling, and no utility here sets
   a leading- or text- utility on a field. */
#brx-header input,
#brx-header textarea,
#brx-header select,
.getu-vanilla-scope input,
.getu-vanilla-scope textarea,
.getu-vanilla-scope select {
  font-family: inherit;
  line-height: inherit;
  color: inherit;
}

/* Buttons. MUST stay :where(): `p-2.5` has to beat this, or every icon button
   loses its padding and renders 20px wide instead of 40px. Border is
   deliberately absent - the universal rule above already resets width and
   style, and repeating `border: 0` here would set the style back to `none`. */
:where(#brx-header, .getu-vanilla-scope) :where(button) {
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Heading colour + line-height inheritance. Preflight sets neither on
   h1..h6, so a heading with no colour/leading utility of its own inherits
   both from its ancestor (e.g. a dark section's .text-cream for colour; the
   reference's own `body { line-height: 1.5 }` for line-height, carried down
   unitless so each heading multiplies it by its own font-size). The Bricks
   child theme's global stylesheet sets both directly on the element instead,
   for the rest of the site -
   `h1, h2, h3, h4, h5, h6 { color: var(--getu-heading-on-light); ... }` plus
   a per-level rule per heading tag, e.g.
   `h2 { font-size: var(--getu-text-h2); line-height: var(--getu-leading-h2) }`
   (`--getu-leading-h2` resolves to a fixed `1.06`) - and a rule that matches
   the element directly always wins over an inherited value, regardless of
   specificity. For colour, on the homepage's dark sections that renders the
   heading in the *background's own colour*: invisible, not just wrong.
   Confirmed on the hero h1, #b2b h2, the newsletter h2, and the category
   tiles' h3 - task-9 report, Finding 1. For line-height, the shop's
   `#seo-title` (h2, no `leading-*` utility of its own) measured `36px`
   `font-size` on both sides (the `.text-[36px]` utility beats the theme's
   `h2{font-size}` there, same as always) but `line-height: 38.16px` live
   vs `54px` on the reference (`1.06 x 36` vs the ambient `1.5 x 36`) -
   task-6 report, shop-parity residual. Font-size isn't touched here because
   a utility already wins that fight on every heading measured; only
   line-height has no competing utility anywhere it's been measured, so nothing
   stops the theme's per-level rule from winning it outright.

   The fix has to land at the SAME specificity as the theme's rules (0,0,1),
   not lower and not higher:
     - Lower (fully :where()) loses outright to the theme rules it exists to
       beat - the whole point is to override them.
     - Higher (e.g. `.getu-vanilla-scope h1`, 0,1,1) would also beat the
       three homepage headings that carry a real colour utility
       (`group-hover:text-wine-700` on the recipe-card h3s, itself
       (0,3,0) at :hover but only (0,0,1) - i.e. this same theme rule - at
       rest) in the wrong direction: it would pin them to `inherit` even
       where a utility is meant to win, and more importantly would beat any
       future plain `.text-{colour}`/`.leading-*` utility (0,1,0) placed on
       a heading.
   `:where(#brx-header, .getu-vanilla-scope)` contributes zero, so the bare
   `h1`...`h6` at the end is what carries the (0,0,1) - identical to the
   theme's own selectors, decided by source order instead: this stylesheet
   loads after the theme's, so it wins the tie. Verified by measurement
   after deploy, not assumed - see task reports.

   Confirmed harmless site-wide before adding `line-height: inherit`: every
   h1..h6 on the homepage (index.html) already carries an explicit
   `leading-*` utility (0,1,0), which keeps beating this (0,0,1) rule exactly
   as before - checked by grepping every heading tag's class list. Only
   headings with no `leading-*` of their own (the shop's `#seo-title`, its
   "no results" h3, the filter sidebar's `.kicker` h3 labels) are newly
   affected, and for those `inherit` reproduces the reference's own pure-
   inheritance behaviour, since both sides declare the same unitless
   `body { line-height: 1.5 }`. */
:where(#brx-header, .getu-vanilla-scope) h1,
:where(#brx-header, .getu-vanilla-scope) h2,
:where(#brx-header, .getu-vanilla-scope) h3,
:where(#brx-header, .getu-vanilla-scope) h4,
:where(#brx-header, .getu-vanilla-scope) h5,
:where(#brx-header, .getu-vanilla-scope) h6 {
  color: inherit;
  line-height: inherit;
}

/* Label colour inheritance - same bug, same fix, one element further down
   the chain. Fixing the form-control reset above (`color: inherit` on
   input/textarea/select) was not sufficient on its own for the shop's
   `#sort`: it wraps in `<label class="relative hidden lg:flex items-center">`
   with no colour utility of its own, and the Bricks theme carries a global
   `label { color: var(--bricks-text-light) }` (#9e9e9e, mid-grey) that
   matches the label directly and wins over its inherited ink - identical
   mechanism to the heading-colour bug above, one tag name different. Once
   the label itself is grey, the select's new `color: inherit` faithfully
   inherits *that* grey - correct inheritance, wrong upstream value. Confirmed
   via CDP CSS.getMatchedStylesForNode, not the DOM CSSOM scan (which cannot
   see rules Bricks emits inside a cascade layer): `label`'s only matching
   colour rule was this one theme rule; the select's grey traced straight
   back to it. Reference has no colour utility on this label either, so it
   inherits ink; same (0,0,1) trick closes the gap here. */
:where(#brx-header, .getu-vanilla-scope) label {
  color: inherit;
}

/* Margin reset for block-level elements. Preflight zeroes the UA default
   margin on these tags; without it a bare, unclassed <p> (no mt-* / mb-*
   utility of its own) picks up the browser's ~1em vertical margin out of
   nowhere - measured on the product-card price line as 22.8px of bottom
   margin the reference does not have, inflating card height and every
   section/grid offset below it (task-9 report, Finding 2). blockquote,
   figure, dl, dd, hr and pre are preflight's own list; h1-h6 are included
   here too since preflight also zeroes their margin (the colour rule above
   only ever touched `color`, never `margin`).

   Fully :where(): an author rule beats a user-agent default regardless of
   specificity, so zero specificity is enough to win here - and staying at
   zero is what lets a margin utility (`.mt-1`, `.mb-2`, both (0,1,0)) still
   override it exactly where the markup asks for one. */
:where(#brx-header, .getu-vanilla-scope) :where(p, h1, h2, h3, h4, h5, h6, blockquote, figure, dl, dd, hr, pre) {
  margin: 0;
}

/* ---- Brand surfaces (assets/css/style.css) ------------------------------ */
.wine-atmos {
  background-color: var(--getu-color-wine-900);
  background-image:
    radial-gradient(120% 90% at 85% 0%, rgba(139,36,54,.55) 0%, rgba(42,14,20,0) 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(110,26,42,.45) 0%, rgba(42,14,20,0) 60%),
    radial-gradient(60% 60% at 50% 120%, rgba(200,164,93,.10) 0%, rgba(42,14,20,0) 60%);
}

.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ---- Wordmark ----------------------------------------------------------- */
.wordmark {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: .22em;
}
.wordmark-sub {
  font-family: "Hanken Grotesk", sans-serif;
  letter-spacing: .42em;
  font-weight: 500;
}

/* ---- Eyebrow ------------------------------------------------------------ */
.kicker {
  font-family: "Hanken Grotesk", sans-serif;
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 600;
}

/* ---- Body copy line-height ----------------------------------------------
   From the reference's assets/css/style.css. A plain class selector, so it
   only ever matches markup that carries it - the ported homepage (4 uses) and
   shop (3 uses). It was missed on the first port, which left every element
   using it rendering at the inherited line-height instead of 1.7; the shop
   parity suite caught it on #seo-body and #cat-desc. */
.leading-relaxed-body { line-height: 1.7; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: transform .35s var(--getu-ease-spring), box-shadow .35s var(--getu-ease-out), background-color .25s, color .25s, border-color .25s;
  will-change: transform;
}
.btn:focus-visible { outline: 2px solid var(--getu-color-gold); outline-offset: 3px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--getu-color-wine-600); color: #fff; box-shadow: var(--getu-shadow-raised); }
.btn-primary:hover { background: var(--getu-color-wine-500); transform: translateY(-2px); box-shadow: var(--getu-shadow-float); }
.btn-gold { background: var(--getu-color-gold); color: var(--getu-color-wine-900); box-shadow: var(--getu-shadow-raised); }
.btn-gold:hover { background: var(--getu-color-gold-hover); transform: translateY(-2px); box-shadow: var(--getu-shadow-float); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: var(--getu-color-gold); color: var(--getu-color-gold); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--getu-color-wine-700); border: 1px solid rgba(110,26,42,.30); }
.btn-outline:hover { border-color: var(--getu-color-wine-600); background: rgba(110,26,42,.05); transform: translateY(-2px); }
/* WhatsApp button — the shared GREEN base (reference style.css). Used by the
   landing pages (cold-brew, solucoes-b2b, …). The PDP repaints it white via
   getu-product.css's `.single-product .btn-wa`, which loads after this and
   out-specifies it. */
.btn-wa { background: #25D366; color: #07351b; box-shadow: var(--getu-shadow-raised); }
.btn-wa:hover { background: #2ee06f; transform: translateY(-2px); box-shadow: var(--getu-shadow-float); }

/* ---- Nav link underline ------------------------------------------------- */
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1.5px;
  width: 100%;
  background: var(--getu-color-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--getu-ease-out);
}
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }

/* ---- Mega menu ---------------------------------------------------------- */
.has-mega > .mega {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s var(--getu-ease-out), transform .3s var(--getu-ease-out), visibility .3s;
}
.has-mega:hover > .mega,
.has-mega:focus-within > .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-link { transition: background-color .2s, transform .2s var(--getu-ease-out); }
.mega-link:hover { background: rgba(110,26,42,.05); transform: translateX(2px); }

/* Tailwind cannot generate top-[calc(100%+18px)] (the + needs spaces in an
   arbitrary value), so the reference's mega offset lives here instead. */
.has-mega > .mega { top: calc(100% + 18px); }



/* ---- Search panel ------------------------------------------------------- */
#search-panel { transition: opacity .3s var(--getu-ease-out), transform .3s var(--getu-ease-out); }
#search-panel.closed { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* ---- Search results -----------------------------------------------------
   The reference injects these from JS at runtime; here they are a real
   stylesheet, so they are present before the panel ever opens and cost no
   scripting. Values are the reference's.

   640px is the reference's own threshold for the full-screen treatment, and
   getu-vanilla-search.js reads the same number for the scroll lock - if one
   changes, the other must. */
.gs-item { transition: background-color .15s; }
.gs-item.gs-active,
.gs-item:hover { background: rgba(110, 26, 42, .06); }
.gs-chip { transition: background-color .2s, border-color .2s; }
.gs-chip:hover { border-color: var(--getu-color-wine-600); background: rgba(110, 26, 42, .05); }
.gs-label {
  font-family: "Hanken Grotesk", sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(36, 16, 21, .45);
}

@media (max-width: 640px) {
  #search-panel:not(.closed) {
    position: fixed;
    inset: 0;
    height: 100dvh;
    max-height: none;
    border-top: 0;
  }
  #search-panel:not(.closed) > .gs-wrap {
    height: 100dvh;
    display: flex;
    flex-direction: column;
  }
  #search-panel #gsearch-body { flex: 1; max-height: none; }
}

/* ---- Announcement rotator ---------------------------------------------- */
.ann-msg { transition: opacity .4s var(--getu-ease-out), transform .4s var(--getu-ease-out); }
.ann-msg.out { opacity: 0; transform: translateY(-6px); position: absolute; }

@media (prefers-reduced-motion: reduce) {
  .btn,
  .nav-link::after,
  .has-mega > .mega,
  .mega-link,
  #search-panel,
  .ann-msg { transition: none; }
  .btn:hover,
  .btn:active { transform: none; }
}
