/**
 * header.css — Estelia Norway AS
 * Location: estelia-child/assets/css/header.css
 * Loads:    every page, after global.css (inc/assets.php)
 * Depends:  global.css tokens
 *           header.js  (--est-announce-h, .is-stuck, .is-scrolled,
 *                       .is-nav-open)
 *           inc/header.php (announce markup, language switcher,
 *                           search/account/cart menu items,
 *                           .est-utility-bar, body.est-header-overlay)
 *           inc/mobile-nav.php (.est-mobilenav__lang)
 *
 * Overlay hook: body.est-header-overlay ONLY. inc/header.php is the
 * single source of truth.
 *
 * GeneratePress owns .site-header, .main-navigation and .menu-toggle.
 * We restyle them, we do not replace them.
 *
 * Consolidated 1 Aug 2026: the three appended patch blocks are merged into
 * the mobile section below and the superseded rules removed. Nothing on
 * mobile is position:fixed against a JS-measured variable any more —
 * .site-header is fixed (overlay) or sticky (everything else), so it is a
 * containing block in both states and its children position absolutely
 * inside it. That is what removed the cart's lag behind the 400ms
 * transition.
 *
 * Order: 1 tokens · 2 announce · 3 header · 4 wordmark · 5 nav · 6 cart
 *        6b language switcher · 7 overlay · 8 tablet · 9 mobile ·
 *        10 small phones · 11 motion
 */

/* ========================================================================
   1. TOKEN FALLBACKS
   Delete once the tokens are locked in global.css.
   ======================================================================== */

:root {
	--est-step--2: clamp(0.625rem, 0.6rem + 0.15vw, 0.6875rem);
	--est-tracking-eyebrow: 0.12em;
	--est-dur-fast: 200ms;

	/* Mobile bar height. Declared, not measured: the burger, the cart and
	   the panel all anchor to it, so it must be a known number rather than
	   whatever the content happens to produce. */
	--est-bar-h: 3.5rem;
}

/* ========================================================================
   2. ANNOUNCEMENT BAR
   Static, centred row of trust items — no motion.
   Height is published to JS as --est-announce-h by header.js.
   ======================================================================== */

.est-announce {
	position: relative;
	/* Neither header state (sticky top:0, or fixed offset by --est-announce-h
	   in overlay mode) ever actually overlaps this bar in normal layout — so
	   this only has to outrank .site-header's z-index (100) for the one case
	   that does overlap: the language switcher's hover dropdown, which
	   extends past this bar's own box into the header's row. */
	z-index: 110;
	background-color: var(--est-beige, #EFE7DA);
	color: var(--est-ink);
}

/* Same container + edge padding as .inside-header below it, so the row's
   text and the language switcher line up with the logo and the cart icon
   instead of floating loose against the viewport edge. */
.est-announce__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--est-space-l);
	max-width: var(--est-container, 1280px);
	margin-inline: auto;
	padding-inline: 30px;
	padding-block: .5rem;
}

.est-announce__lang {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.est-announce__lang .trp-shortcode-switcher__wrapper {
	display: flex;
	align-items: center;
	/* Match the announcement bar's own type/color instead of TranslatePress's
	   defaults, and shrink the flag so its height lines up with the code
	   label next to it. */
	--flag-size: 16px !important;
	--font-size: var(--est-step--2) !important;
	--text: var(--est-ink) !important;
	--text-hover: var(--est-ink) !important;
}

.est-announce__lang .trp-language-item-name {
	font-family: inherit;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: var(--est-tracking-eyebrow);
	/* .trp-language-item-name is a flex item with white-space:nowrap +
	   overflow:hidden (TRP's own CSS) — a flex item's automatic minimum
	   size is 0 whenever overflow isn't visible, so without this it's free
	   to collapse to ~1px instead of sizing to its own text. Only actually
	   observed on the interactive overlay copy (not the inert anchor copy
	   that holds layout space) — same markup, so pin both defensively. */
	min-width: max-content;
}

/* TranslatePress's own V2 switcher ships a white chip (--bg:#ffffff inline
   custom prop, ~55px tall from its own padding) — on the beige bar that
   reads as a mismatched box, and its extra height was inflating the whole
   announce row past the height of its actual content. Strip it down to
   flag+chevron only. */
.est-announce__lang .trp-language-switcher,
.est-announce__lang .trp-language-item,
.est-announce__lang .trp-current-language-item__wrapper {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

.est-announce__lang .trp-language-switcher {
	height: auto !important;
	padding: 0 !important;
}

/* Only the trigger (current-language) item, not the dropdown-list items —
   those keep TRP's own padding/hover below. TRP renders the trigger as an
   <a> on the inert in-flow "anchor" copy but as a <div role="button"> on
   the interactive "overlay" copy actually shown to the user (see
   shortcode-switcher.php: $as_control makes it a div) — a tag-qualified
   `a.trp-language-item` selector here only ever matched the anchor, so the
   overlay kept TRP's default 7px/16px padding + 19px min-height. That
   mismatch (33px-tall overlay vs 20px-tall anchor) is what made the
   flag/code visibly sit lower than the rest of the announcement bar. */
.est-announce__lang .trp-language-item.trp-language-item__current {
	padding: 0 !important;
	min-height: 0 !important;
}

/* Belt-and-suspenders: even with both copies now the same height, center
   the interactive overlay on the wrapper directly instead of trusting its
   top:0 to line up with the inert anchor's box. */
.est-announce__lang .trp-shortcode-overlay {
	top: 50%;
	transform: translateY(-50%);
	/* TRP's own `.trp-shortcode-switcher{overflow:hidden}` (meant to clip an
	   alternate, non-dropdown layout of this same component) also clips
	   whatever we position outside its box below — needed once the dropdown
	   list is taken out of flow, see .trp-switcher-dropdown-list. */
	overflow: visible;
}

/* .trp-current-language-item__wrapper ships `justify-content:space-between;
   padding-right:10px` (meant to push the arrow to the far edge of a wider,
   fixed-width chip) — against our now-compact, content-sized chip that
   just starves the arrow: browsers were shrinking the 20x20 svg down to
   ~4x4 (reads as a stray dot next to the code label) to make the sums
   fit. Swap to a tight flex row with a small fixed gap instead, and pin
   the arrow's own box so it can never be a shrink target. */
.est-announce__lang .trp-current-language-item__wrapper {
	gap: var(--est-space-2xs);
	padding-right: 0;
	justify-content: flex-start;
}

.est-announce__lang .trp-shortcode-arrow {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
}

/* TRP renders this list as a normal in-flow flex child of the overlay, so
   opening it (max-height 0 → content height) grows the OVERLAY's own box —
   and since the overlay is vertically re-centered via top:50%/translateY(-50%)
   above, centering a taller box on open shifts the whole flag+code+arrow row
   upward too ("jumps up" on hover) and lets the list's growing bottom edge
   sink into the white header row underneath. Taking it out of flow entirely
   fixes both: the overlay's own height (and therefore its centering) is
   always just the closed row's height, and the list floats below it like an
   ordinary dropdown instead of pushing the layout around it. */
.est-announce__lang .trp-switcher-dropdown-list {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
}

/* Same card look as the desktop nav's own submenus (§ "Submenus
   (Collections)" above), for one consistent dropdown style site-wide
   instead of TRP's bare unstyled list. Scoped to :not([hidden]) — TRP clips
   the closed state to max-height:0, but a border still paints as a visible
   hairline (and padding a sliver of background) on a 0-height box, so
   applying these unconditionally left a stray pale rectangle sitting next
   to the flag even while closed. */
.est-announce__lang .trp-switcher-dropdown-list:not([hidden]) {
	margin-block-start: var(--est-space-2xs);
	padding-block: var(--est-space-2xs);
	background-color: var(--est-bg);
	border: 1px solid var(--est-line);
}

.est-announce__lang .trp-switcher-dropdown-list .trp-language-item {
	padding: var(--est-space-2xs) var(--est-space-m) !important;
	gap: var(--est-space-2xs);
}

.est-announce__lang .trp-switcher-dropdown-list .trp-language-item:hover {
	background-color: var(--est-surface) !important;
}

@media (max-width: 47.999em) {

	.est-announce__lang {
		display: none; /* the mobile panel carries its own copy */
	}

	/* Four items on a phone stack into four lines, roughly 200px of beige
	   above every page — and, because the mobile nav panel reserves the
	   bar's height at its top, 200px of dead space above the menu too.
	   Only the free-shipping threshold earns that room; the rest are on the
	   product and checkout pages where they matter. */
	.est-announce__item:not(:first-child) {
		display: none;
	}

	/* No lang switcher to balance on mobile — centre the single item instead
	   of left-aligning it against a now-empty right side. */
	.est-announce__row {
		justify-content: center;
	}
}

.est-announce__row {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
	padding-block: var(--est-space-xs);
}

.est-announce__item {
	display: flex;
	align-items: center;
	gap: var(--est-space-2xs);
	white-space: nowrap;
	padding-inline-start: var(--est-space-l);
	font-size: var(--est-step--2);
	font-weight: 500;
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: var(--est-tracking-eyebrow);
}

.est-announce__item:first-child {
	padding-inline-start: 0;
}

.est-announce__item svg {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

/* Dot separators dropped — each item already carries its own icon, which
   already reads as the visual break between items; the dots on top just
   added noise. */

/* ========================================================================
   3. STICKY SITE HEADER — default, non-overlay pages
   ======================================================================== */

.site-header {
	position: sticky;
	inset-block-start: 0;
	z-index: 100;
	background-color: var(--est-bg);
	border-block-end: 1px solid transparent;
	transition:
		border-color var(--est-dur-fast) var(--est-ease),
		transform var(--est-dur-fast) var(--est-ease);
}

.site-header.is-scrolled {
	border-block-end-color: var(--est-line);
}

/* Hide-on-scroll-down / reveal-on-scroll-up, header.js §6. Shared by both
   the sticky (here) and fixed overlay variants — transform works the
   same regardless of which positioning scheme is pinning the header. */
.site-header.is-hidden {
	transform: translateY(-100%);
}

.site-header .inside-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--est-space-l);
	width: 100%;
	max-width: var(--est-container, 1280px);
	margin-inline: auto;
	padding-block: var(--est-space-s);
	/* Extra breathing room off the beige announce bar above, so the two
	   rows read as visually separate rather than touching. */
	padding-block-start: calc(var(--est-space-s) + 30px);
	padding-inline: 30px;
}

/* ========================================================================
   4. WORDMARK
   ======================================================================== */

.site-header .site-branding,
.site-header .site-logo {
	flex: 0 0 auto;
}

.site-header .main-title {
	margin: 0;
	font-family: var(--est-font-display);
	font-size: var(--est-step-1);
	font-weight: 600px;
	line-height: 1;
	letter-spacing: 0.01em;
}

.site-header .main-title a {
	text-decoration: none;
	color: var(--est-ink);
}

.site-header .site-description {
	display: none; /* tagline lives in the hero */
}

.site-header .site-logo,
.site-header .custom-logo-link {
	display: flex;
	align-items: center;
}

.site-header .site-logo img,
.site-header .custom-logo {
	height: 4.125rem;
	width: auto;
	max-width: 18rem;
	object-fit: contain;
}

/* ========================================================================
   5. PRIMARY NAVIGATION
   ======================================================================== */

.main-navigation {
	background-color: transparent;
	flex: 1 1 auto;
	/* Breathing room off the logo — without it the first menu link sits
	   right against the wordmark. !important: GeneratePress's own
	   .nav-float-right #site-navigation{margin-left:auto} carries an ID and
	   otherwise wins outright, collapsing this to 0 (its flex:1 1 auto above
	   already claims all free space via grow, leaving auto-margin nothing
	   left to distribute). */
	margin-inline-start: 100px !important;
}

.main-navigation .inside-navigation {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 0;
}

/* .main-nav itself is a flex item of .inside-navigation with no flex-grow,
   so by default it shrinks to its content width and leaves the rest of the
   row empty. Stretch it so its child <ul> has the full row width to work
   with — otherwise the auto margin below (§ est-search-item) only pushes
   search/account/cart to the edge of the ul's own undersized box, not the
   header row's real right edge. */
.main-navigation .main-nav {
	flex: 1 1 auto;
}

.main-navigation .main-nav > ul {
	display: flex;
	align-items: center !important;
	gap: var(--est-space-l);
}

.main-navigation .main-nav > ul > li {
	display: flex;
	align-items: center;
}

.main-navigation .main-nav ul li a {
	display: flex;
	align-items: center;
	padding: var(--est-space-xs) 0;
	font-family: var(--est-font-body);
	font-size: var(--est-step--1);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--est-ink);
}

/* Underline grows from the left. No layout shift. */
.main-navigation .main-nav ul li > a {
	position: relative;
}

.main-navigation .main-nav ul li > a::after {
	content: '';
	position: absolute;
	inset-block-end: 0;
	inset-inline-start: 0;
	width: 100%;
	height: 1px;
	background-color: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--est-dur-fast) var(--est-ease);
}

.main-navigation .main-nav ul li > a:hover::after,
.main-navigation .main-nav ul li > a:focus-visible::after,
.main-navigation .main-nav ul li.current-menu-item > a::after,
.main-navigation .main-nav ul li.current-menu-parent > a::after,
.main-navigation .main-nav ul li.current-menu-ancestor > a::after,
.main-navigation .main-nav ul li.current_page_parent > a::after,
.main-navigation .main-nav ul li.current_page_ancestor > a::after {
	transform: scaleX(1);
}

.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li.current-menu-parent > a,
.main-navigation .main-nav ul li.current-menu-ancestor > a,
.main-navigation .main-nav ul li.current_page_parent > a,
.main-navigation .main-nav ul li.current_page_ancestor > a {
	background-color: transparent;
	color: var(--est-ink);
}

/* --- Submenus (Collections) --- */

.main-navigation ul ul {
	min-width: 13rem;
	padding: var(--est-space-s) 0;
	background-color: var(--est-bg);
	border: 1px solid var(--est-line);
	box-shadow: none;
}

.main-navigation ul ul li {
	display: block;
}

.main-navigation ul ul li a {
	padding-inline: var(--est-space-m);
	text-transform: none;
	letter-spacing: 0;
}

.main-navigation ul ul li > a::after {
	display: none;
}

.main-navigation ul ul li:hover > a {
	background-color: var(--est-surface);
}

/* ========================================================================
   6. CART
   Two render points, one shared link markup (inc/header.php):
     desktop — <li class="menu-item est-cart"> appended to the primary menu
     mobile  — <div class="est-cart-bar"> inside .inside-header
   The bar copy is hidden above 48em, the menu item below it.
   ======================================================================== */

/* Local copy of the visually-hidden utility. Without it the "Cart, 1 item"
   label takes real width and pushes the badge onto a second line. */
.est-cart .est-visually-hidden,
.est-cart-bar .est-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.est-cart {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.main-navigation .main-nav > ul > li.est-cart,
.main-navigation .main-nav > ul > li.est-search-item,
.main-navigation .main-nav > ul > li.est-account-item {
	display: flex;
	align-items: center;
}

/* Text links stay grouped next to the logo; this auto margin pushes
   search/account/cart to the far right of the nav row instead. */
.main-navigation .main-nav > ul > li.est-search-item {
	margin-inline-start: auto;
}

.main-navigation .main-nav ul li.est-cart > a,
.main-navigation .main-nav ul li.est-account-item > a {
	padding: 0;
	line-height: 1;
}

/* Mobile-only control. The mobile block below switches it on. */
.est-utility-bar {
	display: none;
	align-items: center;
}

.est-cart__link {
	position: relative;
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;        /* 44px tap target */
	margin-block: -0.75rem; /* absorbs the extra height, keeps the target */
	padding: 0;
	color: var(--est-ink);
	text-decoration: none;
	line-height: 1;
	overflow: visible;
}

.est-cart__link::after {
	display: none !important; /* no nav underline on the cart */
}

.est-cart__icon {
	width: 1.625rem;
	height: 1.625rem;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
	transition: transform var(--est-dur-fast) var(--est-ease);
}

.est-cart__link:hover .est-cart__icon,
.est-cart__link:focus-visible .est-cart__icon {
	transform: scale(1.06);
}

.est-cart__count {
	position: absolute;
	inset-block-start: 0.375rem;
	inset-inline-end: 0.375rem;
	display: grid;
	place-items: center;
	min-width: 1rem;
	height: 1rem;
	padding-inline: 0.25rem;
	background-color: var(--est-accent, var(--est-ink));
	color: var(--est-bg);
	border-radius: 999px; /* the one deliberate exception to --est-radius */
	font-family: var(--est-font-body);
	font-size: 0.5625rem;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

.est-cart__count:empty,
.est-cart__count[data-count='0'] {
	display: none;
}

/* ========================================================================
   6a. ACCOUNT + SEARCH
   Same icon-button pattern as the cart: 44px tap target, hairline stroke
   icon, no border. Live in the primary menu on desktop (inc/header.php)
   and in .est-utility-bar on mobile.
   ======================================================================== */

.est-account__link,
.est-search__toggle {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	margin-block: -0.75rem;
	padding: 0;
	color: var(--est-ink);
	text-decoration: none;
	line-height: 1;
}

.est-account__link::after {
	display: none !important; /* no nav underline */
}

.est-account__icon,
.est-search__icon {
	width: 1.5rem;
	height: 1.5rem;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.est-search {
	position: relative;
}

.est-search__form {
	position: absolute;
	inset-inline-end: 0;
	inset-block-start: calc(100% + var(--est-space-s));
	z-index: 10;
	display: flex;
	width: max(16rem, 100%);
	/* The site-wide horizontal-overflow guard ([class^="est-"]{max-width:100%})
	   matches this class and clamps it to its 44px positioned ancestor
	   (.est-search) instead of the viewport it's meant to guard against —
	   override back to the intended width. */
	max-width: none !important;
	padding: var(--est-space-xs);
	background-color: var(--est-bg);
	border: 1px solid var(--est-line);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-0.25rem);
	transition:
		opacity var(--est-dur-fast) var(--est-ease),
		transform var(--est-dur-fast) var(--est-ease),
		visibility 0s linear var(--est-dur-fast);
}

.est-search.is-open .est-search__form {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.est-search__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--est-space-xs) var(--est-space-s);
	border: 0;
	background: none;
	font-family: var(--est-font-body);
	font-size: var(--est-step-0);
	color: var(--est-ink);
}

.est-search__input:focus {
	outline: none;
}

/* ========================================================================
   6b. LANGUAGE SWITCHER (inc/header.php)
   TranslatePress's own V2 dropdown component (trp-shortcode-switcher__
   wrapper), rendered with a flag + 2-letter code via render_inline_switcher().
   Its colors/sizing come from inline CSS custom properties set by TRP
   itself — this only handles placement: the announcement bar on desktop
   (.est-announce__lang, styled above), its own row inside the mobile
   menu panel below.
   ======================================================================== */

.est-mobilenav__lang {
	margin-block-start: var(--est-space-l);
	padding-block-start: var(--est-space-l);
	border-block-start: 1px solid var(--est-line);
}

/* ========================================================================
   7. TRANSPARENT OVERLAY HEADER
   Fixed, so the hero can rise up underneath it.
   ======================================================================== */

body.est-header-overlay .site-header {
	position: fixed;
	inset-inline: 0;
	inset-block-start: calc(var(--est-announce-h, 2.5rem) + var(--est-admin-h, 0px));
	z-index: 100;
	background-color: transparent;
	border-block-end-color: transparent;
	transition:
		inset-block-start var(--est-dur) var(--est-ease),
		background-color var(--est-dur) var(--est-ease),
		border-color var(--est-dur) var(--est-ease),
		transform var(--est-dur) var(--est-ease);
}

body.est-header-overlay.admin-bar .site-header {
	--est-admin-h: 32px;
}

/* --- Light treatment over dark imagery. Top-level links only. --- */

body.est-header-overlay .site-header .main-title a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li:hover > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li.current-menu-item > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li.current-menu-parent > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li.current-menu-ancestor > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li.current_page_parent > a,
body.est-header-overlay .site-header .main-navigation .main-nav > ul > li.current_page_ancestor > a,
body.est-header-overlay .site-header .main-navigation .menu-toggle,
body.est-header-overlay .site-header .est-cart__link,
body.est-header-overlay .site-header .est-account__link,
body.est-header-overlay .site-header .est-search__toggle {
	color: var(--est-bg);
}

body.est-header-overlay .site-header .custom-logo,
body.est-header-overlay .site-header .site-logo img {
	filter: brightness(0) invert(1);
}

body.est-header-overlay .site-header .est-cart__count {
	background-color: var(--est-bg);
	color: var(--est-ink);
	box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08);
}

body.est-header-overlay .site-header .main-navigation ul ul li a,
body.est-header-overlay .site-header .main-navigation ul ul li:hover > a {
	color: var(--est-ink);
}

/* --- Stuck state --- */

body.est-header-overlay .site-header.is-stuck {
	inset-block-start: var(--est-admin-h, 0px);
	background-color: var(--est-bg);
	border-block-end-color: var(--est-line);
}

body.est-header-overlay .site-header.is-stuck .main-title a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li:hover > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li.current-menu-item > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li.current-menu-parent > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li.current-menu-ancestor > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li.current_page_parent > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .main-nav > ul > li.current_page_ancestor > a,
body.est-header-overlay .site-header.is-stuck .main-navigation .menu-toggle,
body.est-header-overlay .site-header.is-stuck .est-cart__link,
body.est-header-overlay .site-header.is-stuck .est-account__link,
body.est-header-overlay .site-header.is-stuck .est-search__toggle {
	color: var(--est-ink);
}

body.est-header-overlay .site-header.is-stuck .custom-logo,
body.est-header-overlay .site-header.is-stuck .site-logo img {
	filter: none;
}

body.est-header-overlay .site-header.is-stuck .est-cart__count {
	background-color: var(--est-accent, var(--est-ink));
	color: var(--est-bg);
	box-shadow: none;
}

/* ========================================================================
   8. TABLET — 48em to 64em
   ======================================================================== */

@media (min-width: 48em) and (max-width: 63.999em) {

	.site-header .inside-header {
		gap: var(--est-space-m);
	}

	.main-navigation .main-nav > ul {
		gap: var(--est-space-m);
	}

	.main-navigation .main-nav ul li a {
		letter-spacing: 0.04em;
	}
}

/* ========================================================================
   9. MOBILE — below 48em

   Bar:  [ burger ] .......... [ logo ] .......... [ search  account  cart ]

   GeneratePress's own navigation is hidden here. Its .main-navigation is a
   sibling of .inside-header in this layout, not a child, so it could not be
   overlaid on the bar without measuring something. Instead inc/mobile-nav.php
   prints .est-navtoggle inside .inside-header, next to the logo and the
   cart, and .est-mobilenav as a fixed full-screen panel in the footer.
   Neither anchors to anything that moves.
   ======================================================================== */

@media (max-width: 47.999em) {

	/* --- Admin bar ---
	   Below 783px WordPress switches #wpadminbar to position:absolute, so
	   it scrolls away with the page. A fixed header must not reserve space
	   for it, or it hangs 46px below the top of the viewport. --- */

	body.est-header-overlay.admin-bar .site-header {
		--est-admin-h: 0px;
	}

	/* --- The bar --- */

	.site-header .inside-header {
		position: relative;
		justify-content: center;
		gap: var(--est-space-s);
		min-height: var(--est-bar-h);
		padding-block: var(--est-space-xs);
	}

	.site-header .site-branding,
	.site-header .site-logo {
		/* Clear of both controls: burger on the left, search+account+cart
		   (3 × 2.75rem buttons) on the right. */
		max-width: calc(100% - 12rem);
	}

	.site-header .site-logo img,
	.site-header .custom-logo {
		height: 2.125rem;
		max-width: 10rem;
	}

	.site-header .main-title {
		font-size: var(--est-step-0);
	}

	/* --- GeneratePress navigation: off. Ours replaces it. --- */

	.main-navigation,
	.mobile-menu-control-wrapper {
		display: none !important;
	}

	/* --- Search, account, cart: hard right --- */

	.est-utility-bar {
		position: absolute;
		inset-block: 0;
		inset-inline-end: 30px;
		z-index: 101;
		display: flex;
		align-items: center;
		gap: 0.125rem;
	}

	.est-utility-bar .est-cart__link,
	.est-utility-bar .est-account__link {
		margin-block: 0; /* no sibling text links to match on mobile */
	}

	.est-utility-bar .est-search__form {
		inset-inline-end: 30px;
		inset-inline-start: auto;
		width: calc(100vw - 60px);
	}

	body.est-header-overlay .site-header .est-utility-bar .est-cart__link,
	body.est-header-overlay .site-header .est-utility-bar .est-account__link,
	body.est-header-overlay .site-header .est-utility-bar .est-search__toggle,
	body.est-header-overlay .site-header .est-navtoggle {
		color: var(--est-bg);
	}

	body.est-header-overlay .site-header.is-stuck .est-utility-bar .est-cart__link,
	body.est-header-overlay .site-header.is-nav-open .est-utility-bar .est-cart__link,
	body.est-header-overlay .site-header.is-stuck .est-utility-bar .est-account__link,
	body.est-header-overlay .site-header.is-nav-open .est-utility-bar .est-account__link,
	body.est-header-overlay .site-header.is-stuck .est-utility-bar .est-search__toggle,
	body.est-header-overlay .site-header.is-nav-open .est-utility-bar .est-search__toggle,
	body.est-header-overlay .site-header.is-stuck .est-navtoggle,
	body.est-header-overlay .site-header.is-nav-open .est-navtoggle {
		color: var(--est-ink);
	}

	/* --- Overlay pages: bar goes solid while the panel is open --- */

	body.est-header-overlay .site-header.is-nav-open {
		background-color: var(--est-bg);
		border-block-end-color: var(--est-line);
	}

	body.est-header-overlay .site-header.is-nav-open .main-title a {
		color: var(--est-ink);
	}

	body.est-header-overlay .site-header.is-nav-open .custom-logo,
	body.est-header-overlay .site-header.is-nav-open .site-logo img {
		filter: none;
	}

	body.est-header-overlay .site-header.is-nav-open .est-cart__count {
		background-color: var(--est-accent, var(--est-ink));
		color: var(--est-bg);
		box-shadow: none;
	}
}

/* ========================================================================
   9b. BURGER  (inc/mobile-nav.php)
   Absolute inside .inside-header, which is position:relative on mobile, so
   it sits on the same line as the logo by construction.
   ======================================================================== */
.est-navtoggle[aria-expanded='true'] {
	color: var(--est-ink);
}
.est-navtoggle {
	color: var(--est-ink);
}

.est-navtoggle:hover,
.est-navtoggle:active,
.est-navtoggle:focus {
	color: var(--est-ink);
}

.est-navtoggle:focus-visible {
	color: var(--est-ink);
	outline: 1px solid currentColor;
	outline-offset: 2px;
}
.est-navtoggle {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 30px;
	z-index: 101; /* above the panel, so it becomes the close control */
	display: none; /* mobile only — switched on immediately below */
	align-items: center;
	justify-content: center;
	width: 2.75rem; /* 44px tap target */
	padding: 0;
	border: 0;
	background: none;
	color: var(--est-ink);
	line-height: 1;
}

/* This media query must follow the rule above, not precede it. Equal
   specificity means source order decides, and a display:none declared
   later silently wins. */
@media (max-width: 47.999em) {

	.est-navtoggle {
		display: flex;
	}
}

.est-navtoggle__bars {
	position: relative;
	display: block;
	width: 1.375rem;
	height: 1px;
	background-color: currentColor;
	transition: background-color var(--est-dur-fast) var(--est-ease);
}

.est-navtoggle__bars::before,
.est-navtoggle__bars::after {
	content: '';
	position: absolute;
	inset-inline-start: 0;
	width: 100%;
	height: 1px;
	background-color: currentColor;
	transition: transform var(--est-dur-fast) var(--est-ease);
}

.est-navtoggle__bars::before { inset-block-start: -0.375rem; }
.est-navtoggle__bars::after  { inset-block-start: 0.375rem; }

/* Open: middle bar out, outer bars cross. */
.est-navtoggle[aria-expanded='true'] .est-navtoggle__bars {
	background-color: transparent;
}

.est-navtoggle[aria-expanded='true'] .est-navtoggle__bars::before {
	transform: translateY(0.375rem) rotate(45deg);
}

.est-navtoggle[aria-expanded='true'] .est-navtoggle__bars::after {
	transform: translateY(-0.375rem) rotate(-45deg);
}

/* ========================================================================
   9c. MOBILE PANEL  (inc/mobile-nav.php)
   position:fixed inset:0, so it anchors to the viewport and never to the
   header. z-index sits below the header (100) and above the announcement
   bar (90), so the bar stays on top and its burger becomes the close
   control.
   ======================================================================== */

.est-mobilenav {
	position: fixed;
	inset: 0;
	z-index: 95;
	display: none;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-block: calc(var(--est-announce-h, 2.5rem) + var(--est-bar-h) + var(--est-space-xl)) var(--est-space-2xl);
	padding-inline: 30px;
	background-color: var(--est-bg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-0.5rem);
	transition:
		opacity var(--est-dur) var(--est-ease),
		transform var(--est-dur) var(--est-ease),
		visibility 0s linear var(--est-dur);
}

@media (max-width: 47.999em) {

	.est-mobilenav {
		display: block;
	}

	/* The panel's top padding clears whatever sits above it. When the page
	   has scrolled past the announcement bar the header is pinned to the
	   top on its own, so only its height is left to clear — otherwise the
	   menu opened with a band of empty space above the first link.
	   header.js sets the body class as the panel opens. */
	body.est-past-announce .est-mobilenav {
		padding-block-start: calc(var(--est-bar-h) + var(--est-space-xl));
	}
}

.est-mobilenav.is-open {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.est-mobilenav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.est-mobilenav__list > li > a {
	display: block;
	padding-block: var(--est-space-s);
	font-family: var(--est-font-body);
	font-size: var(--est-step-2);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--est-ink);
	transition: opacity var(--est-dur-fast) var(--est-ease);
}

.est-mobilenav__list > li > a:hover,
.est-mobilenav__list > li.current-menu-item > a,
.est-mobilenav__list > li.current-menu-parent > a,
.est-mobilenav__list > li.current-menu-ancestor > a,
.est-mobilenav__list > li.current_page_parent > a,
.est-mobilenav__list > li.current_page_ancestor > a {
	opacity: 0.55;
}

.est-mobilenav__list .sub-menu {
	margin: 0 0 var(--est-space-s);
	padding: 0;
	list-style: none;
}

.est-mobilenav__list .sub-menu a {
	display: block;
	padding-block: var(--est-space-2xs);
	font-size: var(--est-step--1);
	text-transform: none;
	letter-spacing: 0;
	text-decoration: none;
	color: var(--est-ink-muted, var(--est-ink));
}

/* Items rise in sequence once the panel is open. */
.est-mobilenav__list > li {
	opacity: 0;
	transform: translateY(0.5rem);
	transition:
		opacity var(--est-dur) var(--est-ease),
		transform var(--est-dur) var(--est-ease);
}

.est-mobilenav.is-open .est-mobilenav__list > li {
	opacity: 1;
	transform: none;
}

.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(1) { transition-delay: 60ms; }
.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(2) { transition-delay: 110ms; }
.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(3) { transition-delay: 160ms; }
.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(4) { transition-delay: 210ms; }
.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(5) { transition-delay: 260ms; }
.est-mobilenav.is-open .est-mobilenav__list > li:nth-child(6) { transition-delay: 310ms; }

/* Scroll lock while the panel is open. */
body.est-nav-locked {
	overflow: hidden;
}

/* ========================================================================
   10. SMALL PHONES — 360px and down
   ======================================================================== */

@media (max-width: 22.5em) {

	.est-announce__item {
		padding-inline: var(--est-space-s);
		font-size: 0.625rem;
	}

	.est-announce__item:first-child {
		padding-inline-start: 0;
	}

	.site-header .inside-header {
		gap: var(--est-space-xs);
	}

	.est-cart__link {
		width: 2.5rem;
		height: 2.5rem;
	}

	.est-cart__icon {
		width: 1.5rem;
		height: 1.5rem;
	}
}

/* ========================================================================
   11. REDUCED MOTION
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {

	.site-header,
	body.est-header-overlay .site-header,
	.main-navigation .main-nav ul li > a::after,
	.est-cart__icon {
		transition: none;
	}

	.est-cart__link:hover .est-cart__icon,
	.est-cart__link:focus-visible .est-cart__icon {
		transform: none;
	}

	.est-mobilenav,
	.est-mobilenav__list > li {
		transition: none;
	}
}
/* iOS/Android paint a grey block on tap. Kill it, and keep the button
   flat in every interaction state. Focus stays visible for keyboards
   only, via :focus-visible below. */
.est-navtoggle {
	-webkit-tap-highlight-color: transparent;
	tap-highlight-color: transparent;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	touch-action: manipulation;
}

.est-navtoggle:hover,
.est-navtoggle:active,
.est-navtoggle:focus {
	background: none;
	box-shadow: none;
	outline: none;
}

.est-navtoggle:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 2px;
}

/* Safety net: if the cart ever renders inside the panel again, hide it. */
.est-mobilenav .est-cart {
	display: none;
}