/**
 * Header styles
 *
 * Implements Figma designs:
 * - Desktop Header (577:5584, 577:11351)
 * - Desktop Dropdown Submenu (577:11310)
 * - Mobile Header (577:8273)
 * - Mobile Drawer (577:9209, 577:9179)
 * - Button Hover (577:11384)
 *
 * @package uashelters
 */

/* ==========================================================================
   Site Header (Sticky & Backdrop Blur)
   ========================================================================== */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: background-color 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
	box-sizing: border-box;
}

body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* Global Smooth Scroll & Anchor Offset for Fixed Header */
html {
	scroll-behavior: smooth;
}

[id] {
	scroll-margin-top: calc(var(--header-height-desktop, 80px) + 20px);
}

@media screen and (max-width: 768px) {
	[id] {
		scroll-margin-top: calc(var(--header-height-mobile, 60px) + 20px);
	}
}

.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-height-desktop);
	position: relative;
}

/* Scrolled state */
.site-header.is-scrolled {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Dark theme style (default on dark hero) */
.site-header--dark {
	background: rgba(255, 255, 255, 0.1);
	color: #ffffff;
}

.site-header--dark.is-scrolled {
	background: rgba(20, 36, 46, 0.85);
}

/* Light theme style (on light pages / scrolled light) */
.site-header--light {
	background: rgba(255, 255, 255, 0.1);
	color: var(--color-dark);
}

.site-header--light.is-scrolled {
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Header Logo (Two-part Logo)
   ========================================================================== */

.header-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	gap: 9px;
	flex-shrink: 0;
}

.header-logo__part {
	display: inline-flex;
	align-items: center;
}

.header-logo__part img,
.header-logo__part svg {
	display: block;
	height: 28px;
	width: auto;
	max-height: 29px;
	object-fit: contain;
}

.header-logo__separator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	user-select: none;
}

.header-logo__sep-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.header-logo__sep-icon img,
.header-logo__sep-icon svg {
	width: 7px;
	height: 7px;
	display: block;
}

/* Theme switching for logos & separator */
.site-header--dark .header-logo__part--dark,
.site-header--dark .header-logo__sep-icon--dark {
	display: none;
}

.site-header--dark .header-logo__part--light,
.site-header--dark .header-logo__sep-icon--light {
	display: inline-flex;
}

.site-header--light .header-logo__part--light,
.site-header--light .header-logo__sep-icon--light {
	display: none;
}

.site-header--light .header-logo__part--dark,
.site-header--light .header-logo__sep-icon--dark {
	display: inline-flex;
}

/* ==========================================================================
   Desktop Navigation
   ========================================================================== */

.header-nav {
	display: flex;
	align-items: center;
}

.header-nav__list {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 16px;
}

.header-nav__item {
	position: relative;
	margin: 0;
	padding: 10px 0;
}

.header-nav__link {
	font-family: var(--font-main);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	text-transform: uppercase;
	color: inherit;
	transition: color 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}

.site-header--dark .header-nav__link,
.site-header--dark .header-lang__current {
	color: #ffffff;
}

.site-header--light .header-nav__link,
.site-header--light .header-lang__current {
	color: var(--color-dark);
}

.header-nav__link:hover,
.header-nav__link:focus,
.header-lang__current:hover,
.header-lang__current:focus,
.header-lang.is-open .header-lang__current,
.header-nav__item.current-menu-item > .header-nav__link,
.header-nav__item.current-menu-ancestor > .header-nav__link {
	color: var(--color-primary);
}

/* Dropdown Submenu (node 577:11310) */
.header-nav__sub-menu {
	position: absolute;
	top: calc(100% - 2px);
	left: 0;
	min-width: 190px;
	background: #ffffff;
	border: 1px solid var(--color-primary);
	border-top: none;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	padding: 10px 20px 20px;
	list-style: none;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
	z-index: 100;
	box-sizing: border-box;
}

.header-nav__item:hover > .header-nav__sub-menu,
.header-nav__item:focus-within > .header-nav__sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.header-nav__sub-item {
	margin: 0;
	padding: 0;
	width: 100%;
}

.header-nav__sub-link {
	font-family: var(--font-main);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--color-dark);
	text-decoration: none;
	text-transform: none;
	display: block;
	width: 100%;
	transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.header-nav__sub-link:hover,
.header-nav__sub-link:focus,
.header-nav__sub-item.current-menu-item > .header-nav__sub-link {
	color: var(--color-dark);
	text-decoration: underline;
	text-decoration-color: var(--color-dark);
}

/* ==========================================================================
   Language Switcher (Desktop Nav)
   Identical typography, line-height, and padding as .header-nav__item
   ========================================================================== */

.header-lang {
	position: relative;
	margin: 0 0 0 16px;
	padding: 10px 0;
	display: inline-flex;
	align-items: center;
}

.header-lang__current {
	font-family: var(--font-main, 'Gilroy', sans-serif);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: inherit;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	text-transform: uppercase;
	white-space: nowrap;
	letter-spacing: normal;
	-webkit-appearance: none;
	appearance: none;
	transition: color 0.2s ease;
}

.header-lang__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 10px;
	height: 6px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.header-lang__icon svg {
	width: 10px;
	height: 6px;
	display: block;
}

.header-lang:hover .header-lang__icon,
.header-lang.is-open .header-lang__icon {
	transform: rotate(180deg);
}

.header-lang__dropdown {
	position: absolute;
	top: calc(100% - 2px);
	right: 0;
	background: #ffffff;
	border: 1px solid var(--color-primary);
	border-top: none;
	padding: 8px 14px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	list-style: none;
	margin: 0;
	min-width: 80px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 101;
}

.header-lang:hover .header-lang__dropdown,
.header-lang.is-open .header-lang__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.header-lang__item {
	margin: 4px 0;
}

.header-lang__link {
	font-family: var(--font-main);
	font-size: 12px;
	font-weight: 500;
	color: var(--color-dark);
	text-decoration: none;
	text-transform: uppercase;
	display: block;
	transition: color 0.2s ease;
}

.header-lang__link:hover {
	color: var(--color-primary);
}

/* ==========================================================================
   Header CTA & Actions
   ========================================================================== */

.header-actions {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Header CTA Button (node 577:11384) */
.site-header .site-header__cta,
.site-header .btn-primary {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: 38px;
	padding: 0 18px;
	background-color: var(--color-primary, #FF9500);
	color: #252525;
	border-radius: 30px;
	font-family: var(--font-main, 'Gilroy', sans-serif);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	text-decoration: none;
	text-transform: capitalize;
	border: none;
	cursor: pointer;
	white-space: nowrap;
	box-sizing: border-box;
	transition: background-color var(--transition-base, 0.25s ease), transform 0.2s ease, box-shadow var(--transition-base, 0.25s ease);
}

/* Display only on desktop (screen > 1024px) */
@media (min-width: 1025px) {
	.site-header .site-header__cta,
	.site-header .btn-primary {
		display: inline-flex;
	}
}

.site-header .btn-primary:hover,
.site-header .btn-primary:focus,
.site-header .site-header__cta:hover,
.site-header .site-header__cta:focus {
	background-color: var(--color-primary-hover, #cd8c00);
	color: #252525;
	text-decoration: none;
	outline: none;
}

.site-header a.btn-primary:visited,
.site-header a.site-header__cta:visited {
	color: #252525;
}

.site-header .btn-primary span,
.site-header .site-header__cta span {
	color: #252525;
	text-decoration: none;
}

.site-header .btn-primary .btn-icon,
.site-header .site-header__cta .btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 9px;
	height: 7px;
	flex-shrink: 0;
	color: #252525;
	transition: transform var(--transition-base, 0.25s ease);
}

.site-header .btn-primary .btn-icon svg,
.site-header .site-header__cta .btn-icon svg {
	width: 100%;
	height: 100%;
	display: block;
	fill: currentColor;
}

.site-header .btn-primary:hover .btn-icon,
.site-header .site-header__cta:hover .btn-icon {
	transform: translateX(3px);
}

/* ==========================================================================
   Mobile Burger Toggle (node 577:8273, 577:9219)
   ========================================================================== */

.mobile-nav-toggle {
	display: none;
	background: transparent;
	border: none;
	padding: 6px;
	cursor: pointer;
	position: relative;
	width: 32px;
	height: 26px;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	z-index: 10001;
	color: inherit;
}

.mobile-nav-toggle__bar {
	display: block;
	width: 25px;
	height: 2px;
	background-color: currentColor;
	border-radius: 1px;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, background-color 0.25s ease;
}

/* Animated burger to cross */
.menu-is-open .mobile-nav-toggle {
	color: var(--color-dark);
}

.menu-is-open .mobile-nav-toggle .mobile-nav-toggle__bar:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.menu-is-open .mobile-nav-toggle .mobile-nav-toggle__bar:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.menu-is-open .mobile-nav-toggle .mobile-nav-toggle__bar:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Drawer Sidebar (node 577:9209, 577:9179)
   ========================================================================== */

.mobile-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-drawer-backdrop.is-active {
	opacity: 1;
	visibility: visible;
}

.mobile-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	max-width: 420px;
	height: 100vh;
	height: 100dvh;
	background-color: #ffffff;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	padding: 24px 20px 40px;
	box-sizing: border-box;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
}

.mobile-drawer.is-active {
	transform: translateX(0);
}

/* Texture overlay from design */
.mobile-drawer__texture {
	position: absolute;
	inset: 0;
	background-image: url('../assets/img/menu-bg-texture.png');
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center;
	opacity: 0.15;
	pointer-events: none;
	z-index: 0;
}

.mobile-drawer__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	min-height: 100%;
}

/* Top bar inside drawer */
.mobile-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 85px; /* Matches Figma node 577:9209 top offset */
	flex-shrink: 0;
}

.mobile-drawer__close {
	background: transparent;
	border: none;
	padding: 8px;
	cursor: pointer;
	color: var(--color-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.mobile-drawer__close:hover {
	background-color: rgba(0, 0, 0, 0.05);
	transform: rotate(90deg);
}

.mobile-drawer__close svg {
	width: 18px;
	height: 18px;
	stroke: var(--color-dark);
	stroke-width: 2.2;
}

/* Navigation items in drawer */
.mobile-drawer__nav {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.mobile-drawer__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.mobile-drawer__item {
	display: block;
	position: relative;
	margin: 0;
	padding: 0;
}

.mobile-drawer__item-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 0;
	line-height: 1.5;
}

.mobile-drawer__link {
	font-family: var(--font-main);
	font-size: 25px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-dark);
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease;
	display: block;
}

/* Submenu toggle button */
.mobile-drawer__sub-toggle {
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	color: var(--color-dark);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	transition: transform 0.25s ease, color 0.2s ease;
}

.mobile-drawer__sub-toggle svg {
	width: 14px;
	height: 8px;
	stroke: currentColor;
	stroke-width: 2;
}

/* When submenu is open (node 577:9179) */
.mobile-drawer__item.is-open > .mobile-drawer__item-heading .mobile-drawer__link,
.mobile-drawer__item.is-open > .mobile-drawer__item-heading .mobile-drawer__sub-toggle {
	color: var(--color-primary);
}

.mobile-drawer__item.is-open > .mobile-drawer__item-heading .mobile-drawer__sub-toggle {
	transform: rotate(180deg);
}

/* Submenu list: hidden completely when closed to prevent any extra spacing/margin */
.mobile-drawer__sub-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-drawer__item.is-open > .mobile-drawer__sub-menu {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 10px 0 4px;
	animation: mobileSubmenuFadeIn 0.2s ease forwards;
}

@keyframes mobileSubmenuFadeIn {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.mobile-drawer__sub-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-drawer__sub-link {
	font-family: var(--font-main);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--color-dark);
	text-decoration: none;
	transition: color 0.2s ease;
}

.mobile-drawer__sub-link:hover,
.mobile-drawer__sub-item.current-menu-item > .mobile-drawer__sub-link {
	color: var(--color-dark);
	text-decoration: underline;
}

/* Language switcher in drawer (directly below menu items with identical 20px gap and typography) */
.mobile-drawer__lang {
	margin-top: 20px;
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	position: relative;
}

.mobile-drawer__lang-current {
	font-family: var(--font-main);
	font-size: 25px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--color-dark);
	background: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-transform: uppercase;
	transition: color 0.2s ease;
}

.mobile-drawer__lang-current:hover,
.mobile-drawer__lang.is-open .mobile-drawer__lang-current {
	color: var(--color-primary);
}

.mobile-drawer__lang-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 8px;
	transition: transform 0.2s ease;
}

.mobile-drawer__lang.is-open .mobile-drawer__lang-icon {
	transform: rotate(180deg);
}

.mobile-drawer__lang-dropdown {
	display: none;
	list-style: none;
	margin: 0;
	padding: 8px 0 0 0;
	flex-direction: column;
	gap: 8px;
}

.mobile-drawer__lang.is-open .mobile-drawer__lang-dropdown {
	display: flex;
	animation: mobileSubmenuFadeIn 0.2s ease forwards;
}

.mobile-drawer__lang-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mobile-drawer__lang-link {
	font-family: var(--font-main);
	font-size: 20px;
	font-weight: 600;
	color: var(--color-dark);
	text-decoration: none;
	text-transform: uppercase;
	transition: color 0.2s ease;
}

.mobile-drawer__lang-link:hover {
	color: var(--color-primary);
}

/* Footer in drawer (CTA Button) */
.mobile-drawer__footer {
	display: flex;
	flex-direction: column;
	margin-top: 40px;
	padding-top: 20px;
}

.mobile-drawer__cta {
	width: 100%;
	justify-content: center;
	padding: 14px 24px;
	font-size: 16px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
	.site-header .container {
		height: var(--header-height-mobile);
	}

	.header-nav,
	.site-header .site-header__cta,
	.site-header .btn-primary {
		display: none;
	}

	.mobile-nav-toggle {
		display: inline-flex;
	}

	.header-logo__part img,
	.header-logo__part svg {
		height: 22px;
	}
}

@media (max-width: 480px) {
	.header-logo__part img,
	.header-logo__part svg {
		height: 19px;
	}

	.header-logo {
		gap: 6px;
	}

	.mobile-drawer {
		max-width: 100%;
		padding: 20px 16px 28px;
	}

	.mobile-drawer__link {
		font-size: 22px;
	}

	.mobile-drawer__sub-link {
		font-size: 16px;
	}
}
