/* ============================================================
   HEADER.CSS — Complete header styles with dark/light theme
   ============================================================
   Two states controlled by JS:
   • .header-dark  → transparent glass over dark hero (light logo, white text)
   • .scrolled     → solid white background (dark logo, dark text)
   ============================================================ */

/* ── Base header ── */
header {
    position: fixed;
    width: calc(100% - 40px);
    max-width: 1400px;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Default: transparent until JS adds a class */
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

@media (min-width: 1025px) {
    header {
        top: 30px;
        width: calc(100% - 60px);
    }
}

@supports not (backdrop-filter: blur(20px)) {
    header.scrolled {
        background: rgba(255, 255, 255, 0.98);
    }
    header.header-dark {
        background: rgba(0, 0, 0, 0.6);
    }
}

/* ── Logo switching ── */
.logo-dark {
    display: block;
}
.logo-light {
    display: none;
}

header.header-dark .logo-dark {
    display: none;
}
header.header-dark .logo-light {
    display: block;
}

header.scrolled .logo-dark {
    display: block;
}
header.scrolled .logo-light {
    display: none;
}

/* ════════════════════════════════════════════════
   DARK STATE — transparent over dark hero/video
   ════════════════════════════════════════════════ */
header.header-dark {
    background: transparent;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

header.header-dark .nav-links a {
    color: rgba(255, 255, 255, 0.9);
}

header.header-dark .nav-links a:hover {
    color: #37b3e3;
}

header.header-dark .nav-links a::after {
    background: #37b3e3;
}

header.header-dark .btn-lang-switch {
    color: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.25);
}

header.header-dark .btn-lang-switch:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #37b3e3;
}

header.header-dark .btn-lang-switch:hover svg,
header.header-dark .btn-lang-switch:hover svg circle,
header.header-dark .btn-lang-switch:hover svg path {
    stroke: #37b3e3 !important;
    fill: none !important;
}

header.header-dark .btn-cta-nav {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

header.header-dark .btn-cta-nav:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #37b3e3 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

header.header-dark .dropdown-arrow {
    color: rgba(255, 255, 255, 0.9);
}

header.header-dark .dropdown-menu {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

header.header-dark .dropdown-menu li a {
    color: rgba(255, 255, 255, 0.8) !important;
}

header.header-dark .dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #37b3e3 !important;
}

header.header-dark .mobile-menu-btn span {
    background: #fff;
}

/* ════════════════════════════════════════════════
   SCROLLED STATE — solid light background
   ════════════════════════════════════════════════ */
header.scrolled {
    background: transparent;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

header.scrolled .nav-links a {
    color: #1d1d1d;
}

header.scrolled .nav-links a:hover {
    color: #37b3e3;
}

header.scrolled .nav-links a::after {
    background: #37b3e3;
}

header.scrolled .btn-lang-switch {
    color: #1d1d1d;
    border-color: rgba(29, 29, 29, 0.2);
}

header.scrolled .btn-lang-switch:hover {
    background: #1d1d1d;
    border-color: #1d1d1d;
    color: #37b3e3;
}

header.scrolled .btn-lang-switch:hover svg,
header.scrolled .btn-lang-switch:hover svg circle,
header.scrolled .btn-lang-switch:hover svg path {
    stroke: #37b3e3 !important;
    fill: none !important;
}

header.scrolled .btn-cta-nav {
    background: #1D1D1D;
    color: white !important;
    border: none;
    box-shadow: 0 4px 15px rgba(29, 29, 29, 0.2);
}

header.scrolled .btn-cta-nav:hover {
    background: #1D1D1D;
    color: #37b3e3 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 29, 29, 0.3);
}

header.scrolled .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header.scrolled .dropdown-menu li a {
    color: #1d1d1d !important;
}

header.scrolled .dropdown-menu li a:hover {
    background: #1d1d1d;
    color: #fff !important;
}

header.scrolled .mobile-menu-btn span {
    background: #1d1d1d;
}

/* ══════════════════════════════════════
   SHARED NAV STRUCTURE
   ══════════════════════════════════════ */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

@media (min-width: 768px) {
    nav {
        padding: 14px 24px;
    }
}

.logo {
    display: flex;
    align-items: center;
    animation: fadeInDown 0.8s ease-out;
    position: relative;
    z-index: 1001;
}

.logo img {
    height: 36px;
    width: auto;
}

@media (min-width: 768px) {
    .logo img {
        height: 40px;
    }
}

.nav-links {
    display: flex;
    gap: 45px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ── CTA Button ── */
.btn-cta-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-cta-nav::after {
    display: none !important;
}

/* ── Language Switch ── */
.btn-lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1.5px solid;
}

.btn-lang-switch svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.btn-lang-switch::after {
    display: none !important;
}

/* ── Dropdowns ── */
.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item .dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 180px;
    border-radius: 12px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1002;
    list-style: none;
}

[dir="ltr"] .dropdown-menu {
    right: auto;
    left: 0;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-menu li a::after {
    display: none !important;
}

/* ══════════════════════════════════════
   MOBILE MENU BUTTON
   ══════════════════════════════════════ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    position: relative;
}

.mobile-menu-btn span {
    width: 28px;
    height: 3px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ══════════════════════════════════════
   MOBILE MENU PANEL
   ══════════════════════════════════════ */
.mobile-menu {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(15px) saturate(0%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    padding: 0;
    transform: translateY(-100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
    /* Above .popup-overlay (2000) and .cookie-banner (2500) so opening
       the menu never gets covered by either. */
    z-index: 3000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* When the menu is open, also hide the news-popup and cookie banner so the
   menu is the only modal-like surface on screen. */
body:has(.mobile-menu.active) #newsPopup,
body:has(.mobile-menu.active) #cookieBanner {
    display: none !important;
}

@supports not (backdrop-filter: blur(40px)) {
    .mobile-menu {
        background: rgba(255, 255, 255, 0.97);
    }
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* When the mobile menu is open, hide the page header so its logo/hamburger don't bleed through. */
body:has(.mobile-menu.active) #header { display: none; }

.mobile-menu-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-menu-brand {
    display: inline-flex;
    align-items: center;
}

.mobile-menu-brand img {
    height: 36px;
    width: auto;
    display: block;
}

.mobile-menu-close {
    appearance: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #1d1d1d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.mobile-menu-close:hover,
.mobile-menu-close:focus-visible {
    background: #1d1d1d;
    color: #fff;
    border-color: #1d1d1d;
    transform: rotate(90deg);
    outline: none;
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-body {
    flex: 1;
    padding: 28px 30px calc(48px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scoped to top-level <ul> only so it doesn't override .mobile-submenu's display:none. */
.mobile-menu > .mobile-menu-body > ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Only plain top-level mobile-menu links — submenu links and the .mobile-cta-btn
   keep their own styling. */
.mobile-menu > .mobile-menu-body > ul > li > a:not(.mobile-cta-btn) {
    display: block;
    padding: 15px 20px;
    color: #1d1d1d;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.mobile-menu > .mobile-menu-body > ul > li > a:not(.mobile-cta-btn):active {
    background: #1d1d1d;
    color: white;
}

/* ── Mobile CTA ── */
.mobile-cta-btn {
    display: block;
    padding: 15px 20px;
    background: #1d1d1d;
    color: #fff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-cta-btn:hover {
    background: #333;
    color: #37b3e3 !important;
}

/* ── Mobile Language ── */
.mobile-lang-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.mobile-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid rgba(29, 29, 29, 0.2);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.mobile-lang-btn:hover {
    background: #1d1d1d;
    border-color: #1d1d1d;
}

.mobile-lang-btn:hover svg circle,
.mobile-lang-btn:hover svg path {
    stroke: #37b3e3 !important;
}

/* ── Mobile Overlay (kept for JS state, hidden visually since the menu now fills the viewport) ── */
.mobile-menu-overlay {
    display: none;
}

/* ════════════════════════════════════════════════════════════════
   LIQUID GLASS — mobile parent toggle + submenu tray
   Real refraction via SVG <feDisplacementMap> on backdrop, layered
   specular highlights through ::before / ::after, concentric radii,
   spring physics. The shape itself is the chrome — no borders.
   ════════════════════════════════════════════════════════════════ */

/* Liquid-glass surface — applied to both parent toggle and submenu tray. */
.mobile-parent-toggle,
.mobile-menu li.open > .mobile-submenu {
    background: rgba(255, 255, 255, 0.18);
    border: 0;
    backdrop-filter:
        url(#liquidGlass)
        blur(18px)
        saturate(180%)
        brightness(1.06);
    -webkit-backdrop-filter: blur(18px) saturate(180%) brightness(1.06);
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.85),
        inset 0 -10px 25px rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(15, 23, 42, 0.06),
        0 16px 40px rgba(15, 23, 42, 0.10),
        0 1px 3px rgba(15, 23, 42, 0.06);
}

@supports not (backdrop-filter: blur(18px)) {
    .mobile-parent-toggle,
    .mobile-menu li.open > .mobile-submenu {
        background: rgba(255, 255, 255, 0.86);
    }
}

/* ── Parent Toggle ── */
.mobile-parent-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 18px 22px;
    border-radius: 26px;
    color: #1d1d1d;
    font-weight: 600;
    font-size: 16px;
    font-family: inherit;
    cursor: pointer;
    isolation: isolate;
    overflow: hidden;
    transition:
        color 0.3s ease,
        box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.35s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.mobile-parent-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(140% 80% at 50% 0%,
            rgba(255, 255, 255, 0.55) 0%,
            rgba(255, 255, 255, 0.18) 18%,
            rgba(255, 255, 255, 0) 45%);
    z-index: 1;
}

.mobile-parent-toggle::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(26px - 1px);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    z-index: 1;
}

.mobile-parent-toggle > * {
    position: relative;
    z-index: 2;
}

.mobile-parent-toggle:active {
    transform: scale(0.965);
    transition-duration: 0.14s;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 0.85),
        inset 0 0 24px rgba(55, 179, 227, 0.20),
        0 6px 16px rgba(55, 179, 227, 0.16);
}

.mobile-menu li.open > .mobile-parent-toggle {
    color: #0e5677;
    box-shadow:
        inset 0 1.5px 0 rgba(255, 255, 255, 1),
        inset 0 -10px 30px rgba(120, 200, 230, 0.18),
        inset 0 0 0 1px rgba(55, 179, 227, 0.30),
        0 0 0 6px rgba(55, 179, 227, 0.10),
        0 22px 55px rgba(55, 179, 227, 0.28),
        0 2px 6px rgba(15, 23, 42, 0.08);
}

.mobile-menu li.open > .mobile-parent-toggle::before {
    background:
        radial-gradient(140% 90% at 50% 0%,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(180, 220, 240, 0.30) 18%,
            rgba(255, 255, 255, 0) 50%);
}

.mobile-parent-toggle svg {
    width: 18px;
    height: 18px;
    color: #6a7785;
    flex-shrink: 0;
    padding: 6px;
    box-sizing: content-box;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 1px 2px rgba(15, 23, 42, 0.05);
    transition:
        transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
        color 0.3s ease,
        background 0.3s ease;
}

.mobile-menu li.open > .mobile-parent-toggle svg {
    transform: rotate(180deg);
    color: #37b3e3;
    background: rgba(55, 179, 227, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 0 12px rgba(55, 179, 227, 0.30);
}

/* ── Submenu — liquid-glass tray that drops out of the parent ──
   We use display:none/flex with a one-shot CSS animation instead of a
   max-height transition. max-height was clipping the last item because
   the inline maxHeight that toggleSubmenu() writes ran a beat before
   the flex layout reflowed, leaving the cap too small. With display
   driving show/hide, the tray always renders at natural height. */
.mobile-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    max-height: none !important;
}

.mobile-menu li.open > .mobile-submenu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    margin-bottom: 14px;
    padding: 14px 12px;
    border-radius: 24px;
    position: relative;
    isolation: isolate;
    animation: submenuReveal 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.mobile-menu li.open > .mobile-submenu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(140% 60% at 50% 0%,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.15) 18%,
            rgba(255, 255, 255, 0) 45%);
    z-index: 1;
}

.mobile-menu li.open > .mobile-submenu::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(24px - 1px);
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
    z-index: 1;
}

.mobile-submenu li {
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
}

.mobile-submenu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px !important;
    font-size: 14.5px !important;
    font-weight: 500;
    color: #2f3a44 !important;
    border-radius: 16px;
    position: relative;
    transition:
        color 0.25s ease,
        background 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s ease,
        transform 0.25s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.mobile-submenu li a::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 999px;
    background: rgba(55, 179, 227, 0.25);
    flex-shrink: 0;
    transition:
        height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.25s ease,
        box-shadow 0.3s ease;
}

/* Block any cascaded hover from .mobile-menu ul li a — submenu stays static. */
.mobile-submenu li a:hover {
    background: transparent !important;
    color: #2f3a44 !important;
    box-shadow: none !important;
}

.mobile-submenu li a:hover::before {
    height: 18px !important;
    background: rgba(55, 179, 227, 0.25) !important;
    box-shadow: none !important;
}

.mobile-submenu li a:active {
    transform: scale(0.97);
    transition-duration: 0.12s;
    background: rgba(55, 179, 227, 0.22);
    color: #0d4d6a !important;
}

.mobile-submenu li a:focus-visible {
    outline: 2px solid #37b3e3;
    outline-offset: 3px;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
    }
}

@media (min-width: 1025px) {
    .mobile-menu,
    .mobile-menu-overlay,
    .mobile-menu-btn {
        display: none !important;
    }
}

/* ── Keyframes ── */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
