/**
 * TactNexa — Premium Navigation
 *
 * Theme: TactNexa Child / Blocksy
 *
 * Responsibilities:
 * - Premium desktop navigation
 * - Compact brand presentation
 * - Shop mega menu
 * - Category dropdowns
 * - Product search
 * - Account and cart actions
 * - Responsive mobile navigation
 *
 * No WooCommerce payment or checkout logic.
 */


/* =========================================================
   Header Foundation
   ========================================================= */

.tnx-site-header {
	--tnx-nav-navy: #031126;
	--tnx-nav-blue: #1677ff;
	--tnx-nav-cyan: #52d7ff;
	--tnx-nav-border: rgba(170, 211, 255, 0.17);

	position: sticky;
	top: 0;
	z-index: 1100;

	width: 100%;

	color: #ffffff;

	background:
		linear-gradient(
			105deg,
			#031126 0%,
			#062044 67%,
			#092c57 100%
		);

	border-bottom: 1px solid var(--tnx-nav-border);

	box-shadow:
		0 8px 24px rgba(3, 17, 38, 0.12);
}


body.admin-bar .tnx-site-header {
	top: 32px;
}


.tnx-site-header,
.tnx-site-header * {
	box-sizing: border-box;
}


.tnx-site-header__inner {
	position: relative;

	width: min(1320px, calc(100% - 64px));
	min-height: 76px;

	margin-inline: auto;

	display: flex;
	align-items: center;

	gap: clamp(16px, 2vw, 28px);
}


.tnx-site-header a {
	text-decoration: none;
}


/* =========================================================
   Compact Official Brand Logo
   ========================================================= */

.tnx-site-header__brand {
	flex: 0 0 auto;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	width: auto;
	max-width: 170px;

	padding: 4px 7px;

	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;

	background: #ffffff;

	color: #061a36;

	font-size: 1.4rem;
	font-weight: 850;
	line-height: 1.2;

	letter-spacing: -0.035em;

	box-shadow:
		0 3px 12px rgba(0, 0, 0, 0.08);

	transition:
		transform 160ms ease,
		box-shadow 160ms ease;
}


.tnx-site-header__brand:hover {
	transform: translateY(-1px);

	box-shadow:
		0 5px 16px rgba(0, 0, 0, 0.13);
}


.tnx-site-header__brand img {
	display: block;

	width: 154px;
	max-width: 100%;
	height: auto;

	margin: 0;
	padding: 0;

	object-fit: contain;
}


.tnx-site-header__brand-accent {
	color: #2895ff;
}


/* =========================================================
   Desktop Navigation
   ========================================================= */

.tnx-site-header__desktop-nav {
	display: flex;
	align-items: center;
	justify-content: center;

	flex: 1 1 auto;

	min-width: 0;

	gap: clamp(14px, 1.6vw, 27px);
}


.tnx-site-header__dropdown {
	position: relative;
	flex-shrink: 0;
}


/*
 * Raised stacking context for the active dropdown.
 * Exclusive opening and outside-click closing will be
 * handled by the header markup / navigation behavior.
 */

.tnx-site-header__dropdown[open] {
	z-index: 45;
}


.tnx-site-header__dropdown summary {
	display: inline-flex;
	align-items: center;

	gap: 7px;

	min-height: 44px;

	list-style: none;

	cursor: pointer;
	user-select: none;
	white-space: nowrap;

	color: #e9f3ff;

	font-size: 0.85rem;
	font-weight: 750;

	transition: color 150ms ease;
}


.tnx-site-header__dropdown summary::-webkit-details-marker,
.tnx-site-header__mobile summary::-webkit-details-marker {
	display: none;
}


.tnx-site-header__dropdown summary span {
	display: inline-block;

	color: #73cfff;

	font-size: 1rem;

	transition: transform 160ms ease;
}


.tnx-site-header__dropdown[open] summary span {
	transform: rotate(180deg);
}


.tnx-site-header__desktop-nav > a {
	display: inline-flex;
	align-items: center;

	min-height: 44px;

	flex-shrink: 0;

	color: #e9f3ff;

	font-size: 0.85rem;
	font-weight: 750;

	white-space: nowrap;

	transition: color 150ms ease;
}


.tnx-site-header__desktop-nav > a:hover,
.tnx-site-header__desktop-nav > details > summary:hover,
.tnx-site-header__desktop-nav > details[open] > summary {
	color: var(--tnx-nav-cyan);
}


/* =========================================================
   Shop Mega Menu Foundation
   ========================================================= */

.tnx-site-header__mega,
.tnx-site-header__dropdown-panel {
	position: absolute;

	top: calc(100% + 10px);
	left: 0;

	z-index: 30;

	border: 1px solid #dbe9f7;
	border-radius: 16px;

	background: #ffffff;
	color: #061a36;

	box-shadow:
		0 22px 55px rgba(3, 17, 38, 0.22);
}


/* =========================================================
   Shop Mega Menu Layout
   ========================================================= */

.tnx-site-header__mega {
	display: grid;

	grid-template-columns:
		minmax(190px, 0.8fr)
		minmax(0, 1.8fr);

	gap: 25px;

	width: min(750px, calc(100vw - 48px));

	padding: 25px;
}


.tnx-site-header__mega h2 {
	margin: 0 0 13px;

	color: #061a36;

	font-size: 0.96rem;
	font-weight: 800;
	line-height: 1.4;
}


.tnx-site-header__mega-categories {
	display: flex;
	flex-direction: column;
	align-items: flex-start;

	gap: 5px;
}


/* =========================================================
   Category Links
   ========================================================= */

.tnx-site-header__mega-categories a,
.tnx-site-header__dropdown-panel a {
	display: block;

	width: 100%;

	padding: 9px 11px;

	border-radius: 8px;

	color: #405774;

	font-size: 0.88rem;
	font-weight: 650;
	line-height: 1.45;

	transition:
		background-color 150ms ease,
		color 150ms ease;
}


.tnx-site-header__mega-categories a:hover,
.tnx-site-header__dropdown-panel a:hover {
	background: #eef6ff;
	color: #075fd7;
}


.tnx-site-header__mega-categories
.tnx-site-header__mega-all {
	background: #e8f3ff;

	color: #075fd7;

	font-weight: 800;
}


/* =========================================================
   Dynamic Featured Products
   ========================================================= */

.tnx-site-header__featured-grid {
	display: grid;

	grid-template-columns:
		repeat(2, minmax(0, 1fr));

	gap: 10px;
}


.tnx-site-header__featured-link {
	display: flex;
	align-items: center;

	gap: 10px;

	min-width: 0;

	padding: 9px;

	border: 1px solid #e3edf8;
	border-radius: 10px;

	background: #fbfdff;
	color: #061a36;

	font-size: 0.77rem;
	font-weight: 700;
	line-height: 1.4;

	transition:
		border-color 150ms ease,
		background-color 150ms ease;
}


.tnx-site-header__featured-link:hover {
	color: #075fd7;

	border-color: #a9d2ff;

	background: #f4f9ff;
}


.tnx-site-header__featured-link img {
	display: block;

	width: 64px;
	height: 64px;

	flex: 0 0 64px;

	object-fit: contain;

	border-radius: 8px;

	background: #ffffff;
}


.tnx-site-header__featured-link span {
	min-width: 0;

	overflow-wrap: anywhere;
}


/* =========================================================
   Standard Category Dropdown
   ========================================================= */

.tnx-site-header__dropdown-panel {
	width: 255px;

	padding: 9px;
}


/* =========================================================
   Header Actions
   ========================================================= */

.tnx-site-header__actions {
	display: flex;
	align-items: center;

	gap: 12px;

	flex: 0 0 auto;
}


/* =========================================================
   Product Search
   ========================================================= */

.tnx-site-header__search {
	display: flex;
	align-items: center;

	width: clamp(155px, 16vw, 240px);
	height: 42px;

	border: 1px solid rgba(187, 220, 255, 0.17);
	border-radius: 999px;

	background: rgba(255, 255, 255, 0.085);
}


.tnx-site-header__search input[type="search"] {
	flex: 1 1 auto;

	width: 0;
	min-width: 0;
	height: 100%;

	padding: 0 5px 0 15px;

	border: 0;
	outline: 0;

	box-shadow: none;

	background: transparent;

	color: #ffffff;

	font-size: 0.83rem;
}


.tnx-site-header__search input::placeholder {
	color: #b9cde7;
	opacity: 1;
}


.tnx-site-header__search button {
	display: grid;
	place-items: center;

	width: 41px;
	height: 40px;

	padding: 10px;

	border: 0;
	border-radius: 50%;

	background: transparent;

	color: #e9f3ff;

	cursor: pointer;
}


.tnx-site-header__search button:hover {
	color: var(--tnx-nav-cyan);
}


/* =========================================================
   Account and Cart Icons
   ========================================================= */

.tnx-site-header__actions svg,
.tnx-site-header__mobile-trigger svg {
	width: 22px;
	height: 22px;

	stroke: currentColor;
	stroke-width: 1.9;

	stroke-linecap: round;
	stroke-linejoin: round;
}


.tnx-site-header__icon-link {
	position: relative;

	display: inline-grid;
	place-items: center;

	width: 38px;
	height: 42px;

	flex-shrink: 0;

	color: #f0f7ff;
}


.tnx-site-header__icon-link:hover {
	color: var(--tnx-nav-cyan);
}


/* =========================================================
   WooCommerce Cart Counter
   ========================================================= */

.tnx-site-header__cart-count {
	position: absolute;

	top: -2px;
	right: -3px;

	display: grid;
	place-items: center;

	min-width: 18px;
	height: 18px;

	padding: 0 4px;

	border-radius: 99px;

	background: var(--tnx-nav-blue);

	color: #ffffff;

	font-size: 0.68rem;
	font-weight: 800;
	line-height: 1;
}


/* =========================================================
   Screen Reader Accessibility
   ========================================================= */

.tnx-site-header__sr-only {
	position: absolute !important;

	width: 1px !important;
	height: 1px !important;

	padding: 0 !important;
	margin: -1px !important;

	overflow: hidden !important;

	clip: rect(0, 0, 0, 0) !important;

	white-space: nowrap !important;

	border: 0 !important;
}


/* =========================================================
   Keyboard Focus
   ========================================================= */

.tnx-site-header a:focus-visible,
.tnx-site-header summary:focus-visible,
.tnx-site-header button:focus-visible,
.tnx-site-header input:focus-visible {
	outline: 3px solid var(--tnx-nav-cyan);
	outline-offset: 3px;
}


/* =========================================================
   Mobile Navigation Default
   ========================================================= */

.tnx-site-header__mobile {
	display: none;
}


/* =========================================================
   Medium Desktop
   ========================================================= */

@media (max-width: 1250px) {

	.tnx-site-header__search {
		display: none;
	}

}


/* =========================================================
   Tablet Navigation
   ========================================================= */

@media (max-width: 1050px) {

	.tnx-site-header__inner {
		width: calc(100% - 40px);

		min-height: 70px;
	}

	.tnx-site-header__desktop-nav {
		display: none;
	}

	.tnx-site-header__actions {
		margin-left: auto;
	}

	.tnx-site-header__mobile {
		display: block;
	}

	.tnx-site-header__mobile-trigger {
		display: inline-flex;
		align-items: center;

		gap: 8px;

		min-height: 44px;

		padding: 8px 11px;

		border: 1px solid rgba(187, 220, 255, 0.18);
		border-radius: 9px;

		list-style: none;

		color: #ffffff;

		font-size: 0.85rem;
		font-weight: 750;

		cursor: pointer;
	}

	.tnx-site-header__mobile-panel {
		position: absolute;

		top: 100%;
		left: -20px;
		right: -20px;

		z-index: 50;

		max-height: min(76vh, 600px);

		overflow-y: auto;

		padding: 20px;

		border-top: 1px solid var(--tnx-nav-border);

		background: #061a36;

		box-shadow:
			0 24px 36px rgba(3, 17, 38, 0.24);
	}

	.tnx-site-header__mobile-search label {
		display: block;

		margin-bottom: 8px;

		color: #dbeaff;

		font-size: 0.82rem;
		font-weight: 800;
	}

	.tnx-site-header__mobile-search > div {
		display: flex;
		gap: 8px;
	}

	.tnx-site-header__mobile-search input[type="search"] {
		flex: 1;
		min-width: 0;
		min-height: 43px;

		padding: 10px 12px;

		border: 1px solid #6180a5;
		border-radius: 9px;

		background: #ffffff;
		color: #061a36;
	}

	.tnx-site-header__mobile-search button {
		min-height: 43px;

		padding: 8px 16px;

		border: 0;
		border-radius: 9px;

		background: #1677ff;
		color: #ffffff;

		font-weight: 800;

		cursor: pointer;
	}

	.tnx-site-header__mobile-panel nav {
		display: grid;

		grid-template-columns:
			repeat(2, minmax(0, 1fr));

		gap: 5px 12px;

		margin-top: 16px;
	}

	.tnx-site-header__mobile-panel nav a {
		display: block;

		padding: 11px;

		border-radius: 7px;

		color: #e9f3ff;

		font-size: 0.9rem;
	}

	.tnx-site-header__mobile-panel nav a:hover {
		background: #123961;
		color: #ffffff;
	}

	.tnx-site-header__mobile-panel nav
	.tnx-site-header__mobile-primary {
		color: #52d7ff;

		font-weight: 800;
	}

}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {

	body.admin-bar .tnx-site-header {
		top: 46px;
	}

	.tnx-site-header__inner {
		width: calc(100% - 28px);

		min-height: 64px;

		gap: 10px;
	}

	.tnx-site-header__brand {
		max-width: 143px;

		padding: 3px 5px;

		border-radius: 7px;

		font-size: 1.2rem;
	}

	.tnx-site-header__brand img {
		width: 131px;
	}

	.tnx-site-header__actions {
		gap: 5px;
	}

	.tnx-site-header__icon-link {
		width: 32px;
	}

	.tnx-site-header__actions svg {
		width: 20px;
		height: 20px;
	}

	.tnx-site-header__mobile-trigger {
		padding: 9px;
	}

	.tnx-site-header__mobile-trigger span {
		display: none;
	}

	.tnx-site-header__mobile-panel {
		left: -14px;
		right: -14px;

		padding: 16px;
	}

	.tnx-site-header__mobile-panel nav {
		grid-template-columns: 1fr;
	}

}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

	.tnx-site-header__brand,
	.tnx-site-header__dropdown summary,
	.tnx-site-header__dropdown summary span,
	.tnx-site-header__desktop-nav > a,
	.tnx-site-header__featured-link,
	.tnx-site-header__mega-categories a,
	.tnx-site-header__dropdown-panel a {
		transition: none;
	}

	.tnx-site-header__brand:hover {
		transform: none;
	}

}