/* ============================================================================
   ragazzi-header.css — the nav bar and the mobile drawer, CARRIED from the
   static's ragazzi-site/css/sections/hero.css ("Nav" block) and
   ragazzi-site/css/pages/home-components.css ("Mobile nav drawer" block).

   WHY IT LIVES HERE. In Figma the nav is inside the hero frame and sits on its
   photo. In Shopify it is `sections/header.liquid` — Dawn's own section, kept
   whole: its menu object, drawer, search modal, localization forms, cart bubble
   and sticky-header JS are untouched. Only wrapper CLASSES were added to its
   markup, and one render call was moved (the drawer, into the icon row, where
   the design puts the hamburger). Nothing was rewritten.

   RENAMED, 1:1, because the block is no longer inside a hero:
     .hero--home .hero__nav        ->  .ragazzi-header__bar
     .hero--home .hero__logo       ->  .ragazzi-header__logo
     .hero--home .hero__links      ->  .ragazzi-header__links
     .hero--home .hero__icons      ->  .ragazzi-header__icons
     .hero--home .hero__icons > li ->  .ragazzi-header__icon
     :where(.page-home) .nav-drawer__panel -> Dawn's .menu-drawer (see ADAPTATION)

   DROPPED ON THE WAY IN, with the reason:
   - `.hero__nav { margin-inline: calc(var(--sp-gutter) * -1) }`. In the static
     the nav is a full-width frame inside a body that already carries the gutter,
     so it has to break out of it. Here the header is its own section with no
     parent padding, so the negative margin would pull it OFF the page by one
     gutter. The padding it compensated for is kept.
============================================================================ */

/* ---------------------------------------------------------------------------
   SECTION TOKENS — carried verbatim from the static's `.hero--home` and
   `.page-home` blocks, the ones this section reads, in the static's own band
   order (desktop base, then mobile, then pseudo-tablet).
--------------------------------------------------------------------------- */
.ragazzi-header {
  --font-display:        "Advercase", "Playfair Display", Georgia, serif;
  --size-icon-nav:       clamp(16.26px, calc(30.48px * (var(--max-vw) / var(--vw-base))), 30.48px);
  --sp-gutter:           var(--container-pad);
  --sp-drawer-gap:       clamp(32px, calc(60px * (var(--max-vw) / var(--vw-base))), 60px);
  --sp-nav-h:            clamp(59.2px, calc(111px * (var(--max-vw) / var(--vw-base))), 111px);
  --sp-nav-icons-gap:    clamp(16px, calc(30px * (var(--max-vw) / var(--vw-base))), 30px);
  --sp-nav-links-gap:    clamp(21.33px, calc(40px * (var(--max-vw) / var(--vw-base))), 40px);
  --sp-nav-pad-y:        clamp(16.26px, calc(30.48px * (var(--max-vw) / var(--vw-base))), 30.48px);
  --text-logo:           clamp(24px, calc(45px * (var(--max-vw) / var(--vw-base))), 45px);
  --text-nav-link:       clamp(11px, calc(20px * (var(--max-vw) / var(--vw-base))), 20px);
  --z-drawer:            200;
}

@media (max-width: 767px) {
  .ragazzi-header {
    --size-icon-nav:       clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-drawer-gap:       clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-nav-h:            clamp(51.2px, calc(60px + (var(--max-vw) - 375px) * 0.015), 122.72px);
    --sp-nav-icons-gap:    clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --sp-nav-pad-y:        clamp(17.07px, calc(20px + (var(--max-vw) - 375px) * 0.015), 40.91px);
    --text-logo:           clamp(17px, calc(20px + (var(--max-vw) - 375px) * 0.015), 41px);
    --text-nav-link:       clamp(14px, calc(16px + (var(--max-vw) - 375px) * 0.015), 33px);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .ragazzi-header {
    --size-icon-nav:       clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30.48px);
    --sp-drawer-gap:       clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 60px);
    --sp-nav-h:            clamp(60px, calc(60px + (var(--max-vw) - 768px) * 0.025), 111px);
    --sp-nav-icons-gap:    clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30px);
    --sp-nav-links-gap:    clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 40px);
    --sp-nav-pad-y:        clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 30.48px);
    --text-logo:           clamp(20px, calc(20px + (var(--max-vw) - 768px) * 0.025), 45px);
    --text-nav-link:       clamp(16px, calc(16px + (var(--max-vw) - 768px) * 0.025), 20px);
  }
}

/* ---------------- Nav bar ----------------
   Figma 3080:13445 (D) 1920 x 111, padding [30.48, 100]; (M) 375 x 60,
   padding [20, 20]. The bar carries the gutter itself.                        */
/* HEIGHT, NOT MIN-HEIGHT PLUS BLOCK PADDING — and this is what caused the white
   strip under the announcement bar below 1024.

   It was `min-height: var(--sp-nav-h)` with `padding: var(--sp-nav-pad-y) ...`,
   so the bar was really `pad + tallest child + pad` and the min-height only
   applied when that sum came out smaller. On desktop it always does, which is
   why the token and the rendered box agreed to a hundredth of a pixel when this
   was checked. Below 1024 the sum WINS and the two part company:

     390px   token 60.23   rendered 62.68  (20.225 + 22.23 + 20.225)
     1023px  token 66.38   rendered 81.76

   The hero is pulled up by the TOKEN (see "3. The overlap"), so whatever the bar
   gains over it shows as page background between the announcement bar and the
   photo — 2.45px on a phone, 15.4px at 1023.

   Fixing the padding instead would only move the problem, because the gap is
   between two ways of stating one height. The bar IS the design's 60/111px box
   (Figma's mobile frame is 375x60 with the logo at y=19, h=22 — i.e. the frame
   height is fixed and the 20px auto-layout padding it declares does not fit
   inside it), so it is stated once, as a height, and `align-items: center` goes
   on doing the centring the padding used to do.

   Checked that nothing overflows the box at any width: the tallest child is the
   logo at `--text-logo` x 1.1, which is 22.2 of 60.2 at 390, 29.0 of 66.4 at
   1023, 26.4 of 59.2 at 1024 and 49.5 of 111 at 1920. `--sp-nav-pad-y` is still
   the drawer panel's padding, so it is not orphaned.                          */
.ragazzi-header .ragazzi-header__bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: var(--sp-nav-h);
  padding-block: 0;
  padding-inline: var(--sp-gutter);
}

.ragazzi-header .ragazzi-header__logo {
  font-family: var(--font-display);
  font-size: var(--text-logo);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--color-white);
  white-space: nowrap;
}

/* Desktop only. `flex: 1` + centring reproduces Figma's FIXED 1283.81 wrapper
   without the magic number: the List's centre lands at x ~= 1000.78 either way
   (brief §11 D-9). */
.ragazzi-header .ragazzi-header__links {
  flex: 1;
  display: flex;
  justify-content: center;
}

.ragazzi-header .ragazzi-header__links ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: var(--sp-nav-links-gap);
}

.ragazzi-header .ragazzi-header__links a,
.ragazzi-header .ragazzi-header__links summary {
  font-family: var(--font-body);
  font-size: var(--text-nav-link);
  font-weight: 600;
  line-height: var(--lh-120);
  text-transform: uppercase;
  color: var(--color-white);
  white-space: nowrap;
}

.ragazzi-header .ragazzi-header__icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  column-gap: var(--sp-nav-icons-gap);
}

/* Each icon slot IS the icon box (30.48 / 20 square) — the control inside only
   carries the interaction, it must not add a box of its own. */
.ragazzi-header .ragazzi-header__icon {
  display: flex;
  width: var(--size-icon-nav);
  height: var(--size-icon-nav);
  flex: 0 0 auto;
}

.ragazzi-header .ragazzi-header__icon > * {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* PRE-HYDRATION SIZE OF THE ACCOUNT ICON — the load flash.
   `<shopify-account>` is a custom element, and Shopify prints its own inline
   <style> into the page:

     shopify-account.header__icon:not(:defined) { min-width: 4.4rem; height: 4.4rem }

   `:not(:defined)` holds until Shopify's script registers the element, which on
   this store lands around 1.3s. Until then that rule beat the box above — it is
   (0,2,1) against our (0,2,0), and its `min-width` outranks a plain `width`
   whatever the order — so the account icon painted at 44px, the icon row with
   it, and the header stood 91.5px tall before snapping to 86.48px. That snap is
   what read as the header flashing on every load.

   Restating both properties for the undefined state fixes the first paint
   rather than the settled page, which already measured correct. Verified by
   rendering the page's own HTML with every <script> stripped: 91.5 -> 86.48 and
   the icon row 44 -> 23.73, identical to the settled layout, so nothing moves.
   Do not fold this into the rule above: it must stay more specific than
   Shopify's inline rule, and `:not(:defined)` is what buys that.               */
.ragazzi-header shopify-account.ragazzi-header__icon:not(:defined) {
  min-width: var(--size-icon-nav);
  width: var(--size-icon-nav);
  height: var(--size-icon-nav);
}

.ragazzi-header .ragazzi-header__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------------- Mobile drawer ----------------
   A DEFAULT, not a Figma frame: Figma's mobile layer has a hamburger and no open
   state anywhere on the canvas. The four links exist only on the desktop bar, so
   hiding them on mobile with no route to them would lose real navigation. This
   panel is the minimum that loses nothing: the same links, white on black, full
   screen. The hamburger doubles as the close control — Figma has no close icon
   and inventing one is forbidden.                                             */
.ragazzi-header .ragazzi-header__drawer-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
  row-gap: var(--sp-drawer-gap);
  padding: var(--sp-nav-pad-y) var(--sp-gutter);
  background: var(--color-black);
}

.ragazzi-header .ragazzi-header__drawer-panel ul {
  display: flex;
  flex-direction: column;
  row-gap: var(--sp-drawer-gap);
}

/* …except the social list, which is a ROW. The column rule above is carried
   from the static's drawer and describes the NAVIGATION list — one link per
   line. Dawn puts its social icons in the same panel, in a `ul` of their own,
   and they inherited the column and the 20px nav gap: five icons stacked down
   the panel, which is not what a row of glyphs is for.

   The gap is the header's own icon spacing rather than the drawer's link
   spacing, because that is what these are — the same size icons the bar carries,
   just relocated. `flex-wrap` so a store that adds every network does not push
   the row out of the panel. */
.ragazzi-header .ragazzi-header__drawer-panel .list-social {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--sp-nav-icons-gap);
  row-gap: var(--sp-nav-icons-gap);
}

.ragazzi-header .ragazzi-header__drawer-panel a,
.ragazzi-header .ragazzi-header__drawer-panel summary {
  font-family: var(--font-body);
  font-size: var(--text-nav-link);
  font-weight: 600;
  line-height: var(--lh-120);
  text-transform: uppercase;
  color: var(--color-white);
}

/* ============================================================================
   ADAPTATION — Dawn reconciliation. Nothing above this line is ours.
   TWELVE rules, listed and numbered. Past roughly a dozen the playbook says stop
   adding and rebuild from one specificity pass — so if a thirteenth is ever
   needed, that is the signal, not a licence.
============================================================================ */

/* 1. The bar's ground, and its two variants. Dawn paints `.header-wrapper` from
      the section's colour scheme; the design's bar is white-on-black by default.

      `--overlay` — the home page, where the bar sits ON the hero photo and must
      disappear. Added by the section on the index template only.

      `--light` — the inner pages the design draws with a WHITE bar (Figma's
      community page puts the hero photo BELOW the nav, at y 156.71 = the
      ticker's 45.71 + the nav's 111, instead of behind it). Everything that was
      white on the black bar inverts: the logo, the links, the active link's own
      span, and the icon rasters — those are the design's PNG files, drawn white,
      so `filter: invert(1)` is what turns them black without shipping a second
      set of files. It is applied to EVERY template except the index, by rule and
      with no setting (sections/header.liquid) — a list of page handles used to
      decide it, which left /collections, the collection pages, the products,
      cart and search black and needed editing for every new template.

      These two stay siblings of the same rule rather than becoming a rule of
      their own: they are one decision — what colour the bar's ground is — and
      the ADAPTATION budget counts decisions. */
.ragazzi-header.header-wrapper {
  background: var(--color-black);
  border-bottom: 0;
}

.ragazzi-header--overlay.header-wrapper {
  background: transparent;
}

.ragazzi-header--light.header-wrapper {
  background: var(--color-white);
}

.ragazzi-header--light .ragazzi-header__logo,
.ragazzi-header--light .ragazzi-header__links a,
.ragazzi-header--light .ragazzi-header__links summary,
.ragazzi-header--light .ragazzi-header__links .header__active-menu-item {
  color: var(--color-black);
}

.ragazzi-header--light .ragazzi-header__icon img {
  filter: invert(1);
}

/* 2. …but a sticky header that has left the hero behind is over ordinary page
      content, where white on nothing is invisible. Dawn's own JS adds
      `shopify-section-header-sticky` exactly then, so the ground comes back with
      it. This is why the sticky setting can stay on. */
.shopify-section-header-sticky .ragazzi-header--overlay.header-wrapper {
  background: var(--color-black);
}

/* 3. The overlap. The design's photo starts at the top of the frame and the nav
      lies ON it, so the first section is pulled up under the header by exactly
      the bar's height.

      `--header-height` USED TO BE PREFERRED HERE, with `--sp-nav-h` only as the
      pre-JS fallback. That was wrong on both counts and it was visible: Dawn's
      sticky-header element sets `--header-height` from `this.header.offsetHeight`,
      which on this store measures 91px against a header that is really 86.5 -
      it is measuring a different box. So the hero sat flush while the page
      loaded and then jumped 4.5px UP under the announcement bar the moment that
      script ran, on every load.

      `--sp-nav-h` is the design's own value and measured 86.4875 against a
      rendered header of 86.5 - agreement to a hundredth of a pixel, and it is
      a static token, so there is no second value to jump to. It is now the only
      source. Nothing here depends on the sticky-header script any more, which
      also covers the merchant turning it off. */
body:has(.ragazzi-header--overlay) .hero--home {
  margin-top: calc(-1 * var(--sp-nav-h));
}

/* 4. The gutter itself is NOT fixed here, and that is worth recording: Dawn pads
      the bar through the `page-width` class, whose widest rule reaches (0,5,1)
      — nothing sane in this file outranks it, and measured on the live page the
      bar came out with a 50px gutter against the design's 100. The class is off
      the element in the markup instead (sections/header.liquid).

      What IS here are Dawn's grid-era OFFSETS, which all survive the switch to
      `display: flex` and which the design has none of: a 2rem column gap between
      header areas, -0.75rem on the logo, -1.2rem on the inline menu, 0.8rem of
      padding on the icon row and -1.2rem on the cart. Measured together they
      moved the logo 7.5px into the gutter and pushed the cart 4px past the
      right one. One rule, because they are one problem. */
.ragazzi-header .ragazzi-header__bar {
  column-gap: 0;
}

.ragazzi-header .ragazzi-header__logo.header__heading-link,
.ragazzi-header .ragazzi-header__links.header__inline-menu,
.ragazzi-header .ragazzi-header__icons,
.ragazzi-header .header__icon--cart {
  margin: 0;
  padding-inline: 0;
}

/* …and the same problem from the other side: the icon row contains children with
   no box at all — Dawn's always-rendered `.desktop-localization-wrapper`, and a
   `<shopify-store>` element that the platform injects at runtime. A flex
   `column-gap` counts them, so each one spends 30px of the design's icon
   spacing on nothing: MEASURED 60px between search and account against 30px
   between account and cart. `:empty` matches exactly the ones with nothing in
   them — `<shopify-account>` carries its slot spans and is untouched. The
   localization wrapper needs the second selector because it holds WHITESPACE
   when both selectors are off, which defeats `:empty`; `:not(:has(*))` asks the
   question that actually matters, "does it render anything". */
.ragazzi-header .ragazzi-header__icons > *:empty,
.ragazzi-header .desktop-localization-wrapper:not(:has(*)) {
  display: none;
}

/* 5. Dawn's `.link` utility — underline, `display: inline-block`, its own 1.4rem
      font-size and link colour — is on the logo, every icon and every drawer
      item. It is the single biggest source of header bugs in this codebase
      (playbook §8.3).

      ONLY the underline is neutralised here, and that is the whole lesson: the
      first version of this rule also set `font-size: inherit; color: inherit`,
      which is (0,2,0) — a TIE with the carried `.ragazzi-header__logo` rule
      above, and later in the file, so the adaptation layer beat the design and
      the wordmark rendered at Dawn's inherited 40px/#121212. Measured on the
      live page before push. Everything `.link` sets that matters is already
      out-specified by a design rule; nothing else belongs in here. */
.ragazzi-header .link {
  text-decoration: none;
}

/* 6. The wordmark. With no logo image Dawn renders the shop name in a `.h2`
      span, which brings the heading family, a 2rem size, Dawn's tracking and the
      foreground colour with it — all four of which the design sets on the anchor
      instead. `.header__heading-link`'s own 0.75rem padding and
      `word-break: break-word` go the same way. */
.ragazzi-header .ragazzi-header__logo.header__heading-link {
  padding: 0;
  word-break: normal;
}

.ragazzi-header .ragazzi-header__logo .h2 {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

/* 7. Dawn sizes every header control as a 4.4rem tap box and every icon glyph as
      a 2rem SVG on a 44px `.svg-wrapper`. The design's icons are its own rasters
      in a 30.48/20 box, and the box IS the control. The design rules above own
      the box at (0,2,0); this reaches the wrapper span Dawn puts between the
      control and the glyph.

      THE TOKEN, NOT `100%` — and the difference is not cosmetic. The account
      control is `<shopify-account>`, a web component: our span is slotted into
      its shadow DOM, so a percentage resolves against the SHADOW container (the
      component's own 4.4rem button), not against the 30.47 host. Measured on the
      live store: search and cart came out 30.47 and the account icon 43.95 —
      44% too big, overflowing its own control. The token cannot be misread that
      way; it inherits into the light-DOM span and means the same thing in every
      one of the three. Ink checked too, afterwards: 24.5 / 23.5 / 23.5 px tall
      across search / account / cart, so the rasters themselves are consistent
      and no per-icon correction is wanted. */
.ragazzi-header .ragazzi-header__icon .svg-wrapper {
  width: var(--size-icon-nav);
  height: var(--size-icon-nav);
}

/* 8. Dawn's cart bubble is real functionality (it is re-rendered on every
      add-to-cart) and the design has no drawing for it. Recoloured to the
      palette rather than invented: white disc, black numeral. */
.ragazzi-header .cart-count-bubble {
  background: var(--color-white);
  color: var(--color-black);
}

/* ...and INVERTED on the light header. The white disc reads because the overlay
   header sits on the hero photo; on every other page the bar itself is white, so
   a white disc is a white smudge with a black number floating in it. The other
   three icons already flip there (`filter: invert(1)` above) - this is the same
   flip, written as colours because the bubble is a painted box, not a raster.

   `.ragazzi-header.ragazzi-header--light` and not the modifier alone: both
   classes sit on the same element, so the modifier by itself would only TIE with
   the rule above and be decided by source order. (0,3,0) beats (0,2,0) outright.

   The sticky case needs nothing: when the overlay header sticks it takes a black
   background, and there it stays `--overlay`, not `--light`, so it keeps the
   white disc it needs. */
.ragazzi-header.ragazzi-header--light .cart-count-bubble {
  background: var(--color-black);
  color: var(--color-white);
}

/* ---------------------------------------------------------------------------
   ...AND ITS GEOMETRY, which was wrong for two compounding reasons.

   1. DAWN anchors the bubble with `bottom: 0.8rem; left: 2.2rem` - measured, not
      read from a guess. Those numbers are tuned for Dawn's 4.4rem icon control,
      where 2.2rem is its horizontal midpoint. This header's icon is 20-30.48px,
      so `left: 22px` threw the bubble almost entirely off the right of it.

   2. OURS made it worse: `.ragazzi-header__icon > *` sets `width/height: 100%`
      to make the icon's inner span fill its box, and the bubble is a direct
      child of that same box, so it was stretched to 23.7px - all but the size of
      the icon it is supposed to badge.

   Rebuilt against the reference the user pointed at, nooa.coach: a 16px disc at
   `top: -2px; right: -4px` with a 10px numeral, flex-centred. Those are absolute
   there because that header's control is a fixed 30px; this one's icon is a
   fluid token, so each value is expressed as its nooa figure over 30.48 - the
   token's own maximum. At full size the result IS nooa's, to the pixel; below
   that it tracks the icon.

   The clamps are a legibility floor, not styling: the count can be two digits,
   and a bubble that scaled all the way down with a 20px mobile icon would run
   out of room for them. Verified 13px/8px at mobile and tablet, 16px/10px at
   1920.

   `inset: auto` first, because Dawn sets `bottom`/`left` and leaving either in
   play would fight the `top`/`right` below.
--------------------------------------------------------------------------- */
.ragazzi-header .ragazzi-header__icons .ragazzi-header__icon > .cart-count-bubble {
  inset: auto;
  top: calc(var(--size-icon-nav) * -2 / 30.48);
  right: calc(var(--size-icon-nav) * -4 / 30.48);
  width: clamp(13px, calc(var(--size-icon-nav) * 16 / 30.48), 16px);
  height: clamp(13px, calc(var(--size-icon-nav) * 16 / 30.48), 16px);
  font-size: clamp(8px, calc(var(--size-icon-nav) * 10 / 30.48), 10px);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 9. Dawn pads each inline menu item — 1.2rem all round from `.header__menu-item`
      plus 0.5rem top/bottom from `.list-menu__item--link` — which made the link
      row 48px tall against the design's 24. The design's links have no padding;
      their spacing is the row's own `column-gap`.

      Note what is NOT here: `display`. Dawn hides the inline menu until 990px and
      the design switches at 768, but that is handled by the `u-desktop-only`
      class on the element (a media query adds no specificity, and restating
      `display` in an adaptation layer is exactly what broke nooa's header). */
.ragazzi-header .ragazzi-header__links .header__menu-item,
.ragazzi-header .ragazzi-header__links .list-menu__item {
  padding: 0;
}

/* …and the padding that goes with it is load-bearing for ONE case: a menu entry
   with a submenu gets a caret that Dawn positions ABSOLUTELY, 0.8rem from the
   right edge, with `summary.list-menu__item { padding-right: 2.7rem }` reserving
   its room. Zeroing the padding alone would drop the caret on top of the label.
   The design has no dropdowns to copy, so the caret becomes what it already is
   inside Dawn's own submenus — an ordinary flex item after the text. */
.ragazzi-header .ragazzi-header__links .icon-caret {
  position: static;
  margin-left: 0.6rem;
  flex-shrink: 0;
}

/* One more from the same family, and it only shows up on a rendered page: the
   link for the CURRENT page gets an extra `<span class="header__active-menu-item">`
   whose own rule repaints it `rgb(var(--color-foreground))`. On a bar lying over
   a photo that is dark text on a dark photo — spotted in a screenshot, where one
   nav item was a different colour from its neighbours. Dawn's underline is kept:
   the design has no active state to copy, and an underline is the honest marker. */
.ragazzi-header .ragazzi-header__links .header__active-menu-item {
  color: inherit;
}

/* 10. The drawer. Dawn opens it as a 40rem panel hanging off the bottom of the
       header (`position: absolute; top: 100%`), which with a sticky header parks
       it off-screen; the design's is full-screen. Dawn's slide-in transform and
       its `.menu-opening` transition are kept — only the box changes. */
.ragazzi-header .menu-drawer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-drawer);
  background: var(--color-black);
  border: 0;
  filter: none;
}

/* …and Dawn states the height a SECOND time, as `.js .menu-drawer`, from
   component-menu-drawer.css — which the section links from inside the BODY, so
   it is later than this file and (0,2,0) ties go to it. Its value is
   `calc(var(--viewport-height, 100vh) - var(--header-bottom-position, 100%))`,
   which collapses to ZERO whenever those two custom properties are unset;
   measured on the live page, the panel came out 0 tall with its links spilling
   above the viewport. Matching Dawn's own `.js` prefix is the smallest thing
   that outranks it, and it keeps working with JS disabled, where neither rule
   applies and the (0,2,0) box above stands on its own. */
.js .ragazzi-header .menu-drawer {
  height: 100%;
}

/* 11. Two of Dawn's drawer chrome pieces have nothing to sit on once the panel
       is opaque and full-screen: the dimming pseudo-element behind it, and the
       close icon inside the hamburger — the design has no close glyph and the
       hamburger is the toggle. The hamburger itself must stay ABOVE the panel or
       it cannot close what it opened. */
.ragazzi-header .header__icon-close,
.ragazzi-header .header__icon--menu .icon-close {
  display: none;
}

/* The dimming layer behind the drawer. Worth reading carefully, because the
   obvious selector is the wrong one: component-menu-drawer.css draws it with
   `.js menu-drawer > details > summary::before`, but the element Dawn actually
   renders here is `<header-drawer>`, so that whole family never matches and
   copying it neutralises nothing (measured — the veil was still there). The one
   that DOES paint is `.header__icon--menu[aria-expanded='true']::before` in
   base.css, and it matters more than it looks: the hamburger carries
   `z-index: 201` above, so its ::before would paint OVER the opaque panel. */
.ragazzi-header .header__icon--menu::before {
  display: none;
}

.ragazzi-header .header__icon--menu {
  position: relative;
  z-index: calc(var(--z-drawer) + 1);
}

/* 12. Dawn's drawer insets: `3rem 0` on the nav, `1.1rem 3rem` on each item, and
       a 0.2rem gap under every `li` — three paddings that fight the panel's own
       inset and its row-gap. The panel box itself is the design rule above,
       which is applied to `.menu-drawer__navigation-container` (Dawn's own
       grid), so nothing here restates `display`. `--active` keeps Dawn's marker
       semantics, in the design's colours. */
.ragazzi-header .menu-drawer__navigation,
.ragazzi-header .menu-drawer__menu-item,
.ragazzi-header .ragazzi-header__drawer-panel .menu-drawer__menu li {
  padding: 0;
  margin-bottom: 0;
}

.ragazzi-header .menu-drawer__menu-item:hover,
.ragazzi-header .menu-drawer__menu-item--active {
  color: var(--color-white);
  background: none;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

/* ============================================================================
   SEARCH STAYS IN THE ICON ROW AT EVERY WIDTH.

   Reported: the search icon disappears on tablet and mobile. It is Dawn's, not
   ours - `base.css` decides where `.header__search` lives from the header's
   layout flags, and below 990 it runs:

     .header--has-account.header--has-menu:not(.header--mobile-left):not(.header--has-app)
       .header__icons > .header__search { display: none }

   This header carries `header--has-menu` and `header--has-account`, and its
   search sits inside `.header__icons`, so it matches exactly. Dawn compensates
   by revealing a SECOND search node - a direct child of <header>, placed in a
   `grid-area: search` - but that grid is Dawn's mobile header layout, which this
   port replaced. Our markup renders ONE search, in the icon row, so below 990
   there was simply nothing left to show. Verified on the live page: injecting
   that rule alone turns the icon's `display` from `flex` to `none`.

   Fixed by restating the row rather than by restoring Dawn's second node: this
   header keeps the SAME icon row at every width - that is the design - so the
   mobile grid areas have nowhere to put a second copy.

   NO DAWN FLAG CLASSES IN THE SELECTOR, on purpose. Keying on
   `--has-menu`/`--has-account` would make the fix evaporate the moment a
   merchant empties the menu or turns off accounts, and `base.css` has four more
   rules that hide this element under other flag combinations. Specificity is
   (0,6,1) - six real structural classes plus the element name - which clears
   the (0,6,0) of the strongest of them without inventing repeated classes.

   `flex`, not Dawn's `inline-flex`: that is what the icon already computes above
   990, so both bands now agree exactly.
============================================================================ */
.ragazzi-header .ragazzi-header__bar.header .header__icons.ragazzi-header__icons > details-modal.header__search {
  display: flex;
}

/* ============================================================================
   THE HAMBURGER SLOT.

   Reported: on tablet and mobile the last icon looks squeezed and the gap before
   it all but disappears.

   THE CAUSE WAS A NEGATIVE MARGIN, not a size. Measured across the row with the
   mobile tokens forced: the three gaps came out 20 / 20 / 8. Dawn's header
   `<style>` block ships `header-drawer { justify-self: start; margin-left:
   -1.2rem }`, which belongs to Dawn's header GRID - there the hamburger is a
   direct child of <header> in its own column, pulled back to sit flush with the
   gutter. In this port it is the last item of a flex row with a uniform
   `column-gap`, so `justify-self` does nothing and the -12px just ate 12 of the
   20. Removed at source in sections/header.liquid rather than overridden here.

   Two earlier guesses were wrong and are recorded so they are not retried: the
   slot does NOT inherit Dawn's 44px `.header__icon .svg-wrapper` sizing (there
   is no `.svg-wrapper` in this markup - the icon is a plain <img>), and the box
   was never mis-sized - it measured 20 / 24 / 30.5 against the cart's 20 / 24 /
   30.5 at the three bands.

   What IS kept below is the one real robustness gap found on the way: the slot
   is a flex child with no width and the default `flex-shrink: 1`, so it is the
   only item in the row that can give way when space runs short.
============================================================================ */
.ragazzi-header .ragazzi-header__icons > header-drawer {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

/* ============================================================================
   DRAWER OPEN STATE — three rules, and deliberately NOT numbered into the
   ADAPTATION list above. That list reconciles this port with Dawn's rendering
   of the CLOSED header, it is at the dozen the file header calls the rebuild
   signal, and none of what follows is a specificity fight with Dawn: the design
   simply never drew an open drawer ("Figma's mobile layer has a hamburger and
   no open state anywhere on the canvas"), so this is the open state being
   specified for the first time, on the user's instruction.
============================================================================ */

/* A. UNDO DAWN'S SCROLL LOCK. `MenuDrawer.openMenuDrawer` puts
      `overflow-hidden-tablet` on <body>, and base.css turns that into
      `overflow: hidden`. Measured at 390px: opening the menu at scroll 500 threw
      the page to 0 and closing did not restore it — the reported "it scrolls".
      `hidden` is also what ragazzi-base.css §4 forbids outright, because it
      makes body a scroll container and kills sticky.

      The class is not stopped from being added — Dawn's open/close logic stays
      exactly as it is — only its effect is cancelled, and cancelled back to the
      document-level values ragazzi-base.css sets rather than to a blanket
      `visible`, which would drop the `overflow-x: clip` guarantee with it.
      `clip` + `visible` is the one pair that does not force a scroll container,
      which is the whole reason base uses `clip`.

      The lock itself moved to ragazzi-header-drawer.js, which refuses the
      scroll events instead of moving the document.                            */
body.overflow-hidden-mobile,
body.overflow-hidden-tablet,
body.overflow-hidden-desktop {
  overflow-x: clip;
  overflow-y: visible;
}

/* B. THE BAR IS DRAWN ON TOP OF THE FULL-SCREEN PANEL.

      Dawn's panel is `position: fixed; inset: 0` at `--z-drawer`, and the header
      is `position: relative` with no z-index of its own, so the black panel
      painted straight over it — measured with `elementFromPoint` at the logo,
      the topmost element was the panel. That is the reported "the header
      disappears".

      TWO WRONG ANSWERS WERE TRIED FIRST, both measured, both recorded so they
      are not tried again:

        1. Raise `.shopify-section-group-header-group` above `--z-drawer`. Does
           nothing: THE PANEL IS INSIDE THAT GROUP, so lifting the group lifts
           the panel with it and the two never change places. Forcing the group
           to `position: static` to escape that is worse — it destroys the
           stacking Dawn gives the header and the hero photo, which is pulled up
           under the bar, comes out on top of the logo.
        2. Push the panel down to start below the bar. It shipped, and it was
           right that the bar stayed — but the header is TRANSPARENT over the
           hero, so the result was a slice of hero photo across the top with the
           menu beginning under it. Correctly rejected as looking broken.

      What works is neither ancestor nor panel but the panel's SIBLINGS. The
      logo, the icon row and the hamburger's own `summary` all share a stacking
      context with `.menu-drawer`, so giving them one step above `--z-drawer`
      puts them over the black without moving anything. `header-drawer` itself is
      excluded on purpose: it CONTAINS the panel, so raising it would take the
      panel up too — only the `summary` inside it goes up.

      The ticker is raised the same way. It sits in a different section group,
      outside `.ragazzi-header`, which is why `--z-drawer` has to be readable
      from `:root` — see the note beside it in ragazzi-tokens.css.

      `--rz-drawer-top` (the bar's real bottom, published by
      ragazzi-header-drawer.js) then keeps the menu's first link clear of the
      bar. It cannot be written in CSS: the distance depends on where the page
      was scrolled when the menu opened.                                        */
body.rz-drawer-open .ragazzi-header__bar .header__heading,
body.rz-drawer-open .ragazzi-header__icons > *:not(header-drawer),
body.rz-drawer-open .ragazzi-header__icons > header-drawer > details > summary,
body.rz-drawer-open .ragazzi-utility-bar {
  position: relative;
  z-index: calc(var(--z-drawer) + 1);
}

body.rz-drawer-open .ragazzi-header__drawer-panel {
  padding-block-start: calc(var(--rz-drawer-top, 0px) + var(--sp-nav-pad-y));
}

/* C. THE HAMBURGER BECOMES A CLOSE CROSS.
      There is no close glyph in the design — the earlier note in this file
      ("there is no close glyph in the design — the hamburger toggles the
      `<details>`") recorded that as a reason not to invent one. It is now asked
      for, so it is drawn rather than shipped as a raster: two bars of the icon's
      own weight, which needs no new asset and no second file to keep in sync
      with the hamburger's size.

      COLOUR IS STATED, NOT INHERITED. The hamburger is a white PNG that the
      light header flips with `filter: invert(1)`; a `currentColor` cross would
      follow the text colour instead and could disagree with the icon beside it.
      Declaring it mirrors the image's own two states exactly.

      THE ARMS ARE sqrt(2) OF THE BOX because a bar rotated 45 degrees spans only
      1/sqrt(2) of its length on each axis: at 100% the cross would measure 14.1px
      against the hamburger's 20 and read as the smaller icon. At 141.4% the two
      match corner to corner.                                                   */
.ragazzi-header {
  --rz-close-color: var(--color-white);
}

.ragazzi-header--light {
  --rz-close-color: var(--color-black);
}

.ragazzi-header .menu-drawer-container[open] > summary > span {
  position: relative;
}

.ragazzi-header .menu-drawer-container[open] > summary > span > img {
  /* `visibility`, not `display`: the image keeps the box that sizes the span. */
  visibility: hidden;
}

.ragazzi-header .menu-drawer-container[open] > summary > span::before,
.ragazzi-header .menu-drawer-container[open] > summary > span::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 141.4%;
  height: max(1.5px, calc(var(--size-icon-nav) * 0.1));
  border-radius: 1px;
  background: var(--rz-close-color);
}

.ragazzi-header .menu-drawer-container[open] > summary > span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ragazzi-header .menu-drawer-container[open] > summary > span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* D. THE LIGHT HEADER GOES DARK WHILE THE MENU IS OPEN.
      Rule B lifts the bar over the black panel, but on a `--light` page (every
      page without a hero photo, the serum page included) the bar's art is the
      black variant: inverted PNG icons, a black logo, a black close cross. Over
      the black panel all of it vanished and only the cart count's disc showed -
      the reported "the menu loses its header". While the drawer is open the
      bar takes the overlay header's white art instead, the same pair rule C
      already declares for the cross. */
body.rz-drawer-open .ragazzi-header--light {
  --rz-close-color: var(--color-white);
}

body.rz-drawer-open .ragazzi-header--light .ragazzi-header__logo,
body.rz-drawer-open .ragazzi-header--light .ragazzi-header__icons .header__icon,
body.rz-drawer-open .ragazzi-header--light .ragazzi-header__icons .search__button {
  color: var(--color-white);
}

body.rz-drawer-open .ragazzi-header--light .ragazzi-header__icon img {
  filter: none;
}

body.rz-drawer-open .ragazzi-header.ragazzi-header--light .cart-count-bubble {
  background: var(--color-white);
  color: var(--color-black);
}

/* Rule B lifts `.header__heading`, but this header renders the logo as a bare
   link straight inside the bar - there is no `.header__heading` around it - so
   the logo stayed under the panel on every page. */
body.rz-drawer-open .ragazzi-header__bar > .ragazzi-header__logo {
  position: relative;
  z-index: calc(var(--z-drawer) + 1);
}
