/**
 * E-Grow Components: Header.
 */

.egc-header {
	position: relative;
	z-index: 100;
	background: var(--egc-header-bg, #fff);
	color: var(--egc-text, inherit);
	font-family: var(--egc-font, inherit);
}

.egc-header,
.egc-header * {
	box-sizing: border-box;
}

.egc-header--border {
	border-bottom: 1px solid var(--egc-border, #e2e4e7);
}

.egc-header--sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
}

/* On narrow screens the admin bar scrolls away, so the header sticks to the very top. */
@media (max-width: 600px) {

	.egc-header--sticky {
		top: 0;
	}
}

.egc-header__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	max-width: 1400px;
	min-height: 64px;
	margin: 0 auto;
	padding: 10px clamp(12px, 3vw, 32px);
}

.egc-header__start {
	justify-self: start;
	display: flex;
	align-items: center;
	min-width: 0;
}

.egc-header__brand {
	justify-self: center;
	text-align: center;
}

.egc-header__end {
	justify-self: end;
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.egc-header__logo {
	display: inline-block;
	color: inherit;
	text-decoration: none;
	line-height: 0;
}

.egc-header__logo-img {
	display: block;
	width: var(--egc-logo-w, 150px);
	max-width: 100%;
	height: auto;
}

.egc-header__logo-text {
	font-size: 1.4em;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

@media (max-width: 767px) {

	.egc-header__inner {
		min-height: 56px;
	}

	.egc-header__logo-img {
		width: var(--egc-logo-w-m, 110px);
	}
}

/* Cart */
.egc-header__cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	color: inherit;
	text-decoration: none;
	border-radius: var(--egc-radius, 6px);
	white-space: nowrap;
	transition: opacity 0.15s;
}

.egc-header__cart:hover {
	opacity: 0.7;
	color: inherit;
}

.egc-header__cart:focus-visible {
	outline: 2px solid var(--egc-accent, currentColor);
	outline-offset: 2px;
}

.egc-header__cart-total {
	font-size: 0.9em;
}

.egc-header__cart-icon {
	position: relative;
	display: inline-flex;
}

.egc-header__cart-icon svg {
	display: block;
}

.egc-header__cart-count {
	position: absolute;
	top: -6px;
	right: -9px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--egc-accent, #d63638);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
}

@media (max-width: 380px) {

	.egc-header__cart-total {
		display: none;
	}
}

/* Skip link, visible only on keyboard focus */
.egc-skip-link {
	position: absolute;
	top: -100px;
	left: 8px;
	z-index: 100000;
	padding: 10px 16px;
	background: #fff;
	color: #111;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.egc-skip-link:focus {
	top: 8px;
}

/* Language switcher (WPML) */
.egc-header__lang ul {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.egc-header__lang li + li::before {
	content: "|";
	margin: 0 4px;
	opacity: 0.4;
}

.egc-header__lang a {
	display: inline-block;
	min-width: 28px;
	padding: 10px 4px;
	text-align: center;
	color: inherit;
	font-size: 0.85em;
	letter-spacing: 0.04em;
	text-decoration: none;
	opacity: 0.6;
}

.egc-header__lang a:hover,
.egc-header__lang a[aria-current="true"] {
	opacity: 1;
}

.egc-header__lang a[aria-current="true"] {
	font-weight: 600;
}

.egc-header__lang a:focus-visible {
	outline: 2px solid var(--egc-accent, currentColor);
	outline-offset: 2px;
}

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