/* ==========================================================================
   SITE HEADER (CVI §7, §8, §18)
   --------------------------------------------------------------------------
   Mobile-first. Below 1024px the primary nav and the utility links collapse
   into a drawer (the utility bar itself, with the tagline, shows from 700px);
   at 1024px the utility links return (CVI §18), and at 1280px the full
   primary nav replaces the drawer (see PRIMARY NAV for why not lower).

   All colour, type, spacing, radius, shadow and transition values come from
   settings/tokens.css. The one local custom property below is a layout
   measurement, not a design token — the drawer has to begin exactly where the
   main bar ends, and nothing outside this component needs the value.

   Note on `hidden`: several elements here are toggled with the HTML `hidden`
   attribute, which removes them from the accessibility tree and the tab order.
   Because this file gives those elements a `display` value, each one must
   restore `display: none` for `[hidden]` explicitly — an author `display` rule
   otherwise overrides the user-agent default and the attribute stops working.
   ========================================================================== */

.site-header {
	/* Height of the main bar (CVI §7.2). Drives the drawer's offset. */
	--site-header-main-height: 80px;

	/*
	 * The <header> deliberately generates no box of its own.
	 *
	 * A sticky element can only travel inside its parent's box. With <header>
	 * boxed, .site-header__main sits flush against its bottom edge and has zero
	 * travel available — it would scroll away with the page and never pin.
	 * display: contents promotes both bars to body-level boxes, so the main bar
	 * sticks against the full page height while the utility bar scrolls off
	 * normally above it.
	 *
	 * Preferred over pinning the whole header at a negative top offset, which
	 * would need the utility bar's exact height as a magic number and would
	 * silently misalign if that bar ever grew.
	 *
	 * The element stays in the DOM and the accessibility tree, so the banner
	 * landmark and the .is-scrolled hook below are unaffected.
	 */
	display: contents;
}

/* Only the main bar is sticky. The utility bar above it scrolls away with the
   page, so just ~81px of viewport is permanently occupied rather than ~122px —
   which matters most on phones.

   position: sticky keeps the bar in normal flow, so nothing below it moves when
   it pins; there is no content jump and no placeholder height to compensate. */
.site-header__main {
	position: sticky;
	top: 0;
	z-index: 100;
	transition: box-shadow var(--transition-base);
}

/* Scroll state — the divider is drawn at rest, as the design draws it; once the
   bar is pinned over moving content it also casts the theme's smallest shadow,
   so it reads as lifted off what scrolls beneath it. No size, colour or padding
   change, so pinning cannot shift the page. The class is set on the header
   element by header.js. */
.site-header.is-scrolled .site-header__main {
	box-shadow: var(--shadow-sm);
}

/* The admin bar is fixed at 783px and up, so a bar pinned to 0 would slide
   underneath it. Below that width the admin bar scrolls away with the page and
   needs no offset. */
@media (min-width: 783px) {

	.admin-bar .site-header__main {
		top: 32px;
	}
}

/* --------------------------------------------------------------------------
   ANNOUNCEMENT STRIP (inc/promo-strip.php)

   The free-delivery line, above the utility bar, on every width — the one
   header row phones keep besides the main bar. Burgundy with cream type
   (--color-primary-dark on --color-on-dark, 11:1), the brand's own reds
   rather than the old site's bright one. Inter, the CVI's face for small
   utility text, 12px (13px from 768) on a 15px line: one line from ~560px, a
   balanced two on narrower phones, never more.

   Not sticky: like the utility bar it scrolls away, so the pinned bar stays
   81px and every offset measured from .site-header__main (checkout focus,
   catalogue results, product buy bar, drawer) is unchanged. The only fixed
   figure that knows the rows above the bar is the mega panel's height budget,
   adjusted below.
   -------------------------------------------------------------------------- */

.site-header__announce {
	background-color: var(--color-primary-dark);
	color: var(--color-on-dark);
}

/* 32px on one line (min-height); 40px when the text takes two lines on a
   phone (2 x 15 + 2 x 5), 8px less of the first screen than 2 x 16 + 2 x 8.
   One line at >= 11px is not possible below ~560px: the sentence needs
   ~400px at 11px and a 375px phone leaves 327 (QA D2 O1). */
.site-header__announce-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding-block: 5px;
}

.site-header__announce-text {
	font-family: var(--font-meta);
	font-weight: 500;
	font-size: 12px;
	line-height: 15px;
	letter-spacing: 0.02em;
	text-align: center;
	text-wrap: balance;
}

.site-header__announce-link {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.site-header__announce-link:hover {
	text-decoration-thickness: 2px;
}

.site-header__announce-link:focus-visible {
	outline-color: var(--color-on-dark);
}

@media (min-width: 768px) {

	.site-header__announce-text {
		font-size: 13px;
	}
}

/*
 * mega-menu.css budgets a panel's scroller as the viewport minus the 121px of
 * header above it (utility 41 + bar 80). With the strip on, the panel of a
 * page at the top starts 32px lower; without this its last links could sit
 * under the fold of a short laptop window. Panels exist from 1280 only, where
 * the strip is always one 32px line.
 */
.site-header--announce {
	--header-search-offset: 153px;
}

/*
 * The strip's height for layouts outside the header that budget the first
 * screen (QA D2 F4: the homepage hero on short laptop windows). They read it
 * as var(--site-announce-h, 0px), so with the strip off nothing changes.
 * 32px: the strip is one line wherever those budgets apply (1024 and up).
 */
.has-announce-strip {
	--site-announce-h: 32px;
}

/* --------------------------------------------------------------------------
   UTILITY BAR (§7.1)

   Always rendered — it carries the standing tagline "Hea maitse liidab", which
   is not dependent on any menu. The utility nav inside it is still conditional
   on a menu being assigned, and per §18 that nav collapses into the drawer
   below 1024px while the tagline stays.

   Restored 04.11.2026 exactly as it was before 9263804 (client: the tagline
   back in the upper strip together with the full logo): the same 40px bar, the
   tagline on the left in Libre Caslon italic, the links on the right from
   1024, the bar itself from 700. The menu changes of 9263804 are untouched.
   -------------------------------------------------------------------------- */

.site-header__utility {
	background-color: var(--color-surface-light);
	border-bottom: 1px solid var(--color-border-nav);
}

/*
 * Phones and tablets: no utility strip. Diana's phone mockups (usertest 31.10,
 * p.7 product page and Lisa 1 menu) draw the header without it, and its 32px
 * kept the product page's buy row and the menu's last category off the first
 * screen (audit 01.11, client decision 02.11). Its links are in the drawer
 * below 1024px; the tagline that kept it standing from 700px is gone (client
 * 16.11.2026: the logo already says "Hea maitse liidab"), so an empty bar
 * would be all that was left.
 */
@media (max-width: 1023px) {

	.site-header__utility {
		display: none;
	}
}

.site-header__utility-inner {
	display: flex;
	align-items: center;
	/* Links only since 16.11.2026 (no tagline on the left): they keep the
	   right-hand end they had beside it. */
	justify-content: flex-end;
	gap: var(--space-md);
	min-height: 40px;
}

/* Holds the utility nav and, later, the language switcher.

   §18 — this whole group moves into the drawer below 1024px. Hiding the group
   rather than just the nav inside it matters: an empty flex item still claims
   the row's 24px gap. Shown again at 1024 (DESKTOP, below). */
.site-header__utility-end {
	display: none;
	align-items: center;
	gap: var(--space-md);
}

.site-header__utility-menu {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__utility-menu a {
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	color: var(--color-text);
	text-decoration: none;
	transition: color var(--transition-base);
}

.site-header__utility-menu a:hover {
	color: var(--color-primary);
}

.site-header__utility-menu .current-menu-item > a,
.site-header__utility-menu .is-current-section > a {
	color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   MAIN BAR (§7.2)
   -------------------------------------------------------------------------- */

.site-header__main {
	/* The rose-tinted surface, which the token itself names for the main nav bar.
	   Measured off the UI Final page frames: the two header rows read #F6F3F2 on
	   top and #F7F0EF beneath it, both exact, with the page below on cream. The
	   nav row is the tinted one and the utility row above it the lighter — not
	   the other way round.

	   This previously carried cream at 95%, taken from the Header component on
	   the Styles page. That component is a stale copy: its nav row composites to
	   cream-over-canvas, which lands within a point of the page background, so
	   live the tint read as sitting on the utility row alone and the nav row
	   vanished into the page. The page frames are the authority for geometry.

	   Opaque, so the sticky bar never shows page content through itself. No
	   backdrop-filter either — a blur behind a sticky element makes the
	   compositor re-blur the strip behind it on every scroll frame, and against
	   a near-solid ground there is nothing there to see. */
	background-color: var(--color-surface-rose);
	/*
	 * The design's divider under the bar is a rose hairline, and it is there at
	 * the top of the page too: measured at ~300% on the homepage and Vein frames,
	 * the bar's foot reads #E9CAC5 over ~1.7px — rose at about three quarters —
	 * directly above the hero photograph. The 10% nav tint this once used was
	 * all but invisible, which is why the only line anyone saw here was the
	 * cream stripe the collapsed mega menu panels painted over it (see
	 * mega-menu.css).
	 *
	 * Solid rose, the next step, carried the frame's ink but read as a hard
	 * edge live: a crisp 1px rule has no antialiasing to soften it the way the
	 * design's ~1.7px blur does. The client asked for it lighter, kept. It takes
	 * the section-divider token — rose at 30% — so the header's line is the same
	 * weight as every other divider on the site rather than a value of its own.
	 */
	border-bottom: 1px solid var(--color-border);
}

/* Flex with space-between rather than a fixed grid: with no primary menu
   assigned the nav element is not rendered at all, and this still places the
   brand left and the actions right without an empty column. */
.site-header__main-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-md);
	min-height: var(--site-header-main-height);
}

/* --------------------------------------------------------------------------
   BRAND
   -------------------------------------------------------------------------- */

.site-header__brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.site-header__brand .custom-logo {
	/*
	 * The full lockup — mark, wordmark, "Est. 1994", "Hea maitse liidab" — the
	 * same artwork as the footer (client, 3.11.2026 p1). §7.2's 40px was for
	 * the mark and wordmark alone; the lockup is 1.77:1.
	 *
	 * 72px, 127 wide: the wordmark is back to within 3px of the 130 it had
	 * before the lockup (at 64 it was 113), and the lockup still sits in the
	 * unchanged 80px bar with 4px above and below. 76px would have needed an
	 * 88px bar — 8px more of every short screen held by the sticky bar, which
	 * is the client's other complaint (p11) — for 7px more width. "EST. 1994"
	 * is 4.5px tall here: readable on a 2x screen, not on a 1x one at any of
	 * the three sizes compared (fe-a1 logo study, 3.11.2026). Phones keep 64,
	 * see below.
	 */
	height: 72px;
	width: auto;
}

.site-header__brand .custom-logo-link {
	display: block;
	line-height: 0;
}

/* Placeholder shown until a logo is uploaded. Deliberately plain text — it is
   the site name, not a stand-in for the Avallone mark. */
.site-header__brand-fallback {
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 18px;
	line-height: 24px;
	color: var(--color-ink);
	text-decoration: none;
	transition: color var(--transition-base);
}

.site-header__brand-fallback:hover {
	color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   PRIMARY NAV (§7.2)
   -------------------------------------------------------------------------- */

.site-header__nav {
	display: none;
	flex: 1 1 auto;
	/* Allows the nav to shrink inside the flex row instead of forcing the
	   header wider than the container. */
	min-width: 0;
	justify-content: center;
}

/* §7.2's 24px between items; the nav is only shown from 1280 (below). */
.site-header__menu {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Direct children only: each item may now contain a mega menu panel, and the
   links inside that panel are not nav items. */
.site-header__menu > li > a {
	display: block;
	/* 8px top balances the 6px padding + 2px active border below, so the label
	   stays optically centred whether or not the item is current. */
	padding-top: 8px;
	padding-bottom: 6px;
	border-bottom: 2px solid transparent;
	/*
	 * Capitals, small and tracked, as the reference header draws its labels
	 * (client, 3.11.2026 p2: "trükitähtedega", every category on one line).
	 * The capitals come from here, not the menu: the labels stay sentence
	 * case in Välimus > Menüüd, which screen readers read as words rather
	 * than spelling them out.
	 *
	 * 12px caps stand as tall as the 14px lower case they replace. The size
	 * steps up with the room (below). Measured, the seven labels set at
	 * 12px/0.06em take 621–628px (Firefox/WebKit–Chromium), at 13px 670–681
	 * and at 14px 709–724; with six 24px gaps they need 772, 825 and 853 of
	 * the 801, 887 and 961 the bar leaves between logo and icons at 1280, 1366
	 * and 1440 — one row, never wrapped, every gap at least 24.
	 */
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 12px;
	line-height: 20px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-text);
	text-decoration: none;
	white-space: nowrap;
	transition:
		color var(--transition-base),
		border-color var(--transition-base);
}

.site-header__menu > li > a:hover {
	color: var(--color-primary);
}

.site-header__menu .current-menu-item > a,
.site-header__menu .current-menu-parent > a,
.site-header__menu .current-menu-ancestor > a,
.site-header__menu .current_page_item > a,
.site-header__menu .current_page_parent > a {
	color: var(--color-primary-dark);
	border-bottom-color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   ACTIONS (§7.2)

   Each action is a 44px target for touch, and the CVI's 24px measures
   icon-to-icon, not box-to-box. Measured off the Top Navigation Bar frame the
   design sets the icons 24.7px apart, which agrees with the CVI.

   The gap is therefore zero. The 44px boxes already carry 13px and 14px of
   padding around the 18px and 16px icons, so touching boxes put the ink 26-27px
   apart — as close to 24.7 as this can get while every target stays 44px. An
   8px gap here was pushing them to 34px, a third wider than the design, for no
   accessibility gain: the targets are 44px either way, and hover is a colour
   change with no background, so adjacent boxes are invisible.
   -------------------------------------------------------------------------- */

.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0;
	flex: 0 0 auto;
}

.site-header__action {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	color: var(--color-text);
	text-decoration: none;
	cursor: pointer;
	transition: color var(--transition-base);
}

/* Pointer hover only. On a touchscreen :hover latches after a tap, which left
   the search control red after search mode had closed — reading as still open. */
@media (hover: hover) {

	.site-header__action:hover {
		color: var(--color-primary);
	}
}

/* The account link is in the bar at every width, as on desktop: search,
   wishlist, account, cart and the menu (usertest 31.10, finding 6). It used to
   live only at the foot of the phone drawer. Search stays in the bar too:
   search mode is the same page on a phone as on a desktop. */

/* Cart badge (§7.2) — 16px circle, offset over the icon's top-right corner. */
/* The wishlist's saved count wears the same badge. */
.site-header__cart-count,
.site-header__wishlist-count {
	position: absolute;
	top: 6px;
	right: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: var(--radius-pill);
	background-color: var(--color-primary-dark);
	color: var(--color-on-dark-pure);
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 10px;
	line-height: 1;
}

.site-header__cart-count[hidden],
.site-header__wishlist-count[hidden] {
	display: none;
}

/*
 * The heart is the product page's own "Salvesta" mark exported from UI Final —
 * the same family as the search, account and cart glyphs beside it: a filled
 * outline, not a stroked line. Drawn 20 wide, where that family's heart sits on
 * the grid the 20px cart does, its outline comes out at 2px like theirs. The
 * library heart it replaces was a 1.5 stroke on a 24 grid, ~1.25px at this size,
 * and read a weight lighter than its neighbours. On its own page it stays in
 * primary red, as the search control does while search is open.
 */
.site-header__action--wishlist[aria-current='page'] {
	color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   HAMBURGER
   -------------------------------------------------------------------------- */

.site-header__burger-icon {
	display: inline-flex;
}

.site-header__burger-icon[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   SEARCH FORM
   The field itself inherits its border, radius, padding and focus ring from
   components/forms.css. Only the trailing submit button is added here.
   -------------------------------------------------------------------------- */

.header-search {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

/* Two classes so this reliably beats the `input[type='search']` selector in
   components/forms.css, which sets the padding shorthand. */
.header-search .header-search__field {
	padding-right: 52px;
}

.header-search__submit {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	color: var(--color-text);
	cursor: pointer;
	transition: color var(--transition-base);
}

.header-search__submit:hover {
	color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   MOBILE DRAWER

   Positioned against .site-header__main (top: 100%) rather than at a fixed
   viewport offset. That bar is the sticky one, so the drawer tracks it — it
   opens directly beneath the main nav whether the utility bar is still on
   screen or has scrolled away, and it stays correct when the WordPress admin
   bar shifts the header down. A hardcoded top offset does none of that.

   100dvh so mobile browser chrome does not clip the bottom.
   -------------------------------------------------------------------------- */

.site-header__drawer {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	display: block;
	/* 100% is the header's own height, so this stays exact including its
	   bottom border — and self-corrects if the header height ever changes.
	   While open, header.js passes the panel's real distance from the top of
	   the screen (--drawer-offset, which includes the utility bar when it is
	   still in view), and the panel fills the screen to its foot: the cream
	   covers the page as in Lisa 1 instead of stopping under the last row with
	   the undimmed page showing below (final QA 01.11, V04). */
	height: calc(100dvh - var(--drawer-offset, 100%));
	max-height: calc(100dvh - var(--drawer-offset, 100%));
	overflow-y: auto;
	overscroll-behavior: contain;
	background-color: var(--color-cream);
	opacity: 1;
	transition:
		opacity var(--transition-base),
		display var(--transition-base) allow-discrete;
}

.site-header__drawer[hidden] {
	display: none;
	opacity: 0;
}

/* header.js moves focus here when the drawer opens, so screen readers land
   inside the panel rather than back at the top of the document. The panel is a
   scripted focus target (tabindex="-1"), not a control a user can tab to, so
   the global :focus-visible ring would draw a 2px red outline around the whole
   panel for no reason. Every interactive element inside keeps its own ring. */
.site-header__drawer:focus,
.site-header__drawer:focus-visible {
	outline: none;
}

/* Fade in on open. Browsers without @starting-style simply show it instantly. */
@starting-style {
	.site-header__drawer:not([hidden]) {
		opacity: 0;
	}
}

.site-header__drawer-inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
	padding-block: var(--space-lg);
}

.site-header__drawer-menu {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Direct children only: an item may now carry a short list of the groups its
   mega menu would show on a desktop, and those are not top-level items. */
/* 20px names on 54px rows, so all eight sections fit one phone screen under
   the bar (usertest 31.10, Lisa 1); at 24px on 68px rows Veinid and Šampanjad
   were already above the screen once the list was scrolled to its end. */
.site-header__drawer-menu > li > a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var(--color-border);
	font-family: var(--font-heading);
	font-weight: 400;
	font-size: 20px;
	line-height: 30px;
	color: var(--color-ink);
	text-decoration: none;
	transition: color var(--transition-base);
}

.site-header__drawer-menu > li > a:hover {
	color: var(--color-primary);
}

.site-header__drawer-menu .current-menu-item > a,
.site-header__drawer-menu .current-menu-parent > a,
.site-header__drawer-menu .current-menu-ancestor > a,
.site-header__drawer-menu .current_page_item > a {
	color: var(--color-primary-dark);
}

/* No rule of its own: the last section's divider already closes the list,
   and a second line above the footer read as a double rule. */
.site-header__drawer-footer {
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
}

.site-header__drawer-account {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	min-height: 44px;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.05em;
	color: var(--color-text);
	text-decoration: none;
	transition: color var(--transition-base);
}

.site-header__drawer-account:hover {
	color: var(--color-primary);
}

/* The wishlist's place in the drawer, used only where the bar has no room for it
   (below 360px, see the end of this file). */
.site-header__drawer-wishlist {
	display: none;
}

/* Kokteilid, Firmast and Kontakt as full rows with a chevron, readable
   rather than a line of 12px links at the foot of the drawer (Lisa 1). */
.site-header__drawer-utility-menu {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-header__drawer-utility-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-sm);
	min-height: 48px;
	padding-block: var(--space-xs);
	border-bottom: 1px solid var(--color-border);
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 16px;
	line-height: 24px;
	color: var(--color-text);
	text-decoration: none;
	transition: color var(--transition-base);
}

.site-header__drawer-utility-menu a svg {
	flex-shrink: 0;
}

.site-header__drawer-utility-menu a:hover {
	color: var(--color-primary);
}

/* The page being read, as in the bar above (Blogi also inside an article). */
.site-header__drawer-utility-menu .current-menu-item > a,
.site-header__drawer-utility-menu .is-current-section > a {
	color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   SCROLL LOCK

   Applied to <html> by header.js while the drawer is open. --scrollbar-gap is
   measured in JS and replaces the width of the hidden scrollbar, so the header
   does not jump sideways as the drawer opens.
   -------------------------------------------------------------------------- */

.has-drawer-open {
	overflow: hidden;
	padding-right: var(--scrollbar-gap, 0px);
}

/* --------------------------------------------------------------------------
   DESKTOP (CVI §18 — full nav at >=1024px)
   -------------------------------------------------------------------------- */

/* The utility bar's own switch is at the top of this file. */
@media (min-width: 1024px) {

	.site-header__utility-end {
		display: flex;
	}

	.site-header__action--account {
		display: inline-flex;
	}
}

/*
 * The primary nav itself starts at 1280. Below it the drawer, which already
 * carries the whole menu, is the navigation, as on tablets. The seven labels
 * of 3.11.2026 at their smallest (12px, 24px gaps) need 772px and the bar has
 * 701 at 1180, so 1180 cannot hold them in one row; from ~1251 they would fit,
 * but header.js switches the panels at 1280 too, and the range in between is
 * all but unused by real screens.
 */
@media (min-width: 1280px) {

	.site-header__nav {
		display: flex;
	}

	/* The drawer and its trigger do not exist at this width. */
	.site-header__burger,
	.site-header__drawer {
		display: none;
	}
}

/*
 * Every label on one line at every width (client, 3.11.2026 p2). The two-line
 * names of 1280–1599 are gone with the break that made them; the labels grow
 * with the room instead: 13px from 1366 (62px to spare there), and from 1600,
 * where the bar is ~1,100px wide, the CVI's 14px with 32px between items so
 * the row does not huddle in the middle of a wide bar.
 */
@media (min-width: 1366px) {

	.site-header__menu > li > a {
		font-size: 13px;
	}
}

@media (min-width: 1600px) {

	.site-header__menu {
		gap: calc(var(--space-md) + var(--space-xs));
	}

	.site-header__menu > li > a {
		font-size: 14px;
	}
}

/* --------------------------------------------------------------------------
   PHONES NARROWER THAN 360px

   The logo and four 44px controls did not fit a 320px screen beside each other
   (with the 130px logo of October 2026 the burger sat 34px beyond the edge and
   the page scrolled sideways). The 44px targets stay as they are; the gap between the two groups
   tightens, the page gutter is 16px (tokens.css), and the wishlist moves into
   the drawer beside "Minu konto", which already lives there on phones.
   -------------------------------------------------------------------------- */

/*
 * Phones: five 44px controls (search, wishlist, account, cart, menu) beside the
 * logo. The bar's gutter is 16px, and the logo takes what the controls leave,
 * up to its full 113 x 64: 113 at 390 and wider, 100 x 57 at 360, 104 x 59 at
 * 320 (four controls). The tap
 * targets keep their 44px. The drawer's list lines up with the logo.
 */
@media (max-width: 479px) {

	.site-header__main-inner,
	.site-header__drawer-inner {
		padding-inline: 16px;
	}

	.site-header__main-inner {
		gap: var(--space-xs);
	}

	/* Half the tablet spacing above the list and before the secondary rows,
	   so the categories and the three links share one screen. */
	.site-header__drawer-inner {
		gap: var(--space-md);
		padding-block: var(--space-sm) var(--space-md);
	}

	/* Both auto with two caps: whichever binds first, the ratio holds. 64
	   rather than the desktop's 72: at 72 the lockup's 127px came within a
	   few pixels of the search icon at 390. */
	.site-header__brand .custom-logo {
		width: auto;
		height: auto;
		max-width: calc(100vw - 32px - 5 * 44px - var(--space-xs));
		max-height: 64px;
	}
}

@media (max-width: 359px) {

	.site-header__main-inner {
		gap: var(--space-xs);
	}

	/* Four controls here: the wishlist moves into the drawer. */
	.site-header__brand .custom-logo {
		max-width: calc(100vw - 32px - 4 * 44px - var(--space-xs));
	}

	.site-header__action--wishlist {
		display: none;
	}

	.site-header__drawer-wishlist {
		display: inline-flex;
	}
}

/* --------------------------------------------------------------------------
   PHONES ON THEIR SIDE

   Below 500px of height the pinned 81px bar (89px with its divider) held about
   a quarter of the screen. On touch devices in landscape it scrolls away with
   the page instead. While the drawer or search is open it pins again, because
   both are positioned against this bar and must open where the reader is.
   -------------------------------------------------------------------------- */

@media (orientation: landscape) and (max-height: 499px) and (hover: none) and (pointer: coarse) {

	html:not(.has-drawer-open):not(.is-search-open) .site-header__main {
		position: relative;
	}
}
