/* ════════════════════════════════════════════════════════════════
   SEST Custom Global Header (Mega-Menu)
   ════════════════════════════════════════════════════════════════ */

.sest-header {
    --sest-header-bg: #000000;
    --sest-header-bg-panel: #0A0A0A;
    --sest-header-text: #FFFFFF;
    --sest-header-text-muted: rgba(255, 255, 255, 0.55);
    --sest-header-border: rgba(255, 255, 255, 0.08);
    --sest-header-cta: #6944FF;
    --sest-header-cta-hover: #5836E0;
    --sest-header-accent: #04D1B8;
    --sest-header-height: 72px;
    --sest-header-z: 9000;

    background: var(--sest-header-bg);
    color: var(--sest-header-text);
    font-family: var(--sest-font, 'PT Sans', sans-serif);
    position: sticky;
    top: 0;
    z-index: var(--sest-header-z);
}

.sest-header * {
    box-sizing: border-box;
}

/* ─── Aggressive button reset so theme/Elementor styles can't bleed in ─
   NOTE: no `padding` here — each button class sets its own padding below. */
.sest-header button,
.sest-header__nav-link--button {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    border: 0 !important;
    margin: 0 !important;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    box-shadow: none !important;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 0;
    text-align: left; /* override <button> UA-default text-align: center */
}
.sest-header button:focus,
.sest-header__nav-link--button:focus {
    outline: none !important;
}
.sest-header button:focus-visible,
.sest-header__nav-link--button:focus-visible {
    outline: 2px solid var(--sest-header-accent, #04D1B8) !important;
    outline-offset: 2px;
}

/* ─── Skip-to-content (a11y) ─────────────────────────────────── */

.sest-header__skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--sest-header-cta, #6944FF);
    color: #fff !important;
    padding: 12px 16px;
    z-index: 99999;
    border-radius: 0 0 6px 0;
    text-decoration: none;
}
.sest-header__skip:focus {
    left: 0;
}

/* ─── Top-Bar ────────────────────────────────────────────────── */

.sest-header__topbar {
    background: #000000;
    color: #FFFFFF;
    font-size: 0.85rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sest-header__topbar-inner {
    width: 100%;
    margin: 0;
    padding: 8px 40px;
}
.sest-header__topbar-link,
.sest-header__topbar-text {
    color: #fff !important;
    text-decoration: none;
}
.sest-header__topbar-link:hover {
    color: var(--sest-header-accent, #04D1B8) !important;
}
.sest-header__topbar-arrow {
    margin-left: 6px;
    font-weight: 700;
}

/* ─── Header Bar ─────────────────────────────────────────────── */

.sest-header__bar {
    border-bottom: 1px solid var(--sest-header-border);
    position: relative;
    z-index: calc(var(--sest-header-z) + 2);
    background: var(--sest-header-bg, #000000);
}
.sest-header__bar-inner {
    width: 100%;
    margin: 0;
    padding: 0 40px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: var(--sest-header-height);
}

/* ─── Brand / Logo ───────────────────────────────────────────── */

.sest-header__brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.sest-header__logo {
    display: block !important;
    height: 40px !important;
    width: auto !important;
    max-width: 200px !important;
    max-height: 48px !important;
    object-fit: contain;
}
.sest-header__brand-fallback {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--sest-header-text) !important;
    letter-spacing: -0.02em;
}

/* ─── Primary Nav ────────────────────────────────────────────── */

.sest-header__nav {
    flex: 1;
}
.sest-header__nav-list {
    display: flex;
    align-items: stretch;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: var(--sest-header-height);
}

.sest-header__nav-item {
    position: static;
    display: flex;
    align-items: stretch;
}

.sest-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--sest-header-text) !important;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    height: 100%;
    transition: color 0.18s ease;
    font-family: inherit;
}
.sest-header__nav-link:hover,
.sest-header__nav-link:focus-visible {
    color: var(--sest-header-accent, #04D1B8) !important;
}

.sest-header__caret {
    font-size: 0.7rem;
    transition: transform 0.18s ease;
}
.sest-header__nav-item.is-open > .sest-header__nav-link .sest-header__caret,
.sest-header__nav-item:hover > .sest-header__nav-link .sest-header__caret {
    transform: rotate(180deg);
}

.sest-header__nav-toggle {
    display: none !important;
}

/* ─── Mega Menu ──────────────────────────────────────────────── */

.sest-header__megamenu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--sest-header-bg-panel, #0A0A0A);
    border-top: 1px solid var(--sest-header-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
    z-index: 1;
}

.sest-header__nav-item.has-dropdown:hover > .sest-header__megamenu,
.sest-header__nav-item.has-dropdown:focus-within > .sest-header__megamenu,
.sest-header__nav-item.is-open > .sest-header__megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sest-header__megamenu-inner {
    width: 100%;
    margin: 0;
    padding: 32px 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.sest-header__megamenu--narrow .sest-header__megamenu-inner {
    grid-template-columns: repeat(2, minmax(0, 360px));
    justify-content: start;
}

.sest-header__mm-heading {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sest-header-text-muted) !important;
    margin: 0 0 16px;
}

.sest-header__mm-star {
    color: var(--sest-header-accent, #04D1B8);
}

.sest-header__mm-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}
.sest-header__mm-list li {
    margin: 0 0 8px;
}
.sest-header__mm-list li:last-child {
    margin-bottom: 0;
}

.sest-header__mm-link {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 0;
    color: var(--sest-header-text) !important;
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.18s ease;
}
.sest-header__mm-link:hover,
.sest-header__mm-link:focus-visible {
    color: var(--sest-header-accent, #04D1B8) !important;
}

.sest-header__mm-link--placeholder {
    color: var(--sest-header-text-muted) !important;
    font-style: italic;
    cursor: default;
}
.sest-header__mm-link--placeholder:hover {
    color: var(--sest-header-text-muted) !important;
}

.sest-header__mm-item--featured .sest-header__mm-link {
    font-weight: 700;
}

.sest-header__mm-note {
    color: var(--sest-header-accent, #04D1B8) !important;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 4px;
}

.sest-header__mm-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--sest-header-border);
    color: var(--sest-header-accent, #04D1B8) !important;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.92rem;
}
.sest-header__mm-cta:hover {
    color: #FFFFFF !important;
}

.sest-header__mm-cta--placeholder {
    color: var(--sest-header-text-muted) !important;
    font-style: italic;
    cursor: default;
}

.sest-header__nav-link--placeholder {
    opacity: 0.7;
    cursor: default;
}

/* ─── CTA Button ─────────────────────────────────────────────── */

.sest-header__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--sest-header-cta, #6944FF);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.92rem;
    border-radius: 999px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}
.sest-header__cta:hover,
.sest-header__cta:focus-visible {
    background: var(--sest-header-cta-hover, #5836E0);
    color: #fff !important;
    transform: translateY(-1px);
}

/* ─── Mobile Hamburger ───────────────────────────────────────── */

.sest-header__hamburger {
    display: none !important;
    width: 44px;
    height: 44px;
    background: transparent !important;
    border: 0 !important;
    cursor: pointer;
    padding: 0 !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    border-radius: 6px;
}
.sest-header__hamburger-bar {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background: #FFFFFF !important;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin: 0 !important;
    padding: 0 !important;
}
.sest-header.is-drawer-open .sest-header__hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.sest-header.is-drawer-open .sest-header__hamburger-bar:nth-child(2) {
    opacity: 0;
}
.sest-header.is-drawer-open .sest-header__hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile Bottom CTA (Fixed) ──────────────────────────────── */

.sest-header__mobile-cta {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--sest-header-z) - 1);
    padding: 14px 16px;
    background: var(--sest-header-cta, #6944FF);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 -4px 16px rgba(26, 26, 46, 0.12);
}
.sest-header__mobile-cta:hover,
.sest-header__mobile-cta:focus-visible {
    background: var(--sest-header-cta-hover, #5836E0);
    color: #fff !important;
}

/* ─── Responsive ─────────────────────────────────────────────── */

@media (max-width: 1280px) {
    .sest-header__bar-inner {
        padding: 0 24px;
    }
    .sest-header__topbar-inner {
        padding: 8px 24px;
    }
    .sest-header__megamenu-inner {
        padding: 32px 24px;
    }
}

@media (max-width: 1024px) {
    .sest-header__bar-inner {
        gap: 16px;
        padding: 0 16px;
    }
    .sest-header__topbar-inner {
        padding: 8px 16px;
    }
    .sest-header__nav-link {
        padding: 0 10px;
        font-size: 0.9rem;
    }
    .sest-header__megamenu-inner {
        padding: 24px 16px;
        gap: 28px;
    }
}

@media (max-width: 900px) {
    .sest-header__nav,
    .sest-header__cta {
        display: none;
    }
    .sest-header__hamburger {
        display: inline-flex !important;
    }
    .sest-header__bar-inner {
        justify-content: space-between;
    }
    .sest-header__mobile-cta {
        display: block;
    }

    /* When drawer is open, pin the whole header to the viewport top so the bar
       (logo + hamburger) always shows. Both header and drawer use position: fixed
       — predictable stacking via z-index. */
    .sest-header.is-drawer-open {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
    }

    /* Drawer fills viewport from below the bar to the bottom edge. */
    .sest-header.is-drawer-open .sest-header__nav {
        display: block;
        position: fixed;
        top: var(--sest-header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--sest-header-bg, #000000);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 0 88px; /* leave room for fixed bottom CTA */
        z-index: calc(var(--sest-header-z) + 1);
    }

    /* Lock body scroll while drawer is open so the drawer itself can scroll without
       moving the underlying page. The class is toggled by sest-header.js. */
    body.sest-header-drawer-open {
        overflow: hidden;
    }
    .sest-header.is-drawer-open .sest-header__nav-list {
        display: block;
        height: auto;
    }
    .sest-header__nav-item {
        display: block;
        border-bottom: 1px solid var(--sest-header-border);
    }
    .sest-header__nav-link {
        padding: 16px 24px;
        font-size: 1rem;
        height: auto;
        flex: 1;
    }
    .sest-header__nav-link .sest-header__caret {
        display: none;
    }
    .sest-header__nav-item.has-dropdown {
        display: flex;
        flex-wrap: wrap;
    }
    .sest-header__nav-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        background: transparent;
        border: none;
        color: #FFFFFF;
        cursor: pointer;
    }
    .sest-header__nav-toggle-icon {
        font-size: 1.2rem;
        line-height: 1;
        transition: transform 0.2s ease;
        display: inline-block;
    }
    .sest-header__nav-item.is-open .sest-header__nav-toggle-icon {
        transform: rotate(180deg);
    }
    .sest-header__megamenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-top: 1px solid var(--sest-header-border);
        background: var(--sest-header-bg-panel, #0A0A0A);
        flex-basis: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .sest-header__nav-item.is-open .sest-header__megamenu {
        max-height: 2000px;
    }
    .sest-header__megamenu-inner {
        display: block;
        padding: 16px 24px 24px;
    }
    .sest-header__mm-col {
        margin-bottom: 24px;
    }
    .sest-header__mm-col:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .sest-header__topbar-inner {
        padding: 8px 16px;
    }
    .sest-header__logo {
        height: 32px !important;
    }
}

/* ─── Body padding so fixed bottom CTA doesn't cover content ── */

@media (max-width: 900px) {
    body {
        padding-bottom: 56px;
    }
}
