@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
}

:root {
    --primary-blue: #0046ad;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-topbar: #f1f5f9;
    --bg-search: #eef4ff;
}

/* Base Header */
.site-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

/* --- Top Bar (Desktop Only) --- */
.top-bar {
    background-color: var(--bg-topbar);
    padding: 6px 5%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 13px;
}

.top-bar-links {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
}

.top-bar-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.25s ease;
}

.top-bar-links a:hover,
.top-bar-links a.active {
    color: var(--primary-blue);
}

.top-bar-links a.active {
    font-weight: 700;
}

.lang-select {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    cursor: pointer;
}

/* --- Main Navigation Bar --- */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5%;
    background-color: #ffffff;
    position: relative;
}

/* Logo */
.logo-container img {
    height: 52px;
    width: auto;
    display: block;
}

/* Nav Menu Items */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.nav-item {
    position: relative;
    padding: 10px 0;
    /* Continuous hover zone */
}

.nav-link {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    transition: color 0.25s ease;
}

.nav-link:hover,
.nav-link.active,
.nav-item.active > .nav-link {
    color: var(--primary-blue);
}

.nav-link.active,
.nav-item.active > .nav-link {
    font-weight: 700;
}

.nav-link.active::after,
.nav-item.active > .nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-blue);
    border-radius: 3px 3px 0 0;
}

.chevron-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-item:hover .chevron-icon {
    transform: rotate(180deg);
}

/* Desktop Dropdown Styling & Smooth Hover Fix */
.dropdown-menu {
    list-style: none;
    background-color: #ffffff;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
}

@media (min-width: 993px) and (max-width: 1240px) {
    .main-nav {
        padding: 12px 3.5%;
    }

    .nav-menu {
        gap: 18px;
    }

    .nav-link {
        font-size: 14px;
    }
}

@media (min-width: 993px) {
    .cta-btn {
        white-space: nowrap;
    }

    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(12px);
        pointer-events: none;
        transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
    }

    /* Safe Invisible Bridge to Prevent Dropdown Closing early */
    .nav-item::after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 0;
        width: 100%;
        height: 15px;
        display: block;
    }

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

    .dropdown-menu li a {
        display: block;
        padding: 10px 20px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        transition: background-color 0.25s ease, color 0.25s ease;
    }

    .dropdown-menu li a:hover {
        background-color: #f8fafc;
        color: var(--primary-blue);
    }

    /* Explicitly hide mobile close icon on Desktop */
    .mobile-close-btn {
        display: none !important;
    }
}

/* Nav Actions (Search & CTA) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- HEADER SEARCH ICON BUTTON --- */
.header-search-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #0046ad;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-search-btn:hover {
    background: #0046ad;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-search-btn i {
    font-size: 16px;
    line-height: 1;
}

.cta-btn {
    background-color: var(--primary-blue);
    color: #ffffff;
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background-color 0.25s ease;
}

.cta-btn:hover {
    background-color: #003380;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #1f2937;
    cursor: pointer;
    padding: 4px;
}

/* --- Mobile Overlay & Sliding Right Drawer --- */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 992px) {
    .top-bar {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .cta-btn {
        display: none;
    }

    .logo-container img {
        height: 42px;
    }

    /* Right-side Sliding Drawer */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        /* Slide out to the right side */
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        align-items: flex-start;
        padding: 70px 24px 20px 24px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transition: right 0.35s ease;
        z-index: 1100;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
        /* Slide in smoothly from right */
    }

    .nav-item {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-link {
        justify-content: space-between;
        width: 100%;
        padding: 14px 0;
    }

    .nav-link.active,
    .nav-item.active > .nav-link {
        color: var(--primary-blue);
        font-weight: 700;
        background-color: #eef4ff;
        padding-left: 14px;
        padding-right: 14px;
        border-radius: 8px;
    }

    .nav-link.active::after,
    .nav-item.active > .nav-link::after {
        display: none;
    }

    .dropdown-menu {
        display: none;
        position: static;
        box-shadow: none;
        background-color: #f8fafc;
        border-radius: 6px;
        padding: 6px 12px;
        margin-bottom: 10px;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-menu.mobile-open {
        display: block;
    }

    .dropdown-menu li a {
        display: block;
        padding: 8px 12px;
        color: #4b5563;
        text-decoration: none;
        font-size: 14px;
    }

    /* Close Icon on Mobile */
    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-dark);
        cursor: pointer;
    }
}