/*
 * Truck Ustaaz Pro - Header
 * Foundation + Customizer-driven sizing.
 */

:root {
	--tu-logo-scale: 1;
	--tu-title-size: 18px;
	--tu-tagline-size: 12px;
	--tu-branding-gap: 8px;
	--tu-search-width: 35%;
	--tu-icon-size: 20px;
}

.tu-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tu-header {
	position: relative;
	border-bottom: 1px solid rgba(0, 255, 224, 0.18);
	background: rgba(255, 255, 255, 0.04);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

body.tu-light .tu-header {
	border-bottom: 1px solid rgba(22, 160, 255, 0.18);
	background: rgba(255, 255, 255, 0.70);
}

.tu-header__inner {
	display: flex;
	flex-wrap: nowrap;
	gap: 12px;
	align-items: center;
	max-width: 100%;
	margin: 0 auto;
	padding: 12px 16px;
}

.tu-header:before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(0, 255, 224, 0.55), transparent);
	filter: drop-shadow(0 0 14px rgba(0, 255, 224, 0.25));
}

body.tu-light .tu-header:before {
	background: linear-gradient(90deg, transparent, rgba(22, 160, 255, 0.55), transparent);
	filter: drop-shadow(0 0 14px rgba(22, 160, 255, 0.18));
}

/* Branding */
.tu-header__branding {
	display: flex;
	align-items: center;
	gap: var(--tu-branding-gap);
	min-width: 0;
}

.tu-header__logo {
	display: flex;
	align-items: center;
}

.tu-header__logo a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.tu-header__logo img {
	height: auto;
	max-height: calc(44px * var(--tu-logo-scale));
	width: auto;
	display: block;
}

.tu-logo-fallback {
	display: inline-flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.92);
	font-weight: 700;
	letter-spacing: 0.02em;
}

body.tu-light .tu-logo-fallback {
	background: rgba(0, 0, 0, 0.05);
	color: #0b1020;
}

.tu-header__titleblock {
	min-width: 0;
}

.tu-site-title {
	margin: 0;
	font-size: var(--tu-title-size);
	line-height: 1.2;
	font-weight: 700;
}

.tu-site-title a {
	color: inherit;
	text-decoration: none;
}

.tu-site-tagline {
	margin: 2px 0 0;
	font-size: var(--tu-tagline-size);
	line-height: 1.3;
	opacity: 0.82;
}

/* Search */
.tu-header__search {
	width: min(100%, var(--tu-search-width));
	max-width: 680px;
	flex: 0 1 auto;
}

.tu-header__search form {
	display: flex;
	gap: 8px;
}

.tu-header__search input[type="search"],
.tu-header__search input[type="text"] {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid rgba(0, 255, 224, 0.18);
	background: rgba(255, 255, 255, 0.06);
	color: inherit;
	box-shadow: 0 0 0 4px rgba(0, 255, 224, 0.06);
}

body.tu-light .tu-header__search input[type="search"],
body.tu-light .tu-header__search input[type="text"] {
	border: 1px solid rgba(22, 160, 255, 0.18);
	background: rgba(255, 255, 255, 0.80);
	box-shadow: 0 0 0 4px rgba(22, 160, 255, 0.06);
}

.tu-header__search button,
.tu-header__search input[type="submit"] {
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid rgba(0, 255, 224, 0.26);
	background: linear-gradient(135deg, rgba(0, 255, 224, 0.18), rgba(22, 160, 255, 0.14));
	color: inherit;
	box-shadow: 0 10px 30px rgba(0, 255, 224, 0.10);
}

body.tu-light .tu-header__search button,
body.tu-light .tu-header__search input[type="submit"] {
	border: 1px solid rgba(22, 160, 255, 0.26);
	box-shadow: 0 10px 30px rgba(22, 160, 255, 0.10);
}

/* Nav */
.tu-header__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	border: 1px solid rgba(0, 255, 224, 0.22);
	background: rgba(255, 255, 255, 0.04);
}

body.tu-light .tu-header__toggle {
	border: 1px solid rgba(22, 160, 255, 0.22);
	background: rgba(255, 255, 255, 0.70);
}

.tu-header__search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 10px;
	border: 1px solid rgba(0, 255, 224, 0.22);
	background: rgba(255, 255, 255, 0.04);
}

body.tu-light .tu-header__search-toggle {
	border: 1px solid rgba(22, 160, 255, 0.22);
	background: rgba(255, 255, 255, 0.70);
}

.tu-header__nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: flex-end;
}

.tu-menu {
	display: flex;
	gap: 14px;
	list-style: none;
	padding: 0;
	margin: 0;
	align-items: center;
}

.tu-menu a {
	text-decoration: none;
	color: inherit;
	padding: 8px 6px;
	display: inline-flex;
	align-items: center;
}

.tu-menu .menu-item-has-children {
	position: relative;
}

.tu-menu .sub-menu {
	display: none;
	position: absolute;
	left: 0;
	top: 100%;
	min-width: 200px;
	background: rgba(10, 14, 24, 0.95);
	border: 1px solid rgba(0, 255, 224, 0.18);
	border-radius: 12px;
	padding: 8px;
	margin: 6px 0 0;
	list-style: none;
	z-index: 50;
}

body.tu-light .tu-menu .sub-menu {
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(22, 160, 255, 0.18);
}

.tu-menu .sub-menu a {
	padding: 8px 10px;
	width: 100%;
}

.tu-menu .menu-item-has-children:focus-within > .sub-menu,
.tu-menu .menu-item-has-children:hover > .sub-menu {
	display: block;
}

/* Actions */
.tu-header__actions {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	flex: 0 0 auto;
}

.tu-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	border: 1px solid rgba(0, 0, 0, 0.16);
	border-radius: 10px;
	background: transparent;
	color: #111;
	min-height: var(--tu-btn-size, 40px);
	padding: 8px 10px;
	cursor: pointer;
	transition: all 0.3s ease;
}

/* Dark / Cyber Mode Styles for Buttons */
body.tu-dark .tu-action,
body:not(.tu-light):not(.tu-dark) .tu-action {
	color: #00ffe0; /* Cyber Teal */
	border-color: rgba(0, 255, 224, 0.35);
	background: rgba(0, 255, 224, 0.03);
	box-shadow: 0 0 8px rgba(0, 255, 224, 0.15);
	text-shadow: 0 0 2px rgba(0, 255, 224, 0.3);
}

/* Force icons (both SVG and IMG) to Cyber Teal color in Dark Mode */
body.tu-dark .tu-action .tu-svg-icon,
body:not(.tu-light):not(.tu-dark) .tu-action .tu-svg-icon {
	/* 1. Reset base color to black so default stroke="currentColor" becomes black */
	color: #000;
	/* 2. Apply filter to turn black content (SVG stroke/fill or IMG pixels) into Neon Teal (#00ffe0) */
	filter: invert(76%) sepia(50%) saturate(2971%) hue-rotate(119deg) brightness(101%) contrast(101%) drop-shadow(0 0 2px rgba(0, 255, 224, 0.6));
}

/* Prevent double coloring if user hovers */
body.tu-dark .tu-action:hover .tu-svg-icon,
body:not(.tu-light):not(.tu-dark) .tu-action:hover .tu-svg-icon {
	/* Make it slightly brighter white-teal on hover */
	filter: invert(100%) drop-shadow(0 0 5px rgba(0, 255, 224, 1));
}

body.tu-dark .tu-action:hover,
body:not(.tu-light):not(.tu-dark) .tu-action:hover {
	color: #fff;
	border-color: #00ffe0;
	background: rgba(0, 255, 224, 0.15);
	box-shadow: 0 0 15px rgba(0, 255, 224, 0.5), inset 0 0 10px rgba(0, 255, 224, 0.2);
	text-shadow: 0 0 8px rgba(0, 255, 224, 0.8);
}

.tu-header.tu-btn-borderless .tu-action {
	border-color: transparent;
	box-shadow: none;
}

/* Borderless Dark Mode specific behavior */
body.tu-dark .tu-header.tu-btn-borderless .tu-action,
body:not(.tu-light):not(.tu-dark) .tu-header.tu-btn-borderless .tu-action {
	border-color: transparent;
	box-shadow: none;
	background: transparent;
}

body.tu-dark .tu-header.tu-btn-borderless .tu-action:hover,
body:not(.tu-light):not(.tu-dark) .tu-header.tu-btn-borderless .tu-action:hover {
	background: rgba(0, 255, 224, 0.08);
	box-shadow: 0 0 15px rgba(0, 255, 224, 0.3);
}

.tu-action--account,
.tu-action--cart,
.tu-action--language,
.tu-action--mode {
	min-width: var(--tu-btn-size, 40px);
	padding: 0;
}

.tu-svg-icon svg {
	width: var(--tu-icon-size);
	height: var(--tu-icon-size);
	display: block;
}

/* 
 * Mode Toggle Icons:
 * .tu-icon-light: Shows the "Switch to Light Mode" icon (Sun) when theme is DARK.
 * .tu-icon-dark: Shows the "Switch to Dark Mode" icon (Moon) when theme is LIGHT.
 */
.tu-icon-light, .tu-icon-dark {
	display: none;
}

/* When Body is DARK: 
   - We are in dark mode.
   - Show the Sun (.tu-icon-light) to allow switching to light.
*/
body.tu-dark .tu-icon-light {
	display: block;
}

/* When Body is LIGHT: 
   - We are in light mode.
   - Show the Moon (.tu-icon-dark) to allow switching to dark.
*/
body.tu-light .tu-icon-dark {
	display: block;
}

/* Default fallback if body class is missing (assume dark) */
body:not(.tu-light):not(.tu-dark) .tu-icon-light {
	display: block;
}

.tu-avatar {
	border-radius: 999px;
	box-shadow: 0 0 0 3px rgba(0, 255, 224, 0.12);
}

body.tu-light .tu-avatar {
	box-shadow: 0 0 0 3px rgba(22, 160, 255, 0.10);
}

.tu-cart-link {
	position: relative;
}

.tu-cart-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
	background: rgba(0, 255, 224, 0.22);
	border: 1px solid rgba(0, 255, 224, 0.40);
}

body.tu-light .tu-cart-count {
	background: rgba(22, 160, 255, 0.18);
	border: 1px solid rgba(22, 160, 255, 0.34);
}

/* Mobile */
@media (max-width: 960px) {
	.tu-header__toggle {
		display: inline-flex;
	}

	.tu-header__search-toggle {
		display: inline-flex;
	}

	.tu-header__nav {
		display: none;
		position: absolute;
		left: 16px;
		right: 16px;
		top: calc(100% + 10px);
		padding: 12px;
		border-radius: 16px;
		background: rgba(10, 14, 24, 0.95);
		border: 1px solid rgba(0, 255, 224, 0.18);
		box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
		z-index: 80;
	}

	body.tu-light .tu-header__nav {
		background: rgba(255, 255, 255, 0.95);
		border: 1px solid rgba(22, 160, 255, 0.18);
	}

	body.tu-nav-open .tu-header__nav {
		display: block;
	}

	.tu-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
	}

	.tu-menu a {
		padding: 10px 10px;
		border-radius: 12px;
		background: rgba(255, 255, 255, 0.05);
		border: 1px solid rgba(0, 255, 224, 0.12);
	}

	body.tu-light .tu-menu a {
		background: rgba(0, 0, 0, 0.03);
		border: 1px solid rgba(22, 160, 255, 0.10);
	}

	.tu-header__search {
		display: none;
		position: absolute;
		left: 16px;
		right: 16px;
		top: calc(100% + 10px);
		z-index: 90;
	}

	body.tu-search-open .tu-header__search {
		display: block;
	}

	body.tu-search-open .tu-header__nav {
		display: none;
	}

	.tu-action__label {
		display: none;
	}
}

.tu-btn-size--small .tu-action { min-height: 34px; padding: 6px 8px; }
.tu-btn-size--medium .tu-action { min-height: 40px; padding: 8px 10px; }
.tu-btn-size--large .tu-action { min-height: 46px; padding: 10px 12px; }

.tu-action__label {
	font-size: 14px;
	line-height: 1;
}

.tu-avatar {
	width: 32px;
	height: 32px;
	border-radius: 999px;
	display: block;
}

.tu-svg-icon {
	width: var(--tu-icon-size);
	height: var(--tu-icon-size);
	display: block;
}

/* Icons (default inline via CSS mask placeholders) */
.tu-icon {
	width: var(--tu-icon-size);
	height: var(--tu-icon-size);
	display: inline-block;
	background: #111;
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
}

/* Simple fallback icon shapes using masks (data-uri SVG) */
.tu-icon--menu {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E");
}

.tu-icon--track {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 017 7c0 5-7 13-7 13S5 14 5 9a7 7 0 017-7zm0 9.5A2.5 2.5 0 1012 6.5a2.5 2.5 0 000 5z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a7 7 0 017 7c0 5-7 13-7 13S5 14 5 9a7 7 0 017-7zm0 9.5A2.5 2.5 0 1012 6.5a2.5 2.5 0 000 5z'/%3E%3C/svg%3E");
}

.tu-icon--account {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 10-5-5 5 5 0 005 5zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a5 5 0 10-5-5 5 5 0 005 5zm0 2c-4.4 0-8 2.2-8 5v1h16v-1c0-2.8-3.6-5-8-5z'/%3E%3C/svg%3E");
}

.tu-icon--cart {
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 18a2 2 0 102 2 2 2 0 00-2-2zm10 0a2 2 0 102 2 2 2 0 00-2-2zM6.3 6l.7 4h10.9l1.3-6H6.1L5.7 2H2v2h2l2.6 12.6A3 3 0 009.5 19H19v-2H9.5a1 1 0 01-1-.8L8.6 12H20l2-10H6.3z'/%3E%3C/svg%3E");
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 18a2 2 0 102 2 2 2 0 00-2-2zm10 0a2 2 0 102 2 2 2 0 00-2-2zM6.3 6l.7 4h10.9l1.3-6H6.1L5.7 2H2v2h2l2.6 12.6A3 3 0 009.5 19H19v-2H9.5a1 1 0 01-1-.8L8.6 12H20l2-10H6.3z'/%3E%3C/svg%3E");
}

.tu-action--cart {
	position: relative;
}

.tu-cart-count {
	position: absolute;
	top: -6px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #d70022;
	color: #fff;
	font-size: 12px;
	line-height: 18px;
	text-align: center;
}

/* Tablet & Mobile */
@media (max-width: 960px) {
	.tu-header__inner {
		flex-wrap: nowrap;
	}

	.tu-header__nav {
		display: none;
	}

	.tu-header__toggle {
		display: inline-flex;
	}
}

@media (max-width: 680px) {
	.tu-header__inner {
		flex-wrap: wrap;
	}

	.tu-header__branding {
		order: 1;
		flex: 1 0 100%;
		justify-content: center;
	}

	.tu-header__toggle {
		order: 2;
	}

	.tu-header__actions {
		order: 2;
		margin-left: auto;
	}

	.tu-header__search {
		order: 3;
		flex: 1 0 100%;
		width: 100%;
		max-width: none;
	}

	.tu-action__label {
		display: none;
	}
}

/* Open state (mobile nav as drawer) */
body.tu-nav-open .tu-header__nav {
	display: block;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	padding: 12px 16px;
}

body.tu-nav-open .tu-menu {
	flex-direction: column;
	align-items: stretch;
}

body.tu-nav-open .tu-menu a {
	padding: 10px 8px;
}
