/* ═══════════════════════════════════════
   HEADER / NAVBAR
   ═══════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: var(--white);
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-logo {
    height: 65px;
    width: auto;
    mix-blend-mode: multiply;
    filter: contrast(1.1) brightness(1.05); /* Helps push slightly grey backgrounds to pure white so multiply makes them transparent */
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-700);
    border-radius: var(--radius-sm);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
}

.dropdown-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px 8px;
    margin-left: -8px;
    /* Pull the arrow closer to the text */
    color: var(--gray-700);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-arrow i {
    font-size: 10px;
    transition: var(--transition);
}

.dropdown-arrow:hover {
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

/* Open dropdown ONLY when hovering arrow or the menu itself */
.nav-dropdown:has(.dropdown-arrow:hover) .dropdown-menu,
.nav-dropdown:has(.dropdown-menu:hover) .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:has(.dropdown-arrow:hover) .dropdown-arrow i,
.nav-dropdown:has(.dropdown-menu:hover) .dropdown-arrow i,
.nav-dropdown.open .dropdown-arrow i {
    transform: rotate(180deg);
}

/* Bridge gap so mouse doesn't exit hover state when moving from arrow to menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--gray-600);
}

.dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
    padding-left: 24px;
}

/* Nav Right — Desktop only */
.nav-right-desktop {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-phone {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.nav-phone i {
    color: var(--accent);
    font-size: 16px;
}

.nav-phone:hover {
    color: var(--primary);
}

/* CTA item — hidden on desktop, shown on mobile */
.nav-cta-item {
    display: none;
    list-style: none;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: var(--transition);
    position: absolute;
    left: 6px;
}

.hamburger {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger::before {
    content: '';
    top: -7px;
}

.hamburger::after {
    content: '';
    top: 7px;
}

/* Hamburger Active State */
.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ═══════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════ */
@media (max-width: 992px) {

    /* Show hamburger */
    .nav-toggle {
        display: block;
        z-index: 10;
    }

    /* Hide desktop phone + CTA */
    .nav-right-desktop {
        display: none;
    }

    /* Smaller logo on mobile */
    .navbar-logo {
        height: 50px;
    }

    .site-header {
        height: auto;
        min-height: 70px;
    }

    .navbar {
        height: auto;
        min-height: 70px;
        padding: 8px 0;
    }

    /* Nav dropdown panel */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: center;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        padding: 16px 0;
        gap: 0;
        z-index: 999;
        max-height: 80vh;
        overflow-y: auto;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links>li {
        width: 100%;
        text-align: center;
    }

    /* Nav links — centered with separators */
    .nav-link {
        padding: 16px 20px;
        width: 100%;
        font-size: 16px;
        display: block;
        text-align: center;
        border-bottom: 1px solid var(--gray-100);
    }

    /* Dropdown toggle row on mobile */
    .nav-dropdown-toggle {
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid var(--gray-100);
    }

    .nav-dropdown-toggle .nav-link {
        border-bottom: none;
        display: inline;
        width: auto;
        padding: 16px 4px 16px 20px;
    }

    .dropdown-arrow {
        padding: 16px 20px 16px 4px;
        margin-left: 0;
    }

    /* Mobile Dropdown menu */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 8px 0;
        display: none;
        background: var(--gray-50);
        border-top: 1px solid var(--gray-100);
    }

    .dropdown-menu::before {
        display: none;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li {
        text-align: center;
    }

    .dropdown-menu a {
        padding: 12px 20px;
        display: block;
        font-size: 14px;
        color: var(--gray-600);
    }

    /* CTA button — show at bottom of mobile nav */
    .nav-cta-item {
        display: block;
        padding: 16px 24px 8px;
        width: 100%;
    }

    .nav-cta-item .btn-block {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 24px;
        font-size: 16px;
        border-radius: var(--radius-full);
    }
}