/*
 * The storefront's header and footer on WordPress's own pages (S11, includes/storefront-chrome.php):
 * copies of the storefront's UtilityBar, SiteHeader, IconButton, Input (inverse), MegaMenu, Button,
 * Badge, Alert (compliance), Breadcrumbs and SiteFooter styles, using only the design system's
 * tokens and icons (assets/storefront). When those components change on the storefront, change
 * their copies here to match. No rule here reaches WooCommerce's markup.
 */

/* Page: as the storefront's global styles. */

body.lov-account {
	background: var(--surface-page);
}

html:has(body.lov-account) {
	scroll-padding-top: var(--header-clearance);
}

@media (max-height: 25rem) {
	html:has(body.lov-account) {
		scroll-padding-top: 0;
	}
}

.lov-container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--gutter-tight);
}

@media (min-width: 48rem) {
	.lov-container {
		padding-inline: var(--gutter);
	}
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

main.lov-account-main:focus {
	outline: none;
}

/* Skip to content, as the storefront's: hidden above the page until it has focus. */
.lov-skip {
	position: absolute;
	top: var(--space-2);
	left: var(--space-2);
	z-index: 70;
	padding: var(--space-2) var(--space-4);
	font-family: var(--font-ui);
	font-size: var(--size-sm);
	font-weight: var(--weight-semibold);
	color: var(--white);
	background: var(--brand);
	border-radius: var(--radius-control);
	transform: translateY(-200%);
}

.lov-skip:focus {
	color: var(--white);
	transform: none;
}

/* Icons: the design system's, masked in the text's colour, as its Icon component draws them. */

.lov-icon {
	display: inline-block;
	flex: 0 0 auto;
	width: var(--icon-sm);
	height: var(--icon-sm);
	background-color: currentColor;
	-webkit-mask: var(--lov-icon-src) center / contain no-repeat;
	mask: var(--lov-icon-src) center / contain no-repeat;
}

.lov-icon-xs {
	width: var(--icon-xs);
	height: var(--icon-xs);
}

.lov-icon-md {
	width: var(--icon-md);
	height: var(--icon-md);
}

.lov-icon-arrow-right { --lov-icon-src: url('storefront/icons/arrow-right.svg'); }
.lov-icon-badge-percent { --lov-icon-src: url('storefront/icons/badge-percent.svg'); }
.lov-icon-chevron-down { --lov-icon-src: url('storefront/icons/chevron-down.svg'); }
.lov-icon-chevron-right { --lov-icon-src: url('storefront/icons/chevron-right.svg'); }
.lov-icon-menu { --lov-icon-src: url('storefront/icons/menu.svg'); }
.lov-icon-search { --lov-icon-src: url('storefront/icons/search.svg'); }
.lov-icon-shield-check { --lov-icon-src: url('storefront/icons/shield-check.svg'); }
.lov-icon-shopping-cart { --lov-icon-src: url('storefront/icons/shopping-cart.svg'); }
.lov-icon-truck { --lov-icon-src: url('storefront/icons/truck.svg'); }
.lov-icon-user { --lov-icon-src: url('storefront/icons/user.svg'); }
.lov-icon-zap { --lov-icon-src: url('storefront/icons/zap.svg'); }

/* The header: sticky, the utility bar scrolling away above the masthead first. */

.lov-site-header {
	position: sticky;
	top: calc(var(--utility-bar-h) * -1);
	z-index: 30;
}

/* The admin bar, for staff, sits above it. */
.admin-bar .lov-site-header {
	top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--utility-bar-h));
}

@media (max-height: 25rem) {
	.lov-site-header {
		position: static;
	}
}

.lov-utility-bar {
	color: var(--text-inverse-muted);
	background: var(--ink-900);
	border-bottom: 1px solid color-mix(in srgb, var(--white) 8%, transparent);
}

.lov-utility-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	min-height: var(--utility-bar-h);
	font-family: var(--font-ui);
	font-size: var(--size-xs);
}

.lov-utility-messages {
	display: flex;
	align-items: center;
	gap: var(--space-5);
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lov-utility-messages li {
	display: inline-flex;
	align-items: center;
	gap: calc(var(--space-1) + var(--space-1) / 2);
	min-width: 0;
	white-space: nowrap;
}

.lov-utility-messages span:not(.lov-icon),
.lov-utility-messages a {
	overflow: hidden;
	text-overflow: ellipsis;
}

.lov-utility-glyph {
	color: var(--blue-300);
}

.lov-utility-messages a {
	color: var(--white);
	text-decoration: underline;
	text-underline-offset: calc(var(--space-1) * 0.75);
}

.lov-utility-messages a:hover {
	color: var(--white);
}

.lov-utility-age {
	flex: 0 0 auto;
	font-weight: var(--weight-bold);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--brass-400);
}

/* Phones: one message, the most important first (announcement, then free delivery). */
@media (max-width: 47.99rem) {
	.lov-utility-messages li:not(:first-child) {
		display: none;
	}
	.lov-utility-inner {
		padding-block: var(--space-1);
	}
	.lov-utility-messages li {
		white-space: normal;
	}
	.lov-utility-messages span:not(.lov-icon),
	.lov-utility-messages a {
		overflow: visible;
	}
}

.lov-masthead {
	background: var(--ink-900);
}

.lov-masthead-inner {
	display: grid;
	grid-template-areas:
		'menu logo actions'
		'search search search';
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: var(--space-3) var(--space-2);
	padding-block: var(--space-3);
}

.lov-masthead-menu {
	grid-area: menu;
}

.lov-masthead-logo {
	grid-area: logo;
	justify-self: start;
	display: block;
	line-height: 0;
}

.lov-masthead-logo img {
	width: auto;
	height: var(--logo-h-compact);
}

.lov-masthead-search {
	grid-area: search;
	min-width: 0;
	margin: 0;
}

.lov-masthead-actions {
	grid-area: actions;
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

/* IconButton, inverse, as on the navy chrome. */
.lov-icon-button {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--control-h-md);
	height: var(--control-h-md);
	padding: 0;
	color: var(--text-body);
	text-decoration: none;
	background: transparent;
	border: 1px solid transparent;
	border-radius: var(--radius-control);
	cursor: pointer;
	transition: var(--transition-control);
}

.lov-icon-button-inverse,
.lov-icon-button-inverse:hover {
	color: var(--white);
	text-decoration: none;
}

.lov-icon-button-inverse {
	border-color: var(--border-inverse);
}

.lov-icon-button-inverse:hover {
	background: color-mix(in srgb, var(--white) 14%, transparent);
}

/* The header search: the design system's Input on the navy masthead. */
.lov-search-control {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	height: var(--control-h-md);
	padding: 0 calc(var(--space-3) + var(--space-1) / 2);
	background: color-mix(in srgb, var(--white) 7%, transparent);
	border: 1px solid var(--border-control);
	border-radius: var(--radius-control);
	transition: var(--transition-control);
}

.lov-search-control:focus-within {
	border-color: var(--blue-300);
	box-shadow: var(--ring-focus);
	outline: calc(var(--space-1) / 2) solid transparent;
}

.lov-search-lead {
	color: var(--blue-300);
}

.lov-search-control input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	font-family: var(--font-ui);
	font-size: var(--size-sm);
	color: var(--white);
	background: transparent;
	border: 0;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

@media (pointer: coarse) {
	.lov-search-control input {
		font-size: var(--size-md);
	}
}

.lov-search-control input::placeholder {
	color: var(--text-inverse-muted);
}

.lov-category-nav {
	display: none;
}

@media (min-width: 64rem) {
	.lov-site-header {
		top: 0;
	}
	.admin-bar .lov-site-header {
		top: var(--wp-admin--admin-bar--height, 0px);
	}
	.lov-masthead-inner {
		grid-template-areas: 'logo search actions';
		grid-template-columns: auto 1fr auto;
		gap: var(--space-6);
		padding-block: var(--space-4);
	}
	.lov-masthead-menu {
		display: none;
	}
	.lov-masthead-logo img {
		height: var(--logo-h);
	}

	/* The drop-downs hang from this bar, full width. */
	.lov-category-nav {
		position: relative;
		display: block;
		background: var(--white);
		border-bottom: 1px solid var(--border-subtle);
		box-shadow: var(--shadow-xs);
	}
}

/* The category bar and its drop-downs (MegaMenu): native disclosures, one open at a time. */

.lov-mega-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 var(--space-6);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lov-mega-bar > li {
	flex: 0 0 auto;
}

.lov-mega-aside-first {
	margin-left: auto;
}

.lov-mega-top,
.lov-mega-item > summary {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	padding: calc(var(--space-3) + var(--space-1) / 2) 0;
	font-family: var(--font-ui);
	font-size: var(--size-sm);
	font-weight: var(--weight-semibold);
	white-space: nowrap;
	color: var(--text-body);
	text-decoration: none;
	list-style: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
}

.lov-mega-item > summary::-webkit-details-marker {
	display: none;
}

.lov-mega-top:hover,
.lov-mega-item > summary:hover {
	color: var(--text-link-hover);
	text-decoration: none;
}

.lov-mega-item[open] > summary {
	color: var(--text-strong);
	border-bottom-color: var(--brand);
}

.lov-mega-chevron {
	color: var(--text-muted);
	transition: transform var(--dur-base) var(--ease-out);
}

.lov-mega-item[open] .lov-mega-chevron {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.lov-mega-chevron {
		transition: none;
	}
}

.lov-mega-panel {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	z-index: 1;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--surface-card);
	border-top: 1px solid var(--border-subtle);
	box-shadow: var(--shadow-lg);
}

.lov-mega-panel-inner {
	display: grid;
	grid-template-columns: var(--mega-intro-w) minmax(0, 1fr);
	gap: var(--space-8);
	padding-block: var(--space-7) var(--space-8);
}

.lov-mega-intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-4);
}

.lov-mega-panel-title {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--size-2xl);
	line-height: var(--lh-display);
	color: var(--text-strong);
}

.lov-mega-main {
	min-width: 0;
}

.lov-mega-columns {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--mega-col-min), 1fr));
	gap: var(--space-6);
}

.lov-mega-column-title {
	margin: 0 0 var(--space-2);
}

.lov-mega-column-title a {
	color: inherit;
}

.lov-mega-links {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lov-mega-flow {
	column-width: var(--mega-col-min);
	column-gap: var(--space-6);
}

.lov-mega-flow li {
	break-inside: avoid;
}

.lov-mega-links a,
.lov-mega-column-link {
	display: block;
	padding: var(--space-2) 0;
	font-family: var(--font-ui);
	font-size: var(--size-sm);
	color: var(--text-body);
}

.lov-mega-column-link {
	font-weight: var(--weight-semibold);
	color: var(--text-strong);
}

.lov-mega-links a:hover,
.lov-mega-column-link:hover,
.lov-mega-column-title a:hover {
	color: var(--text-link-hover);
}

/* Button, secondary and small, as the drop-downs' "All" link. */
.lov-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: var(--control-h-md);
	padding: 0 var(--space-5);
	font-family: var(--font-ui);
	font-size: var(--size-md);
	font-weight: var(--weight-semibold);
	line-height: 1;
	letter-spacing: 0.01em;
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid transparent;
	border-radius: var(--radius-control);
	cursor: pointer;
	transition:
		var(--transition-control),
		transform var(--dur-instant) var(--ease-out);
}

.lov-button:hover {
	text-decoration: none;
}

.lov-button:active {
	transform: scale(var(--press-scale));
}

.lov-button-sm {
	min-height: var(--control-h-sm);
	padding: 0 calc(var(--space-3) + var(--space-1) / 2);
	font-size: var(--size-sm);
}

.lov-button-secondary {
	color: var(--brand);
	background: var(--white);
	border-color: var(--border-default);
}

.lov-button-secondary:hover,
.lov-button-secondary:active {
	color: var(--brand-hover);
	background: var(--blue-50);
	border-color: var(--border-brand);
}

.lov-button-secondary:active {
	background: var(--blue-100);
}

/* Badge: the footer's on navy, and an order's status on white (account.css places it). */
.lov-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	height: var(--space-6);
	padding: 0 calc(var(--space-2) + var(--space-1) / 2);
	font-family: var(--font-ui);
	font-size: var(--size-xs);
	font-weight: var(--weight-bold);
	letter-spacing: var(--ls-caps-display);
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	border-radius: var(--radius-xs);
}

.lov-badge-sm {
	height: var(--space-5);
	padding: 0 var(--space-2);
	font-size: var(--size-2xs);
}

.lov-badge-brand {
	color: var(--white);
	background: var(--blue-600);
}

.lov-badge-success {
	color: var(--green-600);
	background: var(--green-100);
}

.lov-badge-warning {
	color: var(--amber-600);
	background: var(--amber-100);
}

.lov-badge-neutral {
	color: var(--text-body);
	background: var(--surface-muted);
}

.lov-badge-inverse {
	color: var(--white);
	background: color-mix(in srgb, var(--white) 12%, transparent);
}

/* The page's top, as the storefront's PageHeader: breadcrumbs, then the title. */

.lov-page-header {
	padding-top: var(--space-6);
	margin-bottom: var(--space-6);
}

.lov-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--font-ui);
	font-size: var(--size-xs);
	color: var(--text-muted);
}

.lov-breadcrumbs li {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
}

.lov-breadcrumbs a {
	color: var(--text-muted);
	text-decoration: none;
}

.lov-breadcrumbs a:hover {
	color: var(--text-link-hover);
}

.lov-breadcrumbs-current {
	font-weight: var(--weight-semibold);
	color: var(--text-strong);
}

.lov-breadcrumbs-sep {
	width: var(--space-3);
	height: var(--space-3);
	color: var(--ink-300);
}

.lov-page-title {
	margin-top: var(--space-5);
	font-size: var(--size-display-sm);
	overflow-wrap: break-word;
}

@media (min-width: 48rem) {
	.lov-page-title {
		font-size: var(--size-display-md);
	}
}

/* The footer (SiteFooter). */

.lov-site-footer {
	margin-top: var(--section-y);
	font-family: var(--font-ui);
	color: var(--text-inverse-muted);
	background: var(--ink-900);
}

.lov-footer-top {
	display: grid;
	padding-top: var(--space-9);
	padding-bottom: var(--space-6);
}

.lov-footer-brand {
	margin-bottom: var(--space-6);
}

@media (min-width: 48rem) {
	.lov-footer-top {
		grid-template-columns: repeat(2, 1fr);
		gap: var(--space-8);
	}
	.lov-footer-brand {
		margin-bottom: 0;
	}
}

@media (min-width: 64rem) {
	.lov-footer-top {
		grid-template-columns: 1.4fr repeat(3, 1fr);
		gap: var(--space-7);
		padding-top: var(--space-8);
		padding-bottom: var(--space-5);
	}
}

.lov-footer-brand img {
	width: auto;
	height: calc(var(--space-9) + var(--space-1));
	margin-bottom: var(--space-4);
}

.lov-footer-brand p {
	max-width: var(--footer-text-w);
	margin: 0;
	font-size: var(--size-sm);
	line-height: var(--lh-body);
}

.lov-footer-marks {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-4);
	margin-top: var(--space-4);
}

.lov-footer-badges {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2);
}

.lov-footer-awards {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.lov-footer-award,
.lov-footer-award img {
	display: block;
}

.lov-footer-awards img {
	width: var(--footer-award-w);
	max-width: 100%;
	height: auto;
	margin: 0;
	border-radius: var(--radius-sm);
}

.lov-footer-column-title {
	display: none;
	margin: 0 0 var(--space-4);
	font-size: var(--size-2xs);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--eyebrow-ls);
	text-transform: uppercase;
	color: var(--brass-400);
}

.lov-footer-column ul,
.lov-footer-legal {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lov-footer-column ul {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

@media (min-width: 64rem) {
	.lov-footer-column ul {
		gap: var(--space-2);
	}
}

.lov-footer-fold summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--control-h-md);
	font-size: var(--size-sm);
	font-weight: var(--weight-semibold);
	color: var(--text-inverse);
	list-style: none;
	cursor: pointer;
	border-bottom: 1px solid var(--border-inverse);
}

.lov-footer-fold summary::-webkit-details-marker {
	display: none;
}

.lov-footer-fold summary .lov-icon {
	transition: transform var(--dur-fast) var(--ease-out);
}

.lov-footer-fold[open] summary .lov-icon {
	transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
	.lov-footer-fold summary .lov-icon {
		transition: none;
	}
}

.lov-footer-fold[open] ul {
	padding-block: var(--space-4);
	border-bottom: 1px solid var(--border-inverse);
}

/* Wider screens show every menu open under its title. A browser without ::details-content keeps
   the menus folded behind their titles instead, as the storefront's footer does. */
@media (min-width: 48rem) {
	@supports selector(::details-content) {
		.lov-footer-column-title {
			display: block;
		}
		.lov-footer-fold summary {
			display: none;
		}
		.lov-footer-fold::details-content {
			content-visibility: visible;
		}
		.lov-footer-fold[open] ul {
			padding-block: 0;
			border-bottom: 0;
		}
	}
}

.lov-site-footer a {
	font-size: var(--size-sm);
	color: var(--text-inverse-muted);
	text-decoration: none;
}

.lov-site-footer a:hover {
	color: var(--white);
	text-decoration: underline;
}

.lov-footer-notice {
	padding-bottom: var(--space-6);
}

/* Alert, compliance: the legal notice. */
.lov-alert-compliance {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	padding: var(--space-4);
	font-size: var(--size-sm);
	line-height: var(--lh-snug);
	color: var(--white);
	background: var(--ink-900);
	border: 1px solid var(--border-inverse);
	border-radius: var(--radius-control);
}

.lov-alert-compliance .lov-icon {
	color: var(--blue-300);
}

.lov-alert-compliance p {
	flex: 1;
	min-width: 0;
	margin: 0;
}

.lov-footer-bottom {
	border-top: 1px solid var(--border-inverse);
}

.lov-footer-bottom-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: var(--space-3);
	padding-top: var(--space-4);
	padding-bottom: var(--space-4);
	font-size: var(--size-xs);
}

.lov-footer-company {
	margin: 0;
}

.lov-footer-sep {
	margin-inline: var(--space-2);
}

.lov-footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4);
}

.lov-site-footer .lov-footer-legal a {
	font-size: var(--size-xs);
}
