/* HEADER */

header .menu-wrapper {
	z-index:90;
    position: relative;
}

header {
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 10;
    padding: clamp(12px, 1vw, 1%);
    padding-bottom: 0;
    z-index: 90;
}

header .container {
	align-items: center;
    justify-content: space-between;
}

header .flex {
	gap: 40px;
}

header .menu.flex { align-items:center; }

header .logo {
	width: 44px;
	height: 44px;
}

header .logo svg {
	width: 100%;
	height:auto;
}

header .menu li {
	text-align: justify;
	font-style: normal;
}

header .menu li > a > div {
	width: 100%;
	position: relative;
	display: inline-flex;
	align-items: center;
}

header .menu li > a > div::before {
	content: '';
	width: 0;
	height: 1px;
	background-color: var(--color-sand);
	transition: width 0.15s ease-out, margin-right 0.15s ease-out;
	display: block;
	margin-right: 0;
}

header .menu li:hover > a > div::before {
	width: 100%;
	margin-right: 8px;
}

header .menu ul span {
	font-size: 12px;
    font-weight: 500;
    line-height: 12px;
    letter-spacing: -0.12px;
}

header .menu p {
	margin: 0; 
	font-size: clamp(16px, 1.1vw, 18px);
	font-weight: 400;
	line-height: clamp(16px, 1.1vw, 18px); 
	letter-spacing: -0.18px;
}

header ul li a, header ul li a:hover, header ul li a:active, header ul li a:focus, header ul li a:visited {
	color: var(--color-sand);
	text-decoration: none;
}

header .menu ul li > a {
	display: flex;
    flex-direction: column;
	gap: 3px;
}
nav ul { align-items:center; }

/* Dropdown Menu */
header .menu li.has-dropdown {
	position: relative;
}

.menu-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	pointer-events: none;
	z-index: 100;
}

.dropdown-bridge {
	height: 8px;
}

.dropdown-content {
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}

header .menu li.has-dropdown:hover .menu-dropdown {
	pointer-events: auto;
}

header .menu li.has-dropdown:hover .dropdown-content {
	max-height: 60px;
	opacity: 1;
}

.dropdown-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 19px;
	letter-spacing: -0.16px;
	text-decoration: none;
	border-top: 1px solid currentColor;
	white-space: nowrap;
}

.dropdown-item,
.dropdown-item:hover,
.dropdown-item:active,
.dropdown-item:visited {
	color: var(--color-sand);
	text-decoration: none;
	flex-direction: row;
}

header .menu .dropdown-item p {
	margin: 0;
	font-size: clamp(14px, 1.1vw, 15px);
	font-weight: 400;
	line-height: clamp(14px, 1.1vw, 15px);
}

.dropdown-arrow {
	width: 13px;
	height: 13px;
	margin-left: 10px;
	flex-shrink: 0;
}

.dropdown-arrow svg {
	width: 100%;
	height: 100%;
}

.dropdown-arrow svg path {
	fill: currentColor;
}

.menu-button {
	-webkit-appearance: none;
    border: none;
    background: none;
	position: relative;
    padding: 0;
    width: 30px;
    height: 30px;
    overflow: hidden;
    z-index: 10;
}

.menu-button svg {
	width: 30px;
	height: 30px;
	max-width: 30px;
	position:absolute;
	top:0;
	left:0; right:0;
	opacity: 1;
	transition: opacity 0.2s ease-out, max-width 0.2s ease-out;
}

.menu-button svg:last-child,
header:has(.menu-mobile.open) .menu-button svg:first-child {
	transform:scale(0);
	opacity: 0;
}

header:has(.menu-mobile.open) .menu-button svg:last-child {
	max-width: 30px;
	opacity: 1;
	transform:scale(1);
}

.menu-button svg path {
	fill: var(--color-sand);
}

.menu .cta-button-text { padding: 12px 18px; }


header .logo svg path,
header .menu ul a,
header .menu ul li div::before,
header .cta-button-patch .circle svg path,
header .cta-button-text,
header .cta-button-patch .circle {
	transition: fill 0.2s ease-out, background-color 0.2s ease-out, color 0.2s ease-out, width 0.2s ease-out;
}


/* Hide dropdown on mobile */
@media (max-width: 1024px) {
    .menu-dropdown {
        display: none;
    }
}

/* Mobile Menu Styling */
@media (max-width: 1024px) {
    .menu-mobile {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background-color: var(--color-dark-sand);
        z-index: 9;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        padding: 0 var(--spacing-wrapper) var(--spacing-wrapper);
    }

    .menu-mobile.open {
        transform: translateX(0);
    }

    body.no-scroll {
        overflow: hidden;
    }
    
    header:has(.menu-mobile.open) .logo svg path,
    header:has(.menu-mobile.open) .menu-button svg path {
        fill: var(--color-sand) !important;
    }

    .menu-mobile ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
    }

    .menu-mobile li {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 30px 0;
        border-top: 1px solid rgba(0, 0, 0, 0.3);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-smooth: always;
    }

    .menu-mobile li:first-child {
        border-top: none;
    }

    .menu-mobile li a {
        width: 100%;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        color: var(--color-sand) !important;
        text-decoration: none;
        gap: 5px;
    }

    .menu-mobile li div span {
        font-size: 17px;
        font-weight: 400;
        opacity: 0.5;
    }

    .menu-mobile li p {
        font-size: var(--font-size-heading-h3);
        font-weight: 300;
        line-height: 1.1;
        text-transform: uppercase;
        margin: 0;
    }

    .menu-mobile li.has-dropdown-mobile {
        flex-wrap: wrap;
    }

    .dropdown-item-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 16px 0 0;
        margin-top: 16px;
        border-top: 1px solid rgba(0, 0, 0, 0.3);
        font-size: 18px;
        font-weight: 400;
        line-height: 1.2;
        color: var(--color-sand) !important;
        text-decoration: none;
    }

    .dropdown-item-mobile .dropdown-arrow {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    .dropdown-item-mobile .dropdown-arrow svg {
        width: 100%;
        height: 100%;
    }

    .dropdown-item-mobile .dropdown-arrow svg path {
        fill: var(--color-sand);
    }

    /* Language selector inside mobile menu */
    .menu-mobile-language {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        position: relative;
    }

    .menu-mobile-language-label {
        color: var(--color-sand);
        font-size: 14px;
        letter-spacing: 0.2px;
        font-weight: 400;
        height: 42px;
        opacity: 0.7;
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
    }

    .menu-mobile-language .language-selector {
        max-width: none;
        position: absolute;
        right:0;
        bottom:0;
    }

    .menu-mobile-language .language-selector-button {
        background: rgba(255, 255, 255, 0.1);
    }

    .menu-mobile-language .language-selector-button:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .menu-mobile-language .language-selector-dropdown {
        background: rgba(255, 255, 255, 0.1);
    }

    .menu-mobile-language .language-option:hover {
        background-color: rgba(255, 255, 255, 0.15);
    }

    .menu-mobile-language .language-option[data-selected="true"] {
        background-color: rgba(255, 255, 255, 0.1);
    }
}


@media (max-width: 1024px) {
	header .menu.flex {
    	gap: 8px;
	}
}

@media (max-width: 768px) {
    header {
        padding: 16px 16px 0 16px;
    }
    header .logo {
        width: 38px;
        height: 38px;
    }
}


/* SECTION COLOR MANAGEMENT */
/* Themes: "light" (default), "dark" (black menu + black logo + black button),
   "dark-orange" (black menu text, orange logo + orange button).
   Add data-menu-theme="<theme>" to <section> elements.
   For initial page theme: add a condition in template-parts/components/menu.php */

header.menu-theme-dark .logo svg path {
	fill: var(--color-title-primary);
}

header.menu-theme-dark .menu ul li a {
	color: var(--color-title-primary);
}

header.menu-theme-dark .dropdown-item,
header.menu-theme-dark .dropdown-item:hover,
header.menu-theme-dark .dropdown-item:visited {
	color: var(--color-title-primary);
}

header.menu-theme-dark .menu li > a > div::before {
	background-color: var(--color-title-primary);
}

header.menu-theme-dark .cta-button {
	color: var(--color-orange);
}

header.menu-theme-dark .cta-button-patch .circle svg path {
	fill: var(--color-orange);
}

header.menu-theme-dark .cta-button-text {
	background-color: var(--color-title-primary);
}

header.menu-theme-dark .cta-button-patch .circle {
	background-color: var(--color-title-primary);
}

header.menu-theme-dark:has(.menu-mobile.closed) .menu-button svg path {
	fill: var(--color-title-primary);
}

/* dark-orange: black menu text, orange logo + orange button (unchanged from light) */

header.menu-theme-dark-orange .menu ul li a {
	color: var(--color-title-primary);
}

header.menu-theme-dark-orange .dropdown-item,
header.menu-theme-dark-orange .dropdown-item:hover,
header.menu-theme-dark-orange .dropdown-item:visited {
	color: var(--color-title-primary);
}

header.menu-theme-dark-orange .menu li > a > div::before {
	background-color: var(--color-title-primary);
}

header.menu-theme-dark-orange:has(.menu-mobile.closed) .menu-button svg path {
	fill: var(--color-title-primary);
}

/* ── Responsive variables for header ────────────────────────
   <header> sits outside .page-root (to preserve position:fixed),
   so it doesn't inherit @container page-root variable overrides.
   Only the variables the menu actually uses are listed here. */
@media (max-width: 1800px) { header { --spacing-wrapper: 80px; } }
@media (max-width: 1500px) { header { --spacing-wrapper: 40px; } }
@media (max-width: 1240px) { header { --spacing-wrapper: 30px; --font-size-heading-h3: clamp(80px, 7.5vw, 120px); } }
@media (max-width: 1024px) { header { --spacing-wrapper: 30px; --font-size-heading-h3: clamp(70px, 7vw, 100px); } }
@media (max-width: 768px)  { header { --spacing-wrapper: 20px; --font-size-heading-h3: 46px; } }
@media (max-width: 500px)  { header { --font-size-heading-h3: 38px; } }
