/* =========================================================
   SyntesAI — Site Header
   White-background, responsive (desktop nav + mobile drawer)
   ========================================================= */

:root {
    --sa-header-height: 70px;
    --sa-header-bg: #1A9BE8;
    --sa-header-text: #ffffff;
    --sa-header-muted: rgba(255, 255, 255, 0.8);
    --sa-header-hover: rgba(255, 255, 255, 0.85);
    --sa-header-border: rgba(255, 255, 255, 0.25);
    --sa-header-blue: #1A9BE8;
    --sa-container-max: 1320px;
    --sa-container-pad: 24px;
}

/* Reset link/list defaults inside the header */
.sa-header,
.sa-header * {
    box-sizing: border-box;
}

.sa-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--sa-header-bg);
    border-bottom: none;
    color: var(--sa-header-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sa-header__inner {
    max-width: var(--sa-container-max);
    margin: 0 auto;
    padding: 0 var(--sa-container-pad);
    min-height: var(--sa-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ---------- Brand / Logo ---------- */
.sa-header__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.sa-header__brand .custom-logo-link img,
.sa-header__brand img {
    display: block;
    max-height: 40px;
    width: auto;
}

.sa-header__logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #ffffff;
}
.sa-header__logo-text span {
    color: #ffffff;
}

/* ---------- Primary Navigation ---------- */
.sa-header__nav {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: space-between ;
}

.sa-header__menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sa-header__menu > li {
    position: relative;
}

.sa-header__menu > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    transition: opacity .15s ease;
}

.sa-header__menu > li > a:hover,
.sa-header__menu > li.current-menu-item > a {
    color: #ffffff;
    opacity: 0.8;
}

/* Caret for items with sub-menu */
.sa-header__menu > li.menu-item-has-children > a::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease;
    margin-left: 2px;
}

.sa-header__menu > li.menu-item-has-children:hover > a::after,
.sa-header__menu > li.menu-item-has-children:focus-within > a::after {
    transform: rotate(-135deg) translateY(-2px);
}

/* ---------- Sub-menu (desktop dropdown) ---------- */
.sa-header__menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 10px;
    padding: 8px;
    margin: 0;
    list-style: none;
    box-shadow: 0 14px 40px rgba(10, 20, 40, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    z-index: 10;
}

.sa-header__menu > li:hover > .sub-menu,
.sa-header__menu > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sa-header__menu .sub-menu li a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: #0b1f3a;
    text-decoration: none;
    border-radius: 6px;
    transition: background .15s ease, color .15s ease;
}

.sa-header__menu .sub-menu li a:hover {
    background: #f3f6fb;
    color: #1A9BE8;
}

/* ---------- Actions: Login + CTA ---------- */
.sa-header__actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.sa-header__login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    transition: background .15s ease, border-color .15s ease;
}
.sa-header__login:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}
.sa-header__login-icon { display: none; }

/* White filled CTA button */
.sa-header__cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sa-header-blue);
    text-decoration: none;
    border-radius: 999px;
    background: #ffffff;
    border: 1.5px solid #ffffff;
    transition: opacity .15s ease, transform .15s ease;
}
.sa-header__cta:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ---------- Mobile toggle (hamburger) ---------- */
.sa-header__toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.sa-header__toggle-bar {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease, top .25s ease;
}
.sa-header__toggle-bar:nth-child(1) { top: 14px; }
.sa-header__toggle-bar:nth-child(2) { top: 21px; }
.sa-header__toggle-bar:nth-child(3) { top: 28px; }

.sa-header.is-open .sa-header__toggle-bar:nth-child(1) { top: 21px; transform: rotate(45deg); }
.sa-header.is-open .sa-header__toggle-bar:nth-child(2) { opacity: 0; }
.sa-header.is-open .sa-header__toggle-bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

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

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sa-header__toggle { display: inline-block; }

    .sa-header__nav {
        position: fixed;
        top: var(--sa-header-height);
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--sa-header-height));
        overflow-y: auto;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        background: var(--sa-header-bg);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding: 16px var(--sa-container-pad) 28px;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
        box-shadow: 0 20px 40px rgba(10, 20, 40, 0.15);
    }

    .sa-header.is-open .sa-header__nav {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .sa-header__menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .sa-header__menu > li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .sa-header__menu > li > a {
        padding: 16px 0;
        font-size: 16px;
        justify-content: space-between;
        width: 100%;
        color: #ffffff;
    }

    .sa-header__menu .sub-menu {
        position: static;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0 0 8px 12px;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }
    .sa-header__menu > li.is-open > .sub-menu {
        display: block;
    }
    .sa-header__menu .sub-menu li a {
        color: rgba(255, 255, 255, 0.85);
    }
    .sa-header__menu .sub-menu li a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .sa-header__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 20px;
    }
    .sa-header__login { justify-content: center; padding: 12px 22px; }
    .sa-header__cta { justify-content: center; padding: 12px 22px; }
}

/* Prevent body scroll while mobile menu is open */
body.sa-menu-open {
    overflow: hidden;
}
