/**
 * Header & Mobile Menu — Fully Responsive
 * Shared across ALL pages (header.php).
 *
 * Breakpoints:
 *   Desktop  : ≥993px  — horizontal nav
 *   Tablet   : 769–992px — hamburger + overlay
 *   Mobile   : ≤768px — hamburger + overlay (compact)
 *   Small    : ≤480px — extra compact
 *
 * @package WebCraft_Pro
 */

/* =============================================
   CSS VARIABLES
   ============================================= */
:root {
	--header-height: 80px;
	--header-height-scrolled: 64px;
	--header-bg: transparent;
	--header-bg-scrolled: #ffffff;
	--header-blur: 20px;
	--header-text: #1a1a1a;
	--header-text-hover: #3d4adf;
	--header-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	--header-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	--mobile-menu-bg: rgba(0, 0, 0, 0.97);
	--gutter: 40px;
	--logo-width: 96px;
	--logo-width-scrolled: 72px;
}

/* =============================================
   STICKY HEADER
   ============================================= */
#brx-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: var(--header-bg);
	transition:
		background var(--header-transition),
		transform var(--header-transition),
		box-shadow var(--header-transition),
		backdrop-filter var(--header-transition);
	will-change: transform, background;
}

/* Scrolled state — solid white */
#brx-header.headroom--not-top {
	background: var(--header-bg-scrolled);
	box-shadow: var(--header-shadow);
}

/* Hide on scroll down (desktop only) */
#brx-header.headroom--unpinned {
	transform: translateY(-100%);
}

/* Show on scroll up */
#brx-header.headroom--pinned {
	transform: translateY(0);
}

/* Top state — transparent */
#brx-header.headroom--top {
	background: var(--header-bg);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	box-shadow: none;
}

/* =============================================
   HEADER INNER — FLEX LAYOUT
   ============================================= */
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-height);
	transition: height var(--header-transition);
	gap: 24px;
}

.headroom--not-top .site-header__inner {
	height: var(--header-height-scrolled);
}

/* =============================================
   HEADER DARK BG — White logo on dark sections
   ============================================= */
.header--dark-bg {
	background: #000 !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
}

/* White logo hidden by default, shown only on dark sections */
.site-logo__img--white {
	display: none !important;
}

.header--dark-bg .site-logo__img--default {
	display: none !important;
}

.header--dark-bg .site-logo__img--white {
	display: block !important;
}

.header--dark-bg .site-logo__text {
	color: #fff !important;
}

.header--dark-bg .site-nav__link {
	color: #fff !important;
}

.header--dark-bg .site-nav__link::before {
	background-color: #78f19b !important;
}

.header--dark-bg .site-header__login {
	color: #fff !important;
}

.header--dark-bg .btn--header {
	background: #fff;
	color: #000;
}

.header--dark-bg .btn--header:hover {
	background: #e0e0e0;
}

.header--dark-bg .mobile-toggle__bar {
	background: #fff;
}

.header--dark-bg .btn--header-mobile {
	background: #fff;
	color: #000;
}

/* =============================================
   LOGO
   ============================================= */
.site-header__logo {
	flex-shrink: 0;
	z-index: 2;
}

.site-logo {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.site-logo__img {
	width: var(--logo-width);
	height: auto;
	display: block;
	transition: width var(--header-transition);
	will-change: width;
}

.headroom--not-top .site-logo__img {
	width: var(--logo-width-scrolled);
}

.site-logo__text {
	font-family: var(--font-family-primary, 'Inter', system-ui, sans-serif);
	font-weight: 700;
	font-size: 22px;
	color: var(--header-text);
	transition: font-size var(--header-transition);
}

.headroom--not-top .site-logo__text {
	font-size: 18px;
}

/* =============================================
   DESKTOP NAVIGATION
   ============================================= */
.site-nav {
	display: flex;
	align-items: center;
	flex: 1;
	justify-content: center;
}

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

.site-nav__item {
	position: relative;
}

.site-nav__sublist {
	position: absolute;
	top: 100%;
	left: 0;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	padding: 8px 0;
	min-width: 200px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: all 0.2s ease;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	list-style: none;
	margin: 0;
	z-index: 100;
}

.site-nav__item:hover > .site-nav__sublist {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.site-nav__sublist .site-nav__item {
	padding: 0;
}

.site-nav__sublist .site-nav__link {
	padding: 10px 20px;
	font-size: 14px;
	white-space: nowrap;
	border-radius: 0;
	width: 100%;
	display: block;
}

.site-nav__sublist .site-nav__link:hover {
	padding-left: 20px;
}

.site-nav__link {
	display: block;
	position: relative;
	padding: 8px 16px;
	font-family: var(--font-family-primary, 'Inter', system-ui, sans-serif);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.35;
	color: var(--header-text);
	text-decoration: none;
	border-radius: 8px;
	transition:
		color var(--header-transition),
		padding-left var(--header-transition),
		background var(--header-transition);
	white-space: nowrap;
}

/* Animated dot on hover */
.site-nav__link::before {
	content: '';
	position: absolute;
	left: 6px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	margin-top: -3px;
	background-color: var(--header-text-hover);
	opacity: 0;
	transform: scale(0.5);
	transition:
		opacity var(--header-transition),
		transform var(--header-transition);
}

@media (hover: hover) and (pointer: fine) {
	.site-nav__link:hover {
		padding-left: 22px;
		color: var(--header-text-hover);
	}

	.site-nav__link:hover::before {
		opacity: 1;
		transform: scale(1);
	}
}

/* =============================================
   DESKTOP CTA / ACTIONS
   ============================================= */
.site-header__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
	z-index: 2;
}

.site-header__login {
	font-family: var(--font-family-primary, 'Inter', system-ui, sans-serif);
	font-size: 15px;
	font-weight: 500;
	color: var(--header-text);
	text-decoration: none;
	transition: color var(--header-transition);
	white-space: nowrap;
}

.site-header__login:hover {
	color: var(--header-text-hover);
}

.btn--header {
	padding: 6px 16px;
	font-size: 13px;
	min-height: 34px;
	transition:
		padding var(--header-transition),
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

@media (max-width: 992px) {
	.btn--header {
		display: none !important;
	}
}

.headroom--not-top .btn--header {
	padding: 5px 12px;
	min-height: 30px;
}

/* =============================================
   ANIMATED BUTTON (shared with existing)
   ============================================= */
.animated-btn {
	gap: 0;
}

.animated-btn svg {
	width: 8px;
	height: 8px;
	opacity: 0;
	transition:
		transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	transform: translateX(0);
}

.animated-btn .anim-btn-text {
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
	position: relative;
	transform: translateX(-4px);
}

@media (hover: hover) and (pointer: fine) {
	.animated-btn:hover .anim-btn-text {
		transform: translateX(6px);
	}

	.animated-btn:hover svg {
		transform: translateX(-4px);
		opacity: 1;
	}
}

/* =============================================
   MOBILE TOGGLE BUTTON
   ============================================= */
.mobile-toggle {
	display: none; /* Hidden on desktop */
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 8px;
	background: transparent;
	border: none;
	cursor: pointer;
	z-index: 1001;
	position: relative;
}

.mobile-toggle__bar {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--header-text);
	border-radius: 2px;
	transition:
		transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.25s ease,
		width 0.3s ease;
	transform-origin: center;
}

/* Hamburger → X animation */
.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar {
	background: #ffffff;
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(2) {
	opacity: 0;
	width: 0;
}

.mobile-toggle[aria-expanded="true"] .mobile-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   MOBILE MENU OVERLAY
   ============================================= */
.mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	background: var(--mobile-menu-bg);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(-10px);
	transition:
		opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
		visibility 0.4s,
		transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.mobile-menu.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

.mobile-menu__inner {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	padding: calc(var(--header-height) + 20px) var(--gutter) 40px;
}

.mobile-menu__nav {
	flex: 1;
}

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

.mobile-menu__item {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu__item--sub {
	padding-left: 20px;
}

.mobile-menu__item--sub .mobile-menu__link {
	font-size: 22px;
	color: rgba(255, 255, 255, 0.7);
}

.mobile-menu__item:first-child {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu__link {
	display: block;
	padding: 20px 0;
	font-family: var(--font-family-primary, 'Inter', system-ui, sans-serif);
	font-size: 28px;
	font-weight: 400;
	line-height: 1.35;
	color: #ffffff;
	text-decoration: none;
	transition:
		color 0.3s ease,
		padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}

/* Staggered entrance animation */
.mobile-menu.is-open .mobile-menu__item {
	animation: menuItemSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
	opacity: 0;
	transform: translateY(12px);
}

.mobile-menu.is-open .mobile-menu__item:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu.is-open .mobile-menu__item:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu.is-open .mobile-menu__item:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu.is-open .mobile-menu__item:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu.is-open .mobile-menu__item:nth-child(5) { animation-delay: 0.25s; }

@keyframes menuItemSlideIn {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Animated dot on hover (mobile) */
.mobile-menu__link::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-top: -4px;
	background-color: var(--header-text-hover);
	opacity: 0;
	transition:
		opacity 0.3s ease,
		transform 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
	.mobile-menu__link:hover {
		color: var(--header-text-hover);
		padding-left: 20px;
	}

	.mobile-menu__link:hover::before {
		opacity: 1;
	}
}

/* Active touch effect */
.mobile-menu__link:active {
	color: var(--header-text-hover);
}

/* =============================================
   MOBILE MENU FOOTER (CTA + Login)
   ============================================= */
.mobile-menu__footer {
	margin-top: auto;
	padding-top: 32px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	opacity: 0;
	transform: translateY(12px);
	transition:
		opacity 0.4s 0.25s cubic-bezier(0.4, 0, 0.2, 1),
		transform 0.4s 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open .mobile-menu__footer {
	opacity: 1;
	transform: translateY(0);
}

.btn--full {
	width: 100%;
	justify-content: center;
}

.mobile-menu__login {
	display: block;
	text-align: center;
	padding: 12px;
	font-family: var(--font-family-primary, 'Inter', system-ui, sans-serif);
	font-size: 16px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--radius-btn, 40px);
	transition:
		color 0.3s ease,
		border-color 0.3s ease,
		background 0.3s ease;
}

.mobile-menu__login:hover {
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.05);
}

/* =============================================
   BODY SCROLL LOCK
   ============================================= */
body.mobile-menu-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
	touch-action: none;
}

/* =============================================
   RESPONSIVE: TABLET & MOBILE (≤992px)
   ============================================= */
@media (max-width: 992px) {
	:root {
		--header-height: 70px;
		--header-height-scrolled: 58px;
	}

	/* Show hamburger, hide desktop nav & CTA */
	.mobile-toggle {
		display: flex !important;
	}

	.site-nav {
		display: none;
	}

	.site-header__actions {
		display: none !important;
	}

	.site-header__actions .btn--header {
		display: none !important;
	}

	.site-header__inner {
		gap: 16px;
	}

	/* Always keep header visible on mobile (no hide on scroll down) */
	#brx-header.headroom--unpinned {
		transform: translateY(0);
	}
}

/* =============================================
   RESPONSIVE: MOBILE (≤768px)
   ============================================= */
@media (max-width: 768px) {
	:root {
		--header-height: 64px;
		--header-height-scrolled: 54px;
		--gutter: 20px;
	}

	.mobile-menu__link {
		font-size: 24px;
		padding: 16px 0;
	}

	.mobile-menu__inner {
		padding-left: var(--gutter);
		padding-right: var(--gutter);
	}
}

/* =============================================
   RESPONSIVE: SMALL MOBILE (≤480px)
   ============================================= */
@media (max-width: 480px) {
	:root {
		--header-height: 56px;
		--header-height-scrolled: 48px;
		--logo-width: 64px;
		--logo-width-scrolled: 52px;
		--gutter: 16px;
	}

	.mobile-menu__link {
		font-size: 22px;
		padding: 14px 0;
	}

	.mobile-toggle {
		width: 40px;
		height: 40px;
	}

	.mobile-toggle__bar {
		width: 22px;
	}

	.site-logo__text {
		font-size: 18px;
	}
}

/* =============================================
   DESKTOP LARGE (≥1280px)
   ============================================= */
@media (min-width: 1280px) {
	.site-nav__list {
		gap: 12px;
	}

	.site-nav__link {
		font-size: 16px;
		padding: 10px 18px;
	}
}

/* =============================================
   ACCESSIBILITY
   ============================================= */
.site-header :focus-visible {
	outline: 2px solid var(--header-text-hover);
	outline-offset: 2px;
	border-radius: 4px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: #fff;
	color: #0A0F1E;
	padding: 10px 16px;
	z-index: 10000;
	font-weight: 600;
}

.skip-link:focus {
	left: 8px;
	top: 8px;
	border-radius: 4px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* =============================================
   MOBILE HEADER CTA BUTTON (Book a Call)
   ============================================= */
.btn--header-mobile {
	display: none !important;
}

@media (max-width: 992px) {
	.btn--header-mobile {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		padding: 6px 12px;
		font-size: 12px;
		font-weight: 600;
		height: 32px;
		min-height: 32px;
		border-radius: 99px;
		margin-left: auto; /* Push to the right next to hamburger */
		margin-right: 10px;
		background-color: #0b0b0b;
		color: #ffffff !important;
		border: 1px solid rgba(255, 255, 255, 0.15);
		cursor: pointer;
		z-index: 10;
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	}
	
	.btn--header-mobile .btn-text-full {
		display: inline;
	}
	
	.btn--header-mobile .btn-text-short {
		display: none;
	}
}

@media (max-width: 480px) {
	.btn--header-mobile {
		padding: 4px 10px;
		font-size: 11px;
		margin-right: 6px;
		height: 28px;
		min-height: 28px;
	}
	
	.btn--header-mobile .btn-text-full {
		display: none;
	}
	
	.btn--header-mobile .btn-text-short {
		display: inline;
	}
}

/* =============================================
   PRINT
   ============================================= */
@media print {
	#brx-header,
	.mobile-menu,
	.mobile-toggle {
		display: none !important;
	}
}
