/* ITEMPLS — header, primary navigation, mobile drawer.
 *
 * The legacy header buried the catalogue behind a generic menu. This one is
 * built around the six things a shopper actually wants within one click:
 * the item classes, search, account, cart.
 *
 * Ladder/Non-Ladder appears in the header as a *filter affordance*, never as
 * a second navigation tree. Duplicating the class menu per mode would
 * recreate at navigation level exactly the cannibalisation that
 * consolidation removed at product level.
 */

.it-header {
	position: sticky;
	top: 0;
	z-index: 200;
	background: rgba(11, 14, 19, 0.92);
	backdrop-filter: saturate(150%) blur(10px);
	border-bottom: 1px solid var(--it-line);
}

.it-header__bar {
	display: flex;
	align-items: center;
	gap: var(--it-s4);
	min-height: 64px;
}

/* ------------------------------------------------------------- brand */
.it-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.it-brand__mark { height: 30px; width: auto; display: block; }
.it-brand:hover { opacity: .9; }

/* ------------------------------------------------------------- search */
.it-search {
	flex: 1 1 auto;
	max-width: 520px;
	position: relative;
	display: flex;
}
.it-search input[type=search] {
	padding-left: 38px;
	background: var(--it-surface-3);
	border-radius: var(--it-r-pill);
}
.it-search__icon {
	position: absolute;
	left: 13px; top: 50%; transform: translateY(-50%);
	color: var(--it-text-faint);
	pointer-events: none;
	display: flex;
}

/* --------------------------------------------------------- header actions */
.it-actions { display: flex; align-items: center; gap: var(--it-s2); margin-left: auto; }
.it-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border-radius: var(--it-r);
	color: var(--it-text-muted);
	background: transparent;
	border: 1px solid transparent;
	cursor: pointer;
}
.it-iconbtn:hover { background: var(--it-surface-2); color: var(--it-text); }
.it-iconbtn__label { font-size: var(--it-fs-sm); font-weight: 600; }
@media (max-width: 900px) { .it-iconbtn__label { display: none; } }

.it-cartbtn { position: relative; }
.it-cartbtn__count {
	position: absolute;
	top: 4px; right: 4px;
	min-width: 18px; height: 18px;
	padding: 0 5px;
	border-radius: var(--it-r-pill);
	background: var(--it-accent);
	color: var(--it-text-on-accent);
	font-size: 11px; font-weight: 700; line-height: 18px;
	text-align: center;
}

/* ------------------------------------------------------------ class nav */
.it-nav { border-top: 1px solid var(--it-line); }
.it-nav__list {
	display: flex;
	align-items: center;
	gap: var(--it-s1);
	margin: 0; padding: 0;
	list-style: none;
	/* Horizontal scroll INSIDE the nav is fine and expected on a phone; the
	 * page itself must never scroll sideways. */
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.it-nav__list::-webkit-scrollbar { display: none; }
.it-nav__list a {
	display: inline-block;
	padding: 12px 14px;
	color: var(--it-text-muted);
	font-size: var(--it-fs-sm);
	font-weight: 600;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
}
.it-nav__list a:hover { color: var(--it-text); }
.it-nav__list .is-active a,
.it-nav__list a[aria-current="page"] {
	color: var(--it-text);
	border-bottom-color: var(--it-accent);
}

/* ------------------------------------------------- mode switch in the header */
.it-modeswitch {
	display: inline-flex;
	padding: 3px;
	background: var(--it-surface-3);
	border: 1px solid var(--it-line);
	border-radius: var(--it-r-pill);
	flex: none;
}
.it-modeswitch a {
	padding: 6px 14px;
	border-radius: var(--it-r-pill);
	font-size: var(--it-fs-sm);
	font-weight: 650;
	color: var(--it-text-muted);
	white-space: nowrap;
}
.it-modeswitch a[aria-current="true"] { color: var(--it-text); }
.it-modeswitch a.is-ladder[aria-current="true"] {
	background: var(--it-ladder-soft); color: var(--it-ladder);
}
.it-modeswitch a.is-nonladder[aria-current="true"] {
	background: var(--it-nonladder-soft); color: var(--it-nonladder);
}

/* --------------------------------------------------------- mobile drawer */
.it-burger { display: none; }
@media (max-width: 860px) {
	.it-burger { display: inline-flex; }
	.it-header__bar { gap: var(--it-s2); }
	.it-search { order: 10; flex-basis: 100%; max-width: none; padding-bottom: var(--it-s3); }
	.it-header__bar { flex-wrap: wrap; }
}

.it-drawer {
	position: fixed;
	inset: 0 auto 0 0;
	width: min(84vw, 340px);
	background: var(--it-surface);
	border-right: 1px solid var(--it-line);
	z-index: 400;
	padding: var(--it-s5);
	overflow-y: auto;
	transform: translateX(-100%);
	transition: transform var(--it-t);
}
.it-drawer[data-open="true"] { transform: none; }
.it-drawer__list { list-style: none; margin: var(--it-s4) 0 0; padding: 0; }
.it-drawer__list a {
	display: block;
	padding: 12px 6px;
	color: var(--it-text);
	font-weight: 600;
	border-bottom: 1px solid var(--it-line);
}
.it-scrim {
	position: fixed; inset: 0;
	background: rgba(0,0,0,.6);
	z-index: 390;
	opacity: 0; pointer-events: none;
	transition: opacity var(--it-t);
}
.it-scrim[data-open="true"] { opacity: 1; pointer-events: auto; }

/* Hide the parent theme's header entirely rather than restyling it. */
.site-header, header.site-header, .shoptimizer-mobile-toggle,
.mobile-extra, .header-widget-region { display: none !important; }

/* The parent theme's header is not one element. Hiding .site-header left the
 * primary-nav bar (.col-full-nav: "D2R Ladder | D2R Non-Ladder | $0.00") and
 * the logo row rendering under the new header, because Shoptimizer places them
 * outside .site-header. They are replaced here, not restyled. */
.col-full-nav,
.main-header,
.header-widget-region,
.shoptimizer-primary-navigation { display: none !important; }

/* On phones the full header (logo row, search row, category strip) stayed
 * pinned at ~160px -- over a fifth of a 740px screen, on every page, for the
 * whole visit. Below 860px it scrolls away with the page; the menu drawer
 * holds the same categories, and the cart is one scroll up. */
@media (max-width: 860px) {
	.it-header { position: relative; }
}

/* 320px phones: burger + wordmark + two icons did not fit one row, so the
 * account and cart icons dropped to a line of their own. */
@media (max-width: 380px) {
	.it-header__bar { gap: 4px; }
	.it-actions { gap: 0; }
	.it-iconbtn { padding-inline: 6px !important; min-width: 0; }
	.it-brand__mark { height: 26px; }
}
