/*
 * Header domain stylesheet — mirrors inc/header/ (Phase 2).
 *
 * Enqueued site-wide by just2euro_header_assets() in inc/header.php, depending
 * on 'generate-child' so the :root tokens in style.css load first. Covers the
 * top utility bar, brand row, main nav, inline search, sticky nav, and header
 * a11y focus. See tasks/phase-2-header.md and tasks/brand-identity.md.
 */

/* ---------------------------------------------------------------------------
   Header top utility bar (Phase 2 — see tasks/phase-2-header.md)
   Purple bar (matches prod): switcher (left), General + Account menus (right).
   --------------------------------------------------------------------------- */

.j2e-top-bar {
	background-color: var(--j2e-nav-bg);
	color: var(--j2e-nav-text);
	font-size: 0.875rem;
}

.j2e-top-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.25rem;
	/* No vertical padding here — it lives on the link buttons below so the hover
	   fill spans the full bar height with no gap (prod's full-height buttons). */
}

.j2e-top-bar__left,
.j2e-top-bar__right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1.25rem;
}

/* Top-level menu rows in the bar (switcher + each top menu). */
.j2e-lang-switcher ul,
.j2e-top-menu__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.j2e-top-bar a {
	color: var(--j2e-nav-text);
	text-decoration: none;
	display: inline-block;
	padding: 0.4rem 0.6rem; /* vertical padding moved here so the hover fill spans the full bar height */
	transition: background-color 0.15s ease;
}

/* Button-style hover, matching the main nav and prod: a purple fill with white
   text — never a colour swap or an underline. Scoped to the switcher and the
   top-level menu items (sub-menu links get their own light-surface hover). */
.j2e-lang-switcher a:hover,
.j2e-lang-switcher a:focus,
.j2e-top-menu__list > li > a:hover,
.j2e-top-menu__list > li > a:focus,
.j2e-top-menu__list > li:hover > a,
.j2e-top-menu__list > li:focus-within > a {
	background-color: var(--j2e-nav-hover-bg);
	color: var(--j2e-nav-text);
}

.j2e-lang-switcher .is-active > a {
	font-weight: 700;
	color: var(--j2e-nav-text);
}

/* Language switcher: flag + name. */
.j2e-lang a {
	display: inline-flex;
	align-items: center;
}

.j2e-lang__flag {
	width: 18px;
	height: 12px;
	margin-right: 0.35rem;
	vertical-align: middle;
}

/* Language switcher — dropdown style (Customizer: Header → Language switcher
   style). Only the current language shows; the others open in a panel on hover
   and keyboard focus, mirroring the top-menu sub-menu pattern below. */
.j2e-lang-switcher--dropdown .j2e-lang--current {
	position: relative;
}

.j2e-lang-switcher--dropdown .j2e-lang--current > a::after {
	content: " \25BE"; /* ▾ */
}

.j2e-lang-switcher--dropdown .j2e-lang-switcher__menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	display: block;
	min-width: 100%;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background-color: var(--j2e-bg);
	border: 1px solid var(--j2e-border);
	box-shadow: var(--j2e-shadow-dropdown);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
}

.j2e-lang-switcher--dropdown .j2e-lang--current:hover > .j2e-lang-switcher__menu,
.j2e-lang-switcher--dropdown .j2e-lang--current:focus-within > .j2e-lang-switcher__menu {
	opacity: 1;
	visibility: visible;
}

/* The panel sits on a light surface, so its links are dark with the light-surface
   hover — not the bar's white-on-purple fill. */
.j2e-lang-switcher--dropdown .j2e-lang-switcher__menu a {
	display: flex;
	align-items: center;
	padding: 0.3rem 1rem;
	white-space: nowrap;
	color: var(--j2e-text);
}

.j2e-lang-switcher--dropdown .j2e-lang-switcher__menu a:hover,
.j2e-lang-switcher--dropdown .j2e-lang-switcher__menu a:focus {
	color: var(--j2e-link);
	background-color: var(--j2e-surface);
}

/* Contact list (phone + email) — muted, icon-prefixed, centered. Mirrors prod's
   muted contact block. Links stay functional but read as plain muted text, not
   link-coloured (and never underlined). */
.j2e-contact {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--j2e-muted);
	font-size: 0.875rem;
}

.j2e-contact__item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.j2e-contact__icon {
	flex: none;
	color: var(--j2e-muted);
}

.j2e-contact a {
	color: var(--j2e-muted);
	text-decoration: none;
}

.j2e-contact a:hover,
.j2e-contact a:focus {
	color: var(--j2e-link); /* subtle affordance only; still no underline */
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Brand row aside — contact + cart, sharing the logo's row on the right.
   Hooked into GP's `.inside-header` after the branding.
   --------------------------------------------------------------------------- */

.inside-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.j2e-header-aside {
	margin-left: auto; /* push to the right edge, opposite the logo */
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	text-align: center; /* stacked + centered, matching prod */
}

.j2e-header-aside a {
	text-decoration: none;
}

/* Header mini-cart trigger. Live count/total are fragment-injected so cached
   header HTML never contains visitor-specific cart data. Unboxed icon + corner
   count badge; the badge stays in the DOM at zero (hidden) for the fragments
   and cart-check. */
.j2e-cart-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	min-height: 2.3rem;
	padding: 0.35rem 0.25rem;
	color: var(--j2e-heading-2);
	font-weight: 700;
	line-height: 1.2;
	transition: color 0.15s ease;
}

.j2e-cart-link:hover,
.j2e-cart-link:focus {
	color: var(--j2e-purple);
}

.j2e-cart-link__icon {
	flex: none;
	width: 24px;
	height: 24px;
}

.j2e-cart-link__summary {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.j2e-cart-link__summary.is-loading {
	opacity: 0.7;
}

.j2e-cart-link__count {
	position: absolute;
	/* Anchor to the icon's top-right corner, not the link's top edge: the icon
	   (24px) is flex-centered, so its top is at 50% − 12px; centering the badge
	   (1.15rem) on that line means the badge tracks the icon at any bar height. */
	top: calc(50% - 12px - 0.575rem);
	left: 1.15rem;
	min-width: 1.15rem;
	height: 1.15rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 0.25rem;
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
	border: 2px solid var(--j2e-bg);
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 700;
}

.j2e-cart-link__count.is-zero {
	display: none;
}

/* Match the site-wide purple price color on every page; the `.woocommerce`
   body class that styles amounts exists only on Woo pages, and the cached
   header fragment is identical everywhere. */
.j2e-cart-link__total,
.j2e-cart-link__total .amount {
	color: var(--j2e-purple);
	font-weight: 700;
}

/* ---------------------------------------------------------------------------
   AJAX mini-cart drawer — fragment-backed panel rendered in the footer.
   --------------------------------------------------------------------------- */

body.j2e-mini-cart-is-open {
	overflow: hidden;
}

.j2e-mini-cart__overlay {
	position: fixed;
	inset: 0;
	z-index: 980;
	background-color: rgba(0, 0, 0, 0.45);
}

.j2e-mini-cart__overlay[hidden],
.j2e-mini-cart__panel[hidden] {
	display: none;
}

.j2e-mini-cart__panel {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 990;
	display: flex;
	flex-direction: column;
	width: min(420px, 100vw);
	height: 100vh;
	max-height: 100vh;
	color: var(--j2e-text);
	background-color: var(--j2e-bg);
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
	text-align: left;
}

.admin-bar .j2e-mini-cart__panel {
	top: 32px;
	height: calc(100vh - 32px);
}

.j2e-mini-cart__header {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	/*padding: 1rem;*/
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    color: var(--j2e-nav-text);
	background-color: var(--j2e-nav-bg);
}

.j2e-mini-cart__title {
	margin: 0;
	color: var(--j2e-nav-text);
	font-size: 1rem;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.j2e-mini-cart__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.35rem;
	height: 2.35rem;
	padding: 0;
	color: var(--j2e-nav-text);
	background-color: transparent;
	border: 0;
	border-radius: 5px;
	cursor: pointer;
}

.j2e-mini-cart__close:hover,
.j2e-mini-cart__close:focus {
	color: var(--j2e-nav-text);
	background-color: transparent;
}

.j2e-mini-cart__content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	background-color: var(--j2e-bg);
}

.j2e-mini-cart__content.is-loading {
	cursor: progress;
}

.j2e-mini-cart__content.is-empty,
.j2e-mini-cart__content.is-error {
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem 1.25rem;
	text-align: center;
}

.j2e-mini-cart__empty-icon {
	flex: none;
	width: 56px;
	height: 56px;
	color: var(--j2e-heading-2);
}

.j2e-mini-cart__status {
	margin: 0;
	color: var(--j2e-heading-2);
	font-size: 1.05rem;
	font-weight: 700;
}

.j2e-mini-cart__hint {
	margin: 0;
	color: var(--j2e-muted);
}

.j2e-mini-cart__notice {
	margin: 0;
	padding: 0.75rem 1rem;
	color: var(--j2e-heading-3);
	background-color: var(--j2e-surface);
	border-left: 4px solid var(--j2e-purple);
}

.j2e-mini-cart__notice.is-error {
	border-left-color: var(--j2e-purple-hover);
}

.j2e-mini-cart__items {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.j2e-mini-cart__item {
	position: relative;
	display: grid;
	grid-template-columns: 74px minmax(0, 1fr) auto;
	gap: 0.8rem;
	margin: 0;
	padding: 1rem;
	border-bottom: 1px solid var(--j2e-border);
	background-color: var(--j2e-bg);
}

.j2e-mini-cart__item.is-updating {
	opacity: 0.6;
	pointer-events: none;
}

.j2e-mini-cart__item-media img {
	display: block;
	width: 74px;
	height: 74px;
	object-fit: contain;
	background-color: var(--j2e-bg);
	border: 1px solid var(--j2e-border);
	border-radius: 5px;
}

.j2e-mini-cart__item-body {
	min-width: 0;
}

.j2e-mini-cart__item-title {
	display: block;
	color: var(--j2e-heading-3);
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
}

.j2e-mini-cart__item-title:hover,
.j2e-mini-cart__item-title:focus {
	color: var(--j2e-purple);
	text-decoration: none;
	text-underline-offset: 2px;
}

.j2e-mini-cart__item-meta {
	margin-top: 0.35rem;
	color: var(--j2e-muted);
	font-size: 0.85rem;
	line-height: 1.35;
}

.j2e-mini-cart__item-meta dl,
.j2e-mini-cart__item-meta dd,
.j2e-mini-cart__item-meta p {
	margin: 0;
}

.j2e-mini-cart__item-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	margin-top: 0.75rem;
}

.j2e-mini-cart__item-price,
.j2e-mini-cart__item-price .amount {
	color: var(--j2e-purple);
	font-weight: 700;
}

.j2e-mini-cart__qty {
	display: inline-grid;
	grid-template-columns: 2.1rem 3.25rem 2.1rem;
	align-items: center;
	border: 1px solid var(--j2e-border);
	border-radius: 5px;
	overflow: hidden;
	background-color: var(--j2e-bg);
}

.j2e-mini-cart__qty-button,
.j2e-mini-cart__qty-input {
	height: 2.1rem;
	margin: 0;
	border: 0;
	border-radius: 0;
}

.j2e-mini-cart__qty-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	color: var(--j2e-heading-2);
	background-color: var(--j2e-surface);
	cursor: pointer;
	font-weight: 700;
}

.j2e-mini-cart__qty-button:hover,
.j2e-mini-cart__qty-button:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
}

.j2e-mini-cart__qty-input {
	width: 100%;
	padding: 0.2rem;
	color: var(--j2e-text);
	background-color: var(--j2e-bg);
	border-left: 1px solid var(--j2e-border);
	border-right: 1px solid var(--j2e-border);
	text-align: center;
	-moz-appearance: textfield;
}

.j2e-mini-cart__qty-input::-webkit-outer-spin-button,
.j2e-mini-cart__qty-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.j2e-mini-cart__qty-static {
	color: var(--j2e-muted);
	font-weight: 700;
}

.j2e-mini-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	color: var(--j2e-muted);
	background-color: var(--j2e-surface);
	border-radius: 5px;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.j2e-mini-cart__remove:hover,
.j2e-mini-cart__remove:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
}

.j2e-mini-cart__footer {
	flex: none;
	padding: 1rem;
	background-color: var(--j2e-surface-subtle);
	border-top: 1px solid var(--j2e-border);
}

.j2e-mini-cart__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem;
	color: var(--j2e-heading-2);
	font-size: 1rem;
}

.j2e-mini-cart__subtotal strong,
.j2e-mini-cart__subtotal .amount {
	color: var(--j2e-purple);
}

.j2e-mini-cart__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

.j2e-mini-cart__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	padding: 0.55rem 0.8rem;
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
	border: 1px solid var(--j2e-purple);
	border-radius: 5px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
}

.j2e-mini-cart__button:hover,
.j2e-mini-cart__button:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple-hover);
	border-color: var(--j2e-purple-hover);
}

.j2e-mini-cart__button--wide {
	align-self: stretch;
	margin-top: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.j2e-mini-cart__button--secondary {
	color: var(--j2e-purple);
	background-color: var(--j2e-bg);
}

.j2e-mini-cart__button--secondary:hover,
.j2e-mini-cart__button--secondary:focus {
	color: var(--j2e-nav-text);
	background-color: var(--j2e-purple);
	border-color: var(--j2e-purple);
}

/* Dropdowns (one level): open on hover and on keyboard focus (a11y). */
.j2e-top-menu .menu-item-has-children > a::after {
	content: " \25BE"; /* ▾ */
}

.j2e-top-menu li {
	position: relative;
}

.j2e-top-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	min-width: 12rem;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background-color: var(--j2e-bg);
	border: 1px solid var(--j2e-border);
	box-shadow: var(--j2e-shadow-dropdown);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease;
}

.j2e-top-menu li:hover > .sub-menu,
.j2e-top-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
}

/* Dropdown sits on a light surface, so its links are dark (not the bar's white). */
.j2e-top-menu .sub-menu a {
	display: block;
	padding: 0.3rem 1rem;
	white-space: nowrap;
	color: var(--j2e-text);
}

.j2e-top-menu .sub-menu a:hover,
.j2e-top-menu .sub-menu a:focus {
	color: var(--j2e-link);
	background-color: var(--j2e-surface);
}

/* Right-cluster menus drop toward the right edge so they don't overflow. */
.j2e-top-bar__right .j2e-top-menu .sub-menu {
	left: auto;
	right: 0;
}

/* ---------------------------------------------------------------------------
   Main navigation (Phase 2) — the purple brand bar (matches prod).
   Re-scope GeneratePress's own color tokens to our palette within the nav, so
   GP's nav rules paint purple with no specificity fight. Hover/active
   backgrounds (which GP doesn't set) are layered on top.
   --------------------------------------------------------------------------- */

.main-navigation {
	--base-3: var(--j2e-nav-bg);     /* nav + top-level background */
	--base: var(--j2e-nav-bg);       /* submenu background */
	--contrast: var(--j2e-nav-text); /* link text */
	--accent: var(--j2e-nav-text);   /* hover / current text */
}

/* Lean nav bar: GP sets the bar height via `line-height` (its 60px menu_item_height
   default) on the menu anchors. Override at GP's own selectors — same/greater
   specificity, loaded after GP — to take ~33% off. The matching mobile toggle and
   menu-bar items follow so the bar height stays consistent. */
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-item > a {
	line-height: var(--j2e-nav-height);
}

.main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a,
.main-navigation .main-nav ul li:not([class*="current-menu-"]):focus-within > a,
.main-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a {
	background-color: var(--j2e-nav-hover-bg);
}

.main-navigation .main-nav ul li[class*="current-menu-"] > a {
	background-color: var(--j2e-nav-active-bg);
}

/* Light menu-bar style ("Light menu bar" Customizer toggle) lives in
   header-light.css, enqueued only when the toggle is on (inc/header.php). */

/* ---------------------------------------------------------------------------
   Brand row layout + lean logo (Phase 2 — see tasks/brand-identity.md).
   The row reads: logo | search | aside. Keep GP's horizontal gutters and let the
   logo (the tallest item) define the row height — no vertical band hugging it.
   The other items keep their own spacing (gap + their internal padding) and ride
   centered in the row.
   --------------------------------------------------------------------------- */

.inside-header {
	padding-top: 0;
	padding-bottom: 0;
	gap: 1rem 2rem;
}

/* Logo proportional scaling lives in inc/customizer.php (just2euro_logo_size_css):
   it overrides GP's forced `width` with `width:auto` + the Customizer height, so
   the logo keeps its aspect ratio. Here we only kill the box spacing around it —
   `display:block` drops the inline-image descender gap so the logo sits flush. */
.site-logo {
	margin: 0;
	padding: 0;
}

.site-logo img {
	display: block;
}

/* ---------------------------------------------------------------------------
   Inline product search — centered in the brand row, between logo and aside.
   Hooked on `generate_after_logo`, so it is a flex sibling inside .inside-header.
   --------------------------------------------------------------------------- */

.j2e-header-search {
	flex: 1 1 240px;
	display: flex;
	justify-content: center;
	/* Never let the form stretch vertically: GP turns .inside-header into a
	   column on mobile, where the 240px flex-basis becomes height. */
	align-items: center;
}

/* One bordered pill; the icon button and the borderless field live inside it. */
.j2e-search {
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 500px;
	background-color: var(--j2e-bg);
	border: 2px solid var(--j2e-heading-2);
	border-radius: 999px;
	transition: border-color 0.15s ease;
}

.j2e-search:focus-within {
	border-color: var(--j2e-purple);
}

/* `.j2e-search` prefix outranks GP's `input[type="search"]` element styles. */
.j2e-search .j2e-search__field {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0.35rem 0.9rem 0.35rem 0.1rem;
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--j2e-text);
	background-color: transparent;
	border: 0;
	border-radius: 0 999px 999px 0;
}

.j2e-search .j2e-search__field::placeholder {
	color: var(--j2e-muted);
	opacity: 1;
	font-size: 0.8rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.j2e-search__submit {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.35rem 0.4rem 0.35rem 0.8rem;
	color: var(--j2e-heading-2);
	background-color: transparent;
	border: 0;
	border-radius: 999px 0 0 999px;
	cursor: pointer;
	transition: color 0.15s ease;
}

.j2e-search__submit:hover,
.j2e-search__submit:focus {
	color: var(--j2e-purple);
	background-color: transparent;
}

.j2e-search__icon {
	display: block;
}

/* ---------------------------------------------------------------------------
   Simple sticky nav (Phase 2) — the main nav bar only sticks to the top on
   scroll (pure CSS, no JS). The top utility bar and brand row scroll away.
   Offsets keep in-page anchors visible and clear the fixed WP admin bar.
   --------------------------------------------------------------------------- */

html {
	scroll-padding-top: 80px; /* ~nav height, so anchored sections aren't hidden */
}

.main-navigation {
	position: sticky;
	top: 0;
	z-index: var(--j2e-sticky-z);
}

.admin-bar .main-navigation {
	top: 32px; /* desktop WP admin bar height */
}

@media screen and (max-width: 782px) {
	.admin-bar .main-navigation {
		top: 46px; /* taller mobile admin bar */
	}

	.admin-bar .j2e-mini-cart__panel {
		top: 46px;
		height: calc(100vh - 46px);
	}
}

/* GP's .inside-header goes column below its 768px mobile breakpoint; drop the
   row-oriented flex-basis so the search takes its natural height, full width. */
@media (max-width: 768px) {
    .inside-header {
        gap: 0;
        padding-top: 0.2rem;
        padding-bottom: 0.8rem;
    }

	.j2e-header-search {
		flex-basis: auto;
		width: 100%;
		padding: 0 1rem;
	}
}

@media (max-width: 640px) {
    .inside-header {
        gap: 0;
        padding-top: 0.2rem;
        padding-bottom: 0.8rem;
    }

	.j2e-cart-link {
		width: 100%;
	}

	.j2e-mini-cart__panel {
		width: 100vw;
	}

	.j2e-mini-cart__item {
		grid-template-columns: 62px minmax(0, 1fr) auto;
		padding: 0.85rem;
	}

	.j2e-mini-cart__item-media img {
		width: 62px;
		height: 62px;
	}

	.j2e-mini-cart__actions {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------------------
   Accessibility: a visible keyboard focus ring for header controls (cyan accent
   reads on both the purple bars and the white brand row). Mouse users are
   unaffected via `:focus-visible`. GP's free hamburger drives the mobile primary
   nav; the top bar, search, and aside already wrap on narrow screens.
   --------------------------------------------------------------------------- */

.j2e-top-bar a:focus-visible,
.j2e-header-aside a:focus-visible,
.main-navigation a:focus-visible,
.j2e-mini-cart__close:focus-visible,
.j2e-mini-cart__qty-button:focus-visible,
.j2e-mini-cart__qty-input:focus-visible,
.j2e-mini-cart__remove:focus-visible,
.j2e-mini-cart__button:focus-visible {
	outline: 2px solid var(--j2e-cyan);
	outline-offset: 2px;
}

/* The search pill carries one ring for both inner controls. Kept out of the
   list above: an unsupported `:has()` would invalidate the whole list. The
   `:focus-within` purple border is the fallback. */
.j2e-search:has(:focus-visible) {
	outline: 2px solid var(--j2e-cyan);
	outline-offset: 2px;
}

.j2e-search .j2e-search__field:focus-visible,
.j2e-search .j2e-search__submit:focus-visible {
	outline: none;
}

/* ---------------------------------------------------------------------------
   Add-to-cart confirmation toast (snackbar). Replaces the drawer auto-open:
   a non-blocking confirmation that lets the customer keep browsing, with a
   "View cart" action for the minority who want to head to checkout. Centred
   via left/right + margin so transform is free for the slide animation.
   --------------------------------------------------------------------------- */

.j2e-cart-toast {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 1.5rem;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	width: max-content;
	max-width: min(5000px, calc(100vw - 2rem));
	margin-inline: auto;
	padding: 0.7rem 0.75rem 0.7rem 1rem;
	color: var(--j2e-nav-text);
	background-color: var(--j2e-nav-bg);
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transform: translateY(calc(100% + 1.5rem));
	transition: transform 0.25s ease, opacity 0.25s ease;
	pointer-events: none;
}

.j2e-cart-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.j2e-cart-toast__icon {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	color: var(--j2e-nav-text);
}

.j2e-cart-toast__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.j2e-cart-toast__message {
	flex: 1 1 auto;
	font-size: 0.95rem;
	line-height: 1.35;
}

.j2e-cart-toast__action {
	flex: none;
	padding: 0;
	color: var(--j2e-nav-text);
	background: transparent;
	border: 0;
    opacity: 0.90;
	font: inherit;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	text-decoration: none;
}

.j2e-cart-toast__action:hover,
.j2e-cart-toast__action:focus {
	color: var(--j2e-nav-text);
    opacity: 1;
	text-decoration: none;
    background-color: transparent;
}

.j2e-cart-toast__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	color: var(--j2e-nav-text);
	background: transparent;
	border: 0;
	border-radius: 5px;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.90;
}

.j2e-cart-toast__close:hover,
.j2e-cart-toast__close:focus {
	opacity: 1;
    background-color: transparent;
}

@media (max-width: 480px) {
	.j2e-cart-toast {
		left: 1rem;
		right: 1rem;
		bottom: 1rem;
		width: auto;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.j2e-cart-toast {
		transform: translateY(0);
		transition: opacity 0.2s ease;
	}
}
