/* DESKTOP NAV FIX */
@media (min-width: 769px) {
    header nav {
        display: block !important;
        position: static;
        width: auto;
        height: auto;
        background: transparent !important;
        padding: 0;
        box-shadow: none;
        transform: none;
        left: auto;
        right: auto;
        top: auto;
        overflow: visible;
        visibility: visible;
        border: none;
        border-radius: 0;
        margin: 0;
    }

    header nav ul {
        flex-direction: row;
        align-items: center;
        gap: 32px;
        width: auto;
    }

    header nav ul li {
        width: auto;
        border-bottom: none;
        padding-bottom: 0;
    }

    header nav ul li a {
        font-size: 14px !important;
        color: #6B7280 !important;
    }

    header .toggle {
        display: none !important;
    }

    header nav.active {
        left: auto;
        transform: none;
    }

    .nav-overlay {
        display: none !important;
    }
}

/* MOBILE NAVIGATION */
@media (max-width: 768px) {

    /* Override style.css mobile nav styles that conflict */
    header nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        width: 85% !important;
        max-width: 320px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #ffffff !important;
        padding: 0 !important;
        z-index: 1002 !important;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.12);
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    header nav.active {
        transform: translateX(0) !important;
    }

    header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        width: 100%;
    }

    header .container {
        position: relative;
    }

    /* ─── Toggle (hamburger / X) ─── */
    .toggle {
        display: flex !important;
        position: relative;
        z-index: 1003;
        width: 28px;
        height: 22px;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
        background: transparent;
        border: none;
        padding: 0;
    }

    .toggle span {
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: #d97706;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -7px);
    }

    /* ─── Nav inner layout ─── */
    header nav > ul {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        width: 100%;
        padding: 70px 0 30px 0;
        margin: 0;
    }

    header nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
        padding: 0 !important;
        position: relative;
    }

    header nav > ul > li:last-child {
        border-bottom: none;
    }

    /* Remove the orange hover underline from ALL nav li items on mobile */
    header ul li::before {
        display: none !important;
    }

    /* Main nav link styling */
    header nav > ul > li > div,
    header nav > ul > li > a {
        display: flex !important;
        align-items: center;
        padding: 14px 20px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #1f2937 !important;
        text-decoration: none;
        width: 100%;
        box-sizing: border-box;
    }

    header nav > ul > li > div > a {
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #1f2937 !important;
        flex: 1;
    }

    /* ─── Dropdown menus ─── */
    .dropdown-menu {
        position: static !important;
        width: 100% !important;
        background: #fafafa !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: none;
        border-top: 1px solid #f0f0f0;
    }

    .dropdown-menu.active {
        display: block !important;
    }

    .dropdown-menu li {
        border-bottom: none !important;
        padding: 0 !important;
    }

    /* Remove orange underline from dropdown sub-items */
    .dropdown-menu li::before {
        display: none !important;
    }

    .dropdown-menu li a {
        display: block !important;
        padding: 12px 20px 12px 36px !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        color: #4b5563 !important;
        border-bottom: 1px solid #f5f5f5 !important;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .dropdown-menu li:last-child a {
        border-bottom: none !important;
    }

    .dropdown-menu li a:hover,
    .dropdown-menu li a:active {
        background-color: #f3f4f6 !important;
        color: #d97706 !important;
    }

    /* ─── Dropdown toggle chevron ─── */
    .mobile-dropdown-toggle {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px;
        cursor: pointer;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-dropdown-toggle svg {
        transition: transform 0.25s ease;
        width: 16px;
        height: 16px;
        color: #9ca3af;
    }

    .mobile-dropdown-toggle.active svg {
        transform: rotate(180deg);
        color: #d97706;
    }

    /* ─── Dark overlay ─── */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .nav-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* ─── Spacer to push content below fixed header ─── */
    .header-spacer {
        display: block;
        height: 70px;
    }

    /* Hide "Request a demo" button in header on mobile */
    header .flex.items-center .btn-common {
        display: none;
    }
}

/* TABLET STYLES */
@media (min-width: 769px) and (max-width: 1024px) {
    header nav ul {
        gap: 20px !important;
    }

    header nav ul li a {
        font-size: 13px !important;
    }
}

/* HEADER SCROLL EFFECT */
header {
    background: transparent !important;
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease !important;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body.nav-open {
    overflow: hidden;
}