/* =============================================================
   Solink site header
   See /DESIGN.md for brand tokens & rules.
   Tokens are defined on :root in style.css.
============================================================= */

/* (Skip link is provided by the parent theme's header.php.) */

/* ---- Neutralise parent theme's button reset on our chrome.
   Hello Elementor's reset.css applies a pink border + native chrome to
   every <button>. Wipe it out wherever our header lives. ---- */
.solink-header button,
.solink-header__mobile button {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit;
	font: inherit;
	margin: 0;
	padding: 0;
	line-height: 1;
	white-space: normal;
	text-transform: none;
	transition: none;
}
.solink-header button:hover,
.solink-header button:focus,
.solink-header__mobile button:hover,
.solink-header__mobile button:focus {
	background: transparent;
	color: inherit;
	text-decoration: none;
}

/* ---- Reusable button classes (DESIGN.md §4) ---- */
.sm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	line-height: 1;
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.sm-btn--primary {
	background: var(--solink-red);
	color: var(--white);
}
.sm-btn--primary:hover,
.sm-btn--primary:focus-visible {
	background: var(--solink-orange);
	color: var(--white);
}
.sm-btn--outline {
	background: transparent;
	color: var(--solink-red);
	border: 2px solid var(--solink-red);
}
.sm-btn--outline:hover,
.sm-btn--outline:focus-visible {
	background: var(--solink-red);
	color: var(--white);
}

/* ---- Header shell ---- */
.solink-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--white);
	border-bottom: 1px solid rgba(107, 107, 107, 0.2);
	font-family: 'Montserrat', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
	color: var(--deep-black);
	transition: transform 250ms ease;
	will-change: transform;
}
.solink-header.is-hidden {
	transform: translateY(-100%);
}

.solink-header__inner {
	max-width: 1320px;
	margin: 0 auto;
	padding: 15px 24px;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
}

/* ---- Brand / logo ---- */
.solink-header__brand .custom-logo-link,
.solink-header__brand-fallback {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--deep-black);
}
.solink-header__brand .custom-logo {
	display: block;
	height: 44px;
	width: auto;
	max-width: 180px;
}
.solink-header__brand-fallback span {
	font-weight: 800;
	font-size: 18px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--solink-red);
}

/* ---- Primary nav (desktop) ---- */
.solink-header__nav {
	justify-self: center;
}
.solink-header__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 5px;
}
.solink-header__menu li {
	position: relative;
}
.solink-header__menu a {
	display: inline-block;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 13.86px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--deep-black);
	text-decoration: none;
	transition: color 150ms ease;
}
.solink-header__menu a::after {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 4px;
	height: 2px;
	background: var(--solink-red);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 200ms ease;
}
.solink-header__menu a:hover,
.solink-header__menu a:focus-visible,
.solink-header__menu .current-menu-item > a,
.solink-header__menu .current-menu-ancestor > a,
.solink-header__menu a[aria-current="page"] {
	color: var(--solink-red);
}
.solink-header__menu .current-menu-item > a::after,
.solink-header__menu .current-menu-ancestor > a::after,
.solink-header__menu a[aria-current="page"]::after,
.solink-header__menu a:hover::after,
.solink-header__menu a:focus-visible::after {
	transform: scaleX(1);
}

/* Sub-menu (basic dropdown) */
.solink-header__menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(8px);
	min-width: 200px;
	background: var(--white);
	border: 1px solid rgba(107, 107, 107, 0.2);
	border-radius: 8px;
	padding: 8px 0;
	margin: 0;
	list-style: none;
	box-shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
	opacity: 0;
	visibility: hidden;
	transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
	z-index: 10;
}
.solink-header__menu li:hover > .sub-menu,
.solink-header__menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}
.solink-header__menu .sub-menu a {
	display: block;
	padding: 8px 16px;
	font-size: 13px;
	letter-spacing: 0.02em;
}
.solink-header__menu .sub-menu a::after { display: none; }

/* ---- Right-side actions ---- */
.solink-header__actions {
	display: flex;
	align-items: center;
	gap: 4px;
}
.solink-header__icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--deep-black);
	cursor: pointer;
	border-radius: 4px;
	text-decoration: none;
	transition: color 150ms ease;
}
.solink-header__icon-btn:hover,
.solink-header__icon-btn:focus-visible {
	color: var(--solink-red);
}
.solink-header__icon-btn:focus-visible {
	outline: 2px solid var(--solink-red);
	outline-offset: 2px;
}
.solink-icon {
	display: block;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	pointer-events: none;
}
.solink-header__menu-toggle .solink-icon {
	width: 26px;
	height: 26px;
}
.solink-header__cart .solink-icon circle[fill="currentColor"] {
	fill: currentColor;
	stroke: none;
}
/* Safety net: prevent external rules (e.g. img{max-width:100%}) from
   stretching/shrinking our inline SVG icons. */
.solink-header svg.solink-icon,
.solink-header__mobile svg {
	max-width: none;
}

/* Cart count badge */
.solink-header__cart-count {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: var(--solink-red);
	color: var(--white);
	font-size: 10px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	pointer-events: none;
	box-sizing: border-box;
}
.solink-header__cart-count.is-empty {
	display: none;
}

/* Hamburger hidden on desktop */
.solink-header__menu-toggle {
	display: none;
}

/* ---- Search panel ---- */
.solink-header__search-panel {
	border-top: 1px solid rgba(107, 107, 107, 0);
	background: var(--white);
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transform: translateY(-6px);
	transition:
		max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
		opacity 220ms ease,
		transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
		border-top-color 220ms ease;
	will-change: max-height, opacity, transform;
}
.solink-header__search-panel.is-open {
	max-height: 220px;
	opacity: 1;
	transform: translateY(0);
	border-top-color: rgba(107, 107, 107, 0.15);
}
/* When hidden via the `hidden` attribute (initial state / after close),
   keep it visually collapsed but don't use display:none, so transitions work
   when toggling. The JS removes [hidden] before adding .is-open, and re-adds
   it after the close transition completes. */
.solink-header__search-panel[hidden] {
	display: block;
	max-height: 0;
	opacity: 0;
	transform: translateY(-6px);
	border-top-color: rgba(107, 107, 107, 0);
	pointer-events: none;
	visibility: hidden;
}
.solink-header__search-form {
	max-width: 1320px;
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	gap: 12px;
	align-items: center;
}
.solink-header__search-input {
	flex: 1;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 15px;
	color: var(--deep-black);
	background: var(--white);
	border: 1px solid rgba(107, 107, 107, 0.35);
	border-radius: 8px;
	outline: none;
	transition: border-color 150ms ease;
}
.solink-header__search-input:focus {
	border-color: var(--solink-red);
}
.solink-header__search-submit {
	white-space: nowrap;
}

/* ---- Mobile off-canvas ---- */
.solink-header__mobile {
	position: fixed;
	inset: 0;
	z-index: 1100;
}
.solink-header__mobile[hidden] {
	display: none;
}
.solink-header__mobile-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.5);
	opacity: 0;
	transition: opacity 250ms ease;
}
.solink-header__mobile-panel {
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(86vw, 360px);
	background: var(--white);
	box-shadow: -8px 0 24px rgba(26, 26, 26, 0.12);
	transform: translateX(100%);
	transition: transform 280ms ease;
	display: flex;
	flex-direction: column;
}
.solink-header__mobile.is-open .solink-header__mobile-backdrop {
	opacity: 1;
}
.solink-header__mobile.is-open .solink-header__mobile-panel {
	transform: translateX(0);
}
.solink-header__mobile-head {
	display: flex;
	justify-content: flex-end;
	padding: 16px;
	border-bottom: 1px solid rgba(107, 107, 107, 0.15);
}
.solink-header__mobile-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background: transparent;
	border: 0;
	color: var(--deep-black);
	cursor: pointer;
	border-radius: 4px;
	transition: color 150ms ease;
}
.solink-header__mobile-close:hover,
.solink-header__mobile-close:focus-visible {
	color: var(--solink-red);
}
.solink-header__mobile-close:focus-visible {
	outline: 2px solid var(--solink-red);
	outline-offset: 2px;
}
.solink-header__mobile-nav {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
}
.solink-header__mobile-menu,
.solink-header__mobile-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}
.solink-header__mobile-menu a {
	display: block;
	padding: 14px 24px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--deep-black);
	text-decoration: none;
	border-bottom: 1px solid rgba(107, 107, 107, 0.12);
	transition: color 150ms ease, background-color 150ms ease;
}
.solink-header__mobile-menu a:hover,
.solink-header__mobile-menu a:focus-visible,
.solink-header__mobile-menu .current-menu-item > a,
.solink-header__mobile-menu a[aria-current="page"] {
	color: var(--solink-red);
}
.solink-header__mobile-menu .sub-menu a {
	padding-left: 40px;
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
}

/* Body scroll lock helper */
body.solink-mobile-open {
	overflow: hidden;
}

/* ---- Mobile breakpoint ≤1024px ---- */
@media (max-width: 1024px) {
	.solink-header__inner {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 10px 12px;
		gap: 8px;
	}
	.solink-header__brand {
		margin-right: auto;
	}
	.solink-header__nav {
		display: none;
	}
	.solink-header__menu-toggle {
		display: inline-flex;
	}
	.solink-header__brand .custom-logo {
		height: 36px;
	}
	.solink-header__actions {
		gap: 0;
		margin-left: auto;
	}
	.solink-header__icon-btn {
		width: 36px;
		height: 36px;
	}
	.solink-header__search-form {
		padding: 12px 16px;
	}
}

/* Hide mobile toggle / off-canvas on desktop */
@media (min-width: 1025px) {
	.solink-header__mobile {
		display: none !important;
	}
}

/* ---- Hide HFE / parent-theme defaults if they leak through.
   Intentionally narrow: only target Hello Elementor's default site-header
   wrapper if our header is also on the page. HFE is meant to be deactivated
   before deploy, but this is a defense-in-depth fallback. ---- */

/* ---- Print ---- */
@media print {
	.solink-header,
	.solink-header__mobile {
		display: none !important;
	}
}
