/* =========================================================
   FAYADH WEBSITE — HEADER
   Logo, navigation, language switcher, Download App button
   and the mobile menu. Responsive rules are at the end of this file.
========================================================= */


/* =========================================================
   1. HEADER BAR
========================================================= */

.site-header {
    width: 100%;

    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid var(--border);

    box-shadow: var(--shadow-sm);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


/* Header Container */

.header-container {
    width: min(100% - 48px, var(--container-width));

    min-height: var(--header-height);

    margin-inline: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 32px;
}


/* =========================================================
   2. BRAND / LOGO
========================================================= */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;
}


/* Brand Logo */

.brand-logo {
    width: auto;
    height: 36px;

    object-fit: contain;
}


/* Brand Name & Tagline (stacked, beside the logo) */

.brand-text {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.brand-name {
    color: var(--primary);

    font-size: 23px;
    font-weight: 800;

    letter-spacing: 1.5px;
    line-height: 1;
}

html[dir="rtl"] .brand-name {
    letter-spacing: 0;
}

.brand-tagline {
    color: var(--text);

    font-size: 12px;
    font-weight: 600;

    line-height: 1;

    white-space: nowrap;
}


/* =========================================================
   3. DESKTOP NAVIGATION
========================================================= */

.primary-navigation {
    display: flex;
    align-items: center;

    gap: 32px;
}

.nav-link {
    position: relative;

    color: var(--text-nav);

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;

    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}


/* Underline Hover Effect */

.nav-link::after {
    content: "";

    position: absolute;

    inset-inline-start: 0;
    bottom: -8px;

    width: 0;
    height: 2px;

    background: var(--primary);

    border-radius: 2px;

    transition: var(--transition);
}

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


/* Current page (aria-current="page"), e.g. "For Providers" on providers.html */

.nav-link.is-current {
    color: var(--primary);
}

.nav-link.is-current::after {
    width: 100%;
}


/* =========================================================
   4. HEADER ACTIONS
========================================================= */

.header-actions {
    display: flex;
    align-items: center;

    gap: 18px;

    flex-shrink: 0;
}


/* =========================================================
   5. LANGUAGE SWITCHER
   Globe + EN / عربي with a small menu (same as the app).
========================================================= */

.language-switcher {
    position: relative;
}

.language-button {
    min-height: 40px;

    padding: 8px 10px;

    display: inline-flex;
    align-items: center;

    gap: 5px;

    border: 0;
    border-radius: 9px;

    background: transparent;

    color: var(--heading);

    font-size: 15px;
    font-weight: 600;
    line-height: 1;

    white-space: nowrap;

    transition: var(--transition);
}

.language-button:hover,
.language-switcher.is-open .language-button {
    background: var(--primary-light);
}

.language-icon {
    width: 19px;
    height: 19px;

    color: var(--primary);

    flex-shrink: 0;
}

/* In Arabic the label is green, like the app. */

html[lang="ar"] .language-current {
    color: var(--primary);
}

.language-chevron {
    width: 16px;
    height: 16px;

    color: var(--text);

    transition: var(--transition);
}

.language-switcher.is-open .language-chevron {
    transform: rotate(180deg);
}


/* Menu */

.language-menu {
    position: absolute;

    top: calc(100% + 8px);
    inset-inline-end: 0;

    z-index: 1100;

    min-width: 170px;

    padding: 6px;

    list-style: none;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow: var(--shadow-md);
}

.language-menu[hidden] {
    display: none;
}

.language-option {
    width: 100%;

    padding: 11px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: var(--text-dark);

    font-size: 14px;
    font-weight: 600;

    text-align: start;

    transition: var(--transition);
}

.language-option:hover,
.language-option:focus-visible {
    background: var(--background);
}

.language-option[aria-checked="true"] {
    color: var(--primary);
    font-weight: 700;
}

.language-option[aria-checked="true"]::after {
    content: "✓";

    font-size: 14px;
    font-weight: 800;
}


/* =========================================================
   6. DOWNLOAD APP BUTTON
========================================================= */

.header-cta {
    min-height: 44px;

    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    background: var(--primary);
    color: var(--white);

    border: 1px solid var(--primary);
    border-radius: 9px;

    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;

    transition: var(--transition);
}

.header-cta:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);

    box-shadow: var(--shadow-sm);

    transform: translateY(-1px);
}

.cta-arrow {
    display: inline-block;

    font-size: 16px;
    line-height: 1;

    transition: var(--transition);
}

html[dir="rtl"] .header-cta .cta-arrow {
    transform: scaleX(-1);
}


/* =========================================================
   7. MOBILE MENU BUTTON
========================================================= */

.mobile-menu-toggle {
    width: 42px;
    height: 42px;

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 5px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: 9px;

    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary-light);
}

.mobile-menu-toggle span {
    width: 19px;
    height: 2px;

    background: var(--primary);

    border-radius: 5px;

    transition: var(--transition);
}


/* Hamburger Animation */

.mobile-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* Mobile CTA Hidden on Desktop */

.mobile-nav-cta {
    display: none;
}


/* =========================================================
   8. RESPONSIVE — SMALL LAPTOP (≤ 1279px)
   Tighter gaps so all six links still fit next to the logo
   and the header actions (the English header needs ~1056px).
========================================================= */

@media (max-width: 1279px) {

    .header-container {
        gap: 24px;
    }

    .primary-navigation {
        gap: 22px;
    }

}


/* =========================================================
   9. RESPONSIVE — MENU MODE (≤ 1100px)
   Below this the links don't fit, so they move into the
   hamburger menu. Must match MENU_BREAKPOINT in js/config.js.
========================================================= */

@media (max-width: 1100px) {

    :root {
        --header-height: 64px;
    }

    .header-container {
        width: calc(100% - 32px);

        gap: 16px;
    }

    .brand-name {
        font-size: 21px;
    }

    .brand-logo {
        height: 33px;
    }

    .header-actions {
        gap: 12px;
    }

    /* Hide desktop CTA */

    .header-cta {
        display: none;
    }

    /* Show hamburger */

    .mobile-menu-toggle {
        display: flex;
    }

    /* Menu panel: drops down under the menu button, full width
       on phones, at most 360px wide on tablets. */

    .primary-navigation {
        display: none;

        position: absolute;

        top: 100%;

        inset-inline-end: 16px;

        width: min(360px, calc(100% - 32px));

        padding: 14px;

        flex-direction: column;
        align-items: stretch;

        gap: 0;

        background: var(--white);

        border: 1px solid var(--border);
        border-radius: 12px;

        box-shadow: var(--shadow-md);
    }

    .primary-navigation.is-open {
        display: flex;
    }

    /* Mobile Navigation Links */

    .nav-link {
        padding: 13px 12px;

        border-bottom: 1px solid var(--border);

        font-size: 14px;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover {
        background: var(--background);
        border-radius: 6px;
    }

    /* Mobile Download CTA */

    .mobile-nav-cta {
        display: flex;

        align-items: center;
        justify-content: center;

        margin-top: 12px;

        padding: 12px;

        background: var(--primary);
        color: var(--white);

        border-radius: 8px;

        font-size: 13px;
        font-weight: 700;

        transition: var(--transition);
    }

    .mobile-nav-cta:hover {
        background: var(--primary-dark);
    }

}


/* =========================================================
   10. RESPONSIVE — SMALL MOBILE (≤ 380px)
========================================================= */

@media (max-width: 380px) {

    .header-container {
        gap: 10px;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-logo {
        height: 30px;
    }

    .language-button {
        padding-inline: 6px;

        font-size: 14px;
    }

    .language-chevron {
        display: none;
    }

}


/* =========================================================
   11. RESPONSIVE — LARGE DESKTOP (≥ 1440px)
========================================================= */

@media (min-width: 1440px) {

    :root {
        --header-height: 76px;
    }

    .primary-navigation {
        gap: 38px;
    }

}
