/**
 * Header layout: Sport — .espt-block-header.is-preset-sport
 *
 * One dark band (the heading colour pushed towards black, unless the block
 * sets its own background) with white type: shopper tabs and utility links
 * on top, a bold wordmark, the chosen tab's links, a compact translucent
 * search and the cart in the main row, and a brand strip for the note.
 * Phones and tablets: the logo row first, then the tabs and the tab's links
 * as sideways-scrolling rows. Colours come from the --hd-* tokens and the
 * block's own colour settings.
 */

/* Layout tokens, built from the theme tokens and the block settings. */
.espt-block-header.is-preset-sport {
	--hd-sport-band: var(--header-bg, color-mix(in srgb, var(--hd-ink) 94%, #000));
	--hd-sport-ink: var(--menu-color, #fff);
	--hd-sport-muted: color-mix(in srgb, var(--menu-color, #fff) 70%, transparent);
	--hd-sport-rule: color-mix(in srgb, var(--menu-color, #fff) 12%, transparent);
	--hd-sport-accent: var(--nav-accent, var(--hd-brand));
	--hd-sport-hot: var(--menu-hover, color-mix(in srgb, var(--hd-brand) 45%, #fff));
}

.espt-block-header.is-preset-sport .esptb-hd {
	background: var(--hd-sport-band);
	color: var(--hd-sport-ink);
}

/* ------------------------------------------- tier 1: tabs + utility links */

.espt-block-header.is-preset-sport .esptb-hd-sub-dept {
	border-bottom: 1px solid var(--hd-sport-rule);
	font-size: 13.5px;
	line-height: 1.3;
}

.espt-block-header.is-preset-sport .esptb-hd-sub-dept .esptb-hd-bar {
	align-items: stretch;
	gap: 18px;
	min-height: 40px;
}

/* Tabs + the other top-level links: one row that scrolls sideways. */
.espt-block-header.is-preset-sport .esptb-hd-dept {
	align-items: stretch;
	display: flex;
	flex: 1 1 auto;
	gap: 20px;
	min-width: 0;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.espt-block-header.is-preset-sport .esptb-hd-dept::-webkit-scrollbar,
.espt-block-header.is-preset-sport .esptb-hd-dept-r::-webkit-scrollbar,
.espt-block-header.is-preset-sport .esptb-hd-tp-row::-webkit-scrollbar { display: none; }

.espt-block-header.is-preset-sport .esptb-hd-dept-tabs {
	display: flex;
	flex: none;
	gap: 20px;
}

/* The tab buttons shed the theme's button look. */
.espt-block-header.is-preset-sport .esptb-hd-dept-tab {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--hd-sport-muted);
	cursor: pointer;
	display: inline-flex;
	flex: none;
	font: inherit;
	font-weight: 700;
	gap: 6px;
	letter-spacing: 0.02em;
	margin: 0;
	min-height: 40px;
	padding: 0 2px;
	position: relative;
	scroll-snap-align: start;
	text-transform: uppercase;
	transform: none;
	transition: color 0.15s ease;
	white-space: nowrap;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-tab::after {
	background: var(--hd-sport-accent);
	bottom: 0;
	content: "";
	height: 2px;
	left: 0;
	position: absolute;
	right: 0;
	transform: scaleX(0);
	transition: transform 0.2s ease;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-tab:hover,
.espt-block-header.is-preset-sport .esptb-hd-dept-tab:focus {
	background: transparent;
	color: var(--hd-sport-ink);
	transform: none;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-tab[aria-selected="true"] { color: var(--hd-sport-ink); }
.espt-block-header.is-preset-sport .esptb-hd-dept-tab[aria-selected="true"]::after { transform: none; }
.espt-block-header.is-preset-sport .esptb-hd-dept-tab .esptb-badge { margin-left: 0; }

.espt-block-header.is-preset-sport .esptb-hd-dept-links {
	align-items: center;
	display: flex;
	flex: none;
	gap: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* A hairline between the tabs and the plain links. */
.espt-block-header.is-preset-sport .esptb-hd-dept-links::before {
	background: color-mix(in srgb, var(--hd-sport-ink) 22%, transparent);
	content: "";
	flex: none;
	height: 16px;
	width: 1px;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-links a {
	align-items: center;
	color: var(--hd-sport-muted);
	display: inline-flex;
	font-weight: 600;
	letter-spacing: 0.02em;
	min-height: 40px;
	scroll-snap-align: start;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-links a:hover,
.espt-block-header.is-preset-sport .esptb-hd-dept-links a.is-current { color: var(--hd-sport-ink); }

/* Utility links (the right-hand top bar items): tablets and up. */
.espt-block-header.is-preset-sport .esptb-hd-dept-r { display: none; }

.espt-block-header.is-preset-sport .esptb-hd-dept-r .esptb-hd-tb-item,
.espt-block-header.is-preset-sport .esptb-hd-dept-r .esptb-hd-login {
	background: transparent;
	border-radius: 0;
	color: var(--hd-sport-muted);
	flex: none;
	font-weight: 600;
	min-height: 40px;
	padding: 0;
	white-space: nowrap;
}

.espt-block-header.is-preset-sport .esptb-hd-dept-r a:hover {
	background: transparent;
	color: var(--hd-sport-ink);
	opacity: 1;
}

/* Rows that scroll clip an outside focus ring — draw it inside. */
.espt-block-header.is-preset-sport .esptb-hd-dept-tab:focus-visible,
.espt-block-header.is-preset-sport .esptb-hd-dept-links a:focus-visible,
.espt-block-header.is-preset-sport .esptb-hd-dept-r a:focus-visible,
.espt-block-header.is-preset-sport .esptb-hd-tp-row a:focus-visible { outline-offset: -2px; }

/* ------------------------------------------------ tier 2: main row */

.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-logo { color: var(--hd-sport-ink); }

.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-logo-text {
	font-family: var(--hd-display);
	font-size: clamp(21px, 6vw, 30px);
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.05;
	text-transform: uppercase;
}

/* The logo's auto margin pushes search, icons and burger right as one group. */
.espt-block-header.is-preset-sport .esptb-hd-icons { gap: 4px; margin-left: 0; }

.espt-block-header.is-preset-sport .esptb-hd-icons > .espt-icon-btn,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-icon .espt-cart-btn,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-label,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-label .espt-cart-btn,
.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-burger { color: var(--icons-color, var(--hd-sport-ink)); }

.espt-block-header.is-preset-sport .esptb-hd-icons > .espt-icon-btn:hover,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-icon .espt-cart-btn:hover,
.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-burger:hover {
	background: color-mix(in srgb, var(--hd-sport-ink) 12%, transparent);
	color: var(--icons-color, var(--hd-sport-ink));
}

/* 40px tap targets on every screen (the base gives phones 36 x 38). */
.espt-block-header.is-preset-sport .esptb-hd-icons > .espt-icon-btn,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-icon .espt-cart-btn,
.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-total .espt-cart-btn,
.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-burger {
	box-shadow: none; /* the theme's global button shadow + hover lift */
	height: 40px;
	transform: none;
	width: 40px;
}

.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-label .espt-cart-btn { min-height: 40px; }

/* A ring in the band colour lifts the count bubble off the dark row. */
.espt-block-header.is-preset-sport .esptb-hd-cart:not(.is-cart-total) .espt-cart-count { box-shadow: 0 0 0 2px var(--hd-sport-band); }

/* Compact translucent search: a solid tint of the band, so nothing shows
   through when it grows over the menu. */
.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form input[type="search"] {
	background: var(--search-bg, color-mix(in srgb, var(--hd-sport-ink) 12%, var(--hd-sport-band)));
	border-color: var(--search-line, color-mix(in srgb, var(--hd-sport-ink) 20%, transparent));
	color: var(--hd-sport-ink);
	font-size: 14px;
	padding: 9px 38px 9px 14px;
}

.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form input[type="search"]::placeholder {
	color: var(--hd-sport-muted);
	opacity: 1;
}

.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form input[type="search"]:focus {
	background: var(--search-bg, color-mix(in srgb, var(--hd-sport-ink) 18%, var(--hd-sport-band)));
	border-color: var(--hd-sport-accent);
}

.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form .button {
	box-shadow: none;
	color: var(--hd-sport-muted);
	height: 32px;
	right: 4px;
	width: 32px;
}

.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form .button:hover { color: var(--hd-sport-ink); }

/* Live results: wider than the field, dark text on the theme's panel. */
.espt-block-header.is-preset-sport .esptb-hd-main .espt-search-form .espt-sr {
	color: var(--hd-ink);
	left: auto;
	right: 0;
	width: min(380px, calc(100vw - 32px));
}

/* Phones and tablets: the chosen tab's links as a scrolling row. */
.espt-block-header.is-preset-sport .esptb-hd-sub-panels { background: color-mix(in srgb, var(--hd-sport-ink) 6%, transparent); }
.espt-block-header.is-preset-sport .esptb-hd-tp-nav { flex: 1 1 auto; min-width: 0; }
.espt-block-header.is-preset-sport .esptb-hd-tp[hidden] { display: none; }

.espt-block-header.is-preset-sport .esptb-hd-tp-row {
	display: flex;
	gap: 20px;
	list-style: none;
	margin: 0;
	overflow-x: auto;
	padding: 0;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.espt-block-header.is-preset-sport .esptb-hd-tp-row li { flex: none; scroll-snap-align: start; }

.espt-block-header.is-preset-sport .esptb-hd-tp-row a {
	align-items: center;
	color: var(--hd-sport-muted);
	display: inline-flex;
	font-size: 13.5px;
	font-weight: 600;
	min-height: 40px;
	text-decoration: none;
	white-space: nowrap;
}

.espt-block-header.is-preset-sport .esptb-hd-tp-row a:hover,
.espt-block-header.is-preset-sport .esptb-hd-tp-row a.is-current { color: var(--hd-sport-ink); }
.espt-block-header.is-preset-sport .esptb-hd-tp-row a.esptb-hd-tp-all { color: var(--hd-sport-hot); font-weight: 700; }

/* ------------------------------------------------ tier 3: brand strip */

.espt-block-header.is-preset-sport .esptb-hd-sub-note {
	background: var(--topbar-bg, var(--hd-brand));
	color: var(--topbar-color, #fff);
	font-size: calc(var(--topbar-size, 13px) - 0.5px);
	font-weight: 700;
	line-height: 1.35;
}

.espt-block-header.is-preset-sport .esptb-hd-sub-note .esptb-hd-bar {
	flex-wrap: wrap;
	gap: 4px 18px;
	justify-content: center;
	padding-bottom: 7px;
	padding-top: 7px;
	text-align: center;
}

/* ------------------------------------------------------- breakpoints */

@media (max-width: 599px) {
	/* The total look folds to its icon on phones: keep it white. */
	.espt-block-header.is-preset-sport .esptb-hd-cart.is-cart-total { color: var(--icons-color, var(--hd-sport-ink)); }
}

@media (max-width: 767px) {
	/* Phones: the menu lives in the burger's panel (Menu / Categories), so
	   the desktop rows — the tabs with their links, the chosen tab's links,
	   and the utility links — stay out of the header. */
	.espt-block-header.is-preset-sport .esptb-hd-sport > .esptb-hd-sub-dept,
	.espt-block-header.is-preset-sport .esptb-hd-sport > .esptb-hd-sub-panels { display: none; }
}

@media (max-width: 1023px) {
	/* Logo row first, then the tabs, then the chosen tab's links. */
	.espt-block-header.is-preset-sport .esptb-hd-sport.has-tabs {
		display: flex;
		flex-direction: column;
	}

	.espt-block-header.is-preset-sport .esptb-hd-sport.has-tabs > .esptb-hd-main { order: 1; }

	.espt-block-header.is-preset-sport .esptb-hd-sport.has-tabs > .esptb-hd-sub-dept {
		border-bottom: 0;
		border-top: 1px solid var(--hd-sport-rule);
		order: 2;
	}

	.espt-block-header.is-preset-sport .esptb-hd-sport.has-tabs > .esptb-hd-sub-panels { order: 3; }
}

@media (min-width: 600px) {
	/* 150px in the row; the field grows to 200px over its left side while
	   typing, so neither the logo nor the menu moves. */
	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-searchbar {
		display: block;
		flex: 0 0 150px;
		height: 40px;
		order: 2;
		position: relative;
		width: 150px;
	}

	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-searchbar .espt-search-form {
		position: absolute;
		right: 0;
		top: 0;
		transition: width 0.22s ease;
		width: 100%;
	}

	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-searchbar .espt-search-form:focus-within { width: 200px; }
}

@media (min-width: 768px) {
	.espt-block-header.is-preset-sport .esptb-hd-dept-r {
		align-items: center;
		display: flex;
		flex: none;
		font-size: calc(var(--topbar-size, 13px) - 0.5px);
		gap: 18px;
		margin-left: auto;
		max-width: 50%;
		overflow-x: auto;
		scrollbar-width: none;
	}
}

@media (min-width: 1024px) {
	.espt-block-header.is-preset-sport .esptb-hd-sub-panels { display: none; }

	/* A long top tier wraps rather than hiding tabs behind a mouse scroll. */
	.espt-block-header.is-preset-sport .esptb-hd-dept { flex-wrap: wrap; overflow: visible; row-gap: 0; }

	.espt-block-header.is-preset-sport .esptb-hd-dept-tabs,
	.espt-block-header.is-preset-sport .esptb-hd-dept-links { flex-wrap: wrap; }

	/* When the tier wraps, the utility links stay on its first line. */
	.espt-block-header.is-preset-sport .esptb-hd-dept-r { align-self: flex-start; min-height: 40px; }

	/* The menu fills the middle; with no menu the logo's margin still
	   keeps search and icons on the right. The wordmark never shrinks for a
	   long tab (the base lets it, which squeezed it); the tab's links wrap. */
	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-logo {
		flex-shrink: 0;
		margin-right: auto;
		max-width: 40%;
	}
	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-searchbar { order: 0; }
	.espt-block-header.is-preset-sport .esptb-nav-main .espt-hd-menu { justify-content: flex-start; }
	.espt-block-header.is-preset-sport .esptb-hd-dept-nav { align-items: center; }
	.espt-block-header.is-preset-sport .esptb-hd-dept-nav .esptb-hd-tp { flex: 1 1 auto; min-width: 0; }

	.espt-block-header.is-preset-sport .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li > a { color: var(--hd-sport-ink); }

	.espt-block-header.is-preset-sport .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li > a:hover,
	.espt-block-header.is-preset-sport .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li.current-menu-item > a,
	.espt-block-header.is-preset-sport .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li > a.esptb-hd-tp-all { color: var(--hd-sport-hot); }

	.espt-block-header.is-preset-sport.is-nav-fx-pill .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li > a:hover,
	.espt-block-header.is-preset-sport.is-nav-fx-box .esptb-nav:not(.esptb-nav-panel) .espt-hd-menu > li > a:hover {
		background: var(--nav-accent, color-mix(in srgb, var(--hd-sport-ink) 12%, transparent));
	}
}

@media (prefers-reduced-motion: reduce) {
	.espt-block-header.is-preset-sport .esptb-hd-dept-tab,
	.espt-block-header.is-preset-sport .esptb-hd-dept-tab::after,
	.espt-block-header.is-preset-sport .esptb-hd-main .esptb-hd-searchbar .espt-search-form { transition: none; }
}
