/* ==========================================================================
   Custom store header
   ========================================================================== */

/* Default accent; the Customizer color is printed later in <head> and overrides it. */
:root {
	--xh-accent: #fcb92d;
	--xh-accent-hover: #f6a201;
	--xh-accent-text: #000;
}

.xh-header {
	--xh-black: #000;
	--xh-nav-text: #6b6b6b;
	--xh-font: "Barlow", "Rubik", "Segoe UI", Roboto, Arial, sans-serif;
	position: relative;
	z-index: 390;
	font-family: var(--xh-font);
}

.xh-header *,
.xh-header *::before,
.xh-header *::after { box-sizing: border-box; }

.xh-container {
	max-width: 1440px;
	margin-inline: auto;
	padding-inline: 20px;
}

/* ---------- Top announcement bar ---------- */
.xh-topbar {
	background: #fff;
	text-align: center;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	padding-block: 11px;
}
.xh-topbar-inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 18px;
}
.xh-topbar .xh-topbar-text { color: #111; }
.xh-topbar a.xh-topbar-text:hover { text-decoration: underline; }

.xh-topbar-social {
	position: absolute;
	top: 50%;
	right: 20px;
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translateY(-50%);
}
.xh-topbar-social li { margin: 0; list-style: none; }
.xh-header .xh-topbar-social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f3f4f6;
	color: #111;
	transition: background-color .3s ease-out, transform .3s ease-out;
}
.xh-header .xh-topbar-social a:hover { background: var(--xh-accent); transform: translateY(-2px); }
.xh-topbar-social svg { width: 14px; height: 14px; }

/* ---------- Main black bar ---------- */
.xh-main { background: var(--xh-black); color: #fff; }

.xh-main-inner {
	display: flex;
	align-items: center;
	gap: 40px;
	min-height: 100px;
}

.xh-logo { flex: 0 0 auto; display: flex; align-items: center; }
.xh-logo img { display: block; max-height: 76px; width: auto; max-width: 230px; }
.xh-logo-text { color: #fff; font-size: 24px; font-weight: 700; }

/* Search */
.xh-search {
	flex: 1 1 auto;
	display: flex;
	height: 44px;
	margin: 0;
	background: #fff;
	border-radius: 3px;
	overflow: hidden;
}
.xh-header .xh-search input[type="search"] {
	flex: 1 1 auto;
	height: 100%;
	min-width: 0;
	margin: 0;
	padding: 0 15px;
	border: 0;
	border-radius: 0;
	background: #fff;
	color: #222;
	font-size: 15px;
	box-shadow: none;
}
.xh-header .xh-search input[type="search"]::placeholder { color: #333; opacity: 1; }
.xh-header .xh-search button {
	flex: 0 0 50px;
	height: 100%;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--xh-accent);
	color: var(--xh-accent-text);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s;
}
.xh-header .xh-search button:hover { background: var(--xh-accent-hover); }

/* Account */
.xh-account {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-right: 32px;
	border-right: 1px solid #333;
	line-height: 1.2;
}
.xh-header .xh-account-hello { color: #fff; font-size: 14px; font-weight: 500; }
.xh-header .xh-account-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
}
.xh-header .xh-account a:hover { color: var(--xh-accent); }

.xh-account-menu {
	position: absolute;
	top: 100%;
	left: -15px;
	min-width: 200px;
	margin: 10px 0 0;
	padding: 8px 0;
	list-style: none;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all .2s;
	z-index: 50;
}
.xh-account-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.xh-account:hover .xh-account-menu,
.xh-account:focus-within .xh-account-menu { opacity: 1; visibility: visible; transform: none; }
.xh-account-menu li { margin: 0; }
.xh-header .xh-account-menu a { display: block; padding: 8px 18px; color: #333; font-size: 14px; }
.xh-header .xh-account-menu a:hover { background: #fff6e0; color: #000; }

/* Cart */
.xh-header .xh-cart {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 14px;
	color: #fff;
}
.xh-cart-icon { position: relative; display: flex; }
.xh-cart-count {
	position: absolute;
	top: -8px;
	right: -8px;
	min-width: 19px;
	height: 19px;
	padding: 0 4px;
	border-radius: 50%;
	background: var(--xh-accent);
	color: var(--xh-accent-text);
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
}
.xh-cart-label { font-size: 17px; font-weight: 600; }
.xh-header .xh-cart:hover .xh-cart-label { color: var(--xh-accent); }

/* ---------- Navigation bar ---------- */
.xh-nav {
	background: #fff;
	border-bottom: 1px solid #eee;
}
.xh-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 36px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.xh-menu li { position: relative; margin: 0; list-style: none; }
.xh-header .xh-menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding-block: 22px;
	color: var(--xh-nav-text);
	font-size: 17px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1;
	transition: color .2s;
}
.xh-header .xh-menu > li > a:hover,
.xh-header .xh-menu > li:hover > a,
.xh-header .xh-menu > li.current-menu-item > a { color: #111; }

/* Chevron on items with a submenu */
.xh-menu > li.menu-item-has-children > a::after,
.xh-mobile-menu li.menu-item-has-children > a::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s;
}

/* Dropdowns */
.xh-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: -18px;
	min-width: 230px;
	margin: 0;
	padding: 10px 0;
	list-style: none;
	background: #fff;
	border-top: 2px solid var(--xh-accent);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all .2s;
	z-index: 60;
}
.xh-menu .sub-menu .sub-menu { top: -12px; left: 100%; }
.xh-menu li:hover > .sub-menu,
.xh-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.xh-header .xh-menu .sub-menu a {
	display: block;
	padding: 9px 20px;
	color: #444;
	font-size: 15px;
	font-weight: 400;
}
.xh-header .xh-menu .sub-menu a:hover { background: #fff6e0; color: #000; }
.xh-menu .sub-menu li.menu-item-has-children > a::after {
	content: "";
	float: right;
	width: 6px;
	height: 6px;
	margin-top: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}

/* ---------- Mobile ---------- */
.xh-burger { display: none; }
.xh-drawer { display: none; }

@media (max-width: 1024px) {
	.xh-main-inner {
		flex-wrap: wrap;
		gap: 12px 16px;
		min-height: 0;
		padding-block: 12px;
	}
	.xh-header .xh-burger {
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 34px;
		height: 34px;
		min-height: 0;
		padding: 0;
		border: 0;
		background: none;
		cursor: pointer;
	}
	.xh-burger span { display: block; width: 24px; height: 2px; background: #fff; }
	.xh-logo { margin-right: auto; }
	.xh-logo img { max-height: 46px; max-width: 140px; }
	.xh-account { display: none; }
	.xh-cart-label { display: none; }
	.xh-search { order: 5; flex-basis: 100%; height: 42px; }
	.xh-nav { display: none; }
	.xh-topbar { font-size: 12px; padding-block: 8px; }
	.xh-topbar-social { display: none; }

	.xh-drawer {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 2147483000;
		background: rgba(0, 0, 0, .5);
		opacity: 0;
		visibility: hidden;
		transition: all .25s;
	}
	.xh-drawer.is-open { opacity: 1; visibility: visible; }
	.xh-drawer-panel {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(320px, 85vw);
		overflow-y: auto;
		background: #fff;
		transform: translateX(-100%);
		transition: transform .25s;
	}
	.xh-drawer.is-open .xh-drawer-panel { transform: none; }
	.xh-drawer-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 18px;
		background: var(--xh-black);
		color: #fff;
		font-size: 17px;
		font-weight: 600;
	}
	.xh-header .xh-drawer-close {
		min-height: 0;
		padding: 0;
		border: 0;
		background: none;
		color: #fff;
		font-size: 30px;
		line-height: 1;
		cursor: pointer;
	}
	.xh-mobile-menu,
	.xh-mobile-menu .sub-menu { margin: 0; padding: 0; list-style: none; }
	.xh-mobile-menu li { margin: 0; border-bottom: 1px solid #eee; list-style: none; }
	.xh-mobile-menu .sub-menu { display: none; background: #f7f7f7; }
	.xh-mobile-menu .sub-menu li:last-child { border-bottom: 0; }
	.xh-mobile-menu li.is-open > .sub-menu { display: block; }
	.xh-mobile-menu li.is-open > a::after { transform: rotate(-135deg); margin-top: 4px; }
	.xh-header .xh-mobile-menu a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 13px 18px;
		color: #333;
		font-size: 15px;
		font-weight: 500;
	}
	.xh-header .xh-mobile-menu .sub-menu a { padding-left: 30px; font-weight: 400; }
	.xh-header .xh-drawer-account {
		display: block;
		margin: 18px;
		padding: 12px;
		border-radius: 3px;
		background: var(--xh-accent);
		color: var(--xh-accent-text);
		font-weight: 600;
		text-align: center;
	}
	.xh-drawer-title {
		padding: 12px 18px;
		background: var(--xh-accent);
		color: var(--xh-accent-text);
		font-size: 14px;
		font-weight: 700;
		text-transform: uppercase;
	}
}

body.xh-drawer-open { overflow: hidden; }
/* The header is its own stacking context, so lift it above sticky bars while the drawer is open. */
body.xh-drawer-open .xh-header { z-index: 2147483000; }
