/* DESKTOP NAV FIX */
@media (min-width: 1025px) {
    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 (extended through tablet widths - 6 nav items don't fit a horizontal bar below 1025px) */
@media (max-width: 1024px) {

    /* 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;
    }
}

/* Never let the logo get crushed to 0 width by the nav/CTA when space is tight */
header .container > a:first-child {
    flex-shrink: 0;
}

/* MEDIUM DESKTOP: more nav items than fit comfortably at narrower laptop widths */
@media (min-width: 1025px) and (max-width: 1600px) {
    header nav ul {
        gap: 10px !important;
    }

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

    header .btn-common.open-demo-modal {
        padding-left: 16px !important;
        padding-right: 16px !important;
        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;
}

/* ===== NAVBAR SINGLE-LINE FIX ===== */
@media (min-width: 1025px) {
    header nav > ul > li > div {
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
    }
    header nav > ul > li > div > a,
    header nav > ul > li > a {
        white-space: nowrap !important;
    }
    header .flex.items-center .btn-common,
    header .btn-common.open-demo-modal {
        white-space: nowrap !important;
    }
}

/* ===== B-BOOK NAV HIGHLIGHT (always on, every page) ===== */
header nav a[href="FXsolutions-bbook.html"] {
    color: #d6447b !important;
    font-weight: 600 !important;
}

/* ===== VISION-MISSION-COL CARD STYLE ===== */
/* body prefix raises specificity to (0,1,1) so this beats enhance.css's (0,1,0) rule
   even though enhance.css loads after nav-fix.css and both use !important */
body .vision-mission-col {
    background: rgba(253, 204, 41, 0.15) !important;
    box-shadow: 0px 0px 16px 0px rgba(217, 119, 6, 0.22) inset !important;
    border-radius: 16px !important;
    padding: clamp(20px, 2.5vw, 36px) !important;
    border: 1px solid rgba(253, 204, 41, 0.25) !important;
}

/* ===== HEADING & TEXT CONTRAST ON GRADIENT BACKGROUND ===== */
/* enhance.css forces background-color:transparent on all sections so the animated
   amber/purple gradient shows through. Dark/near-black text becomes invisible against
   the dark-purple portion of that gradient.
   Fix strategy: white text-shadow creates a glow that lifts contrast on dark
   backgrounds while being imperceptible on light amber portions.
   Note: enhance.css already covers discover-why, inner-cta-section etc (lines 84-95);
   the rules below cover the gaps not handled there. */

.has-enh-bg .section-heading h2 {
    color: #111827 !important;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.85), 0 0 36px rgba(255, 255, 255, 0.5) !important;
}

/* trade-on-go-section: "Why Businesses Choose …" heading + body text + bullets */
.has-enh-bg .trade-on-go-col h2,
.has-enh-bg .trade-on-go-col h3 {
    color: #111827 !important;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.85), 0 0 36px rgba(255, 255, 255, 0.5) !important;
}
.has-enh-bg .trade-on-go-col p,
.has-enh-bg .trade-on-go-col ul li {
    color: #1e293b !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.7) !important;
}

/* ===== WIDE (MULTI-COLUMN) DROPDOWN, e.g. Formation jurisdictions ===== */
@media (min-width: 1025px) {
    header nav ul li .dropdown-menu.wide {
        min-width: 460px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0 8px;
        padding: 10px 8px;
    }

    header nav ul li .dropdown-menu.wide li a {
        white-space: nowrap;
        padding: 8px 12px;
    }
}