/* Prevent text selection and image dragging anywhere in the nav */
.navbar,
.dropdown-content,
.mobile-sidebar {
    user-select: none;
    -webkit-user-select: none;
}

.navbar img,
.dropdown-content img,
.mobile-sidebar img {
    -webkit-user-drag: none;
    pointer-events: none; /* images inside nav are purely decorative */
}

/* Restore pointer events on logo link so it stays clickable */
.logo-img {
    pointer-events: auto;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px; /* Slightly increased size */
    padding: 0 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 1.2rem; /* Tightened gap to group items closer */
    height: 100%;
}

.logo-img {
    display: flex;
    align-items: center;
    margin-right: 1rem; /* Extra space after logo */
}

.logo-img img {
    height: 60px; /* Slightly larger logo */
    width: auto;
    display: block;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link, .dropbtn {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem; /* Reduced size */
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 100%;
    padding: 0 0.2rem;
    transition: color 0.2s;
    white-space: nowrap; /* Keep items in 1 row */
    position: relative;
}

.nav-link:hover, .dropbtn:hover, .dropbtn.active, .nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after, .dropbtn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 3px 3px 0 0;
}

.arrow {
    width: 12px;
    height: auto;
    transition: transform 0.3s ease;
}

/* Mega Menu Dropdown */
.dropdown-content {
    position: fixed;
    top: 90px; /* Height of the navbar */
    left: 0;
    width: 100vw;
    background-color: var(--dropdown-bg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.07);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: opacity 0.18s ease-out 0.1s, transform 0.18s ease-out 0.1s, visibility 0s linear 0.28s;
    z-index: 99; /* Below navbar z-index */
}

.nav-item.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

/* Suppresses slide-in animation when swapping between dropdowns */
.dropdown-content.no-anim {
    transition: none !important;
}

.nav-item.dropdown:hover .dropbtn {
    color: var(--accent-color);
}

.nav-item.dropdown:hover .arrow {
    transform: rotate(180deg);
}

.mega-menu-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 3.5rem;
    display: flex;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
}

.mega-column {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    padding: 0 2rem;
    border-right: 1px solid var(--border-color);
}

.mega-column:first-child {
    padding-left: 0;
}

.mega-column:last-child {
    border-right: none;
}

/* Column section header label */
.mega-col-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
    padding: 0 1rem;
}

/* Card-style mega menu items */
.mega-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1rem;
    border-radius: 0;
    color: var(--text-color);
    text-decoration: none;
    transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    border: 1px solid transparent;
    background: transparent;
}

.mega-card:hover {
    background: #fff;
    border-color: var(--border-color);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.mega-icon-wrapper {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    border-radius: 0;
    color: #fff;
    transition: background 0.18s ease;
}

.mega-card:hover .mega-icon-wrapper {
    background: #a50000;
    color: #fff;
}

.mega-icon {
    font-size: 19px;
    display: block;
    line-height: 1;
}

.mega-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.mega-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: color 0.18s;
    line-height: 1.2;
}

.mega-card:hover .mega-title {
    color: var(--accent-color);
}

.mega-desc {
    font-size: 0.73rem;
    color: #999;
    font-weight: 400;
    line-height: 1.3;
}


/* ===== MOBILE NAV ===== */
/* Hide mobile nav elements on desktop */
.mobile-menu-btn,
.mobile-sidebar,
.mobile-overlay {
    display: none;
}

@media (max-width: 1024px) {
    /* Hide desktop nav items, show hamburger */
    .nav-left .nav-item,
    .nav-left .nav-link,
    .nav-right .nav-item,
    .nav-right .cta-button,
    .nav-right .icon-links,
    .dropdown-content {
        display: none !important;
    }

    .navbar {
        padding: 0 1.5rem;
        height: 70px;
        flex-direction: row;
        justify-content: space-between;
    }

    .nav-left {
        gap: 0;
    }

    .nav-right {
        gap: 0;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.4rem;
        border-radius: 0;
        transition: background 0.2s;
    }

    .mobile-menu-btn:hover {
        background: var(--hover-bg);
    }

    .mobile-menu-btn img {
        width: 26px;
        height: 26px;
    }

    /* Overlay */
    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 200;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Sidebar Panel */
    .mobile-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 320px;
        max-width: 90vw;
        background: #fff;
        z-index: 300;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    }

    .mobile-sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar Header */
    .mobile-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.4rem;
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .mobile-sidebar-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--accent-color);
        letter-spacing: 0.3px;
    }

    .mobile-close-btn {
        background: none;
        border: none;
        font-size: 1.8rem;
        line-height: 1;
        color: var(--text-color);
        cursor: pointer;
        padding: 0.2rem 0.5rem;
        border-radius: 0;
        transition: background 0.2s, color 0.2s;
    }

    .mobile-close-btn:hover {
        background: var(--hover-bg);
        color: var(--accent-color);
    }

    /* Nav scroll area */
    .mobile-nav {
        flex: 1;
        overflow-y: auto;
        padding: 0.5rem 0;
    }



    .mobile-nav-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 0.9rem 1.4rem;
        background: none;
        border: none;
        font-family: inherit;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-color);
        cursor: pointer;
        transition: color 0.2s, background 0.2s;
        text-align: left;
    }

    .mobile-nav-title:hover {
        color: var(--accent-color);
        background: var(--hover-bg);
    }

    .mobile-nav-group.open .mobile-nav-title {
        color: var(--accent-color);
    }

    .mobile-arrow {
        width: 12px;
        height: 12px;
        transition: transform 0.25s ease;
        opacity: 0.5;
        flex-shrink: 0;
    }

    .mobile-nav-group.open .mobile-arrow {
        transform: rotate(180deg);
        opacity: 1;
    }

    .mobile-nav-sub {
        display: none;
        flex-direction: column;
        background: #fafafa;
        border-left: 3px solid var(--accent-color);
        margin: 0 1.4rem 0.4rem 1.4rem;
        border-radius: 0;
    }

    .mobile-nav-group.open .mobile-nav-sub {
        display: flex;
    }

    .mobile-nav-sub a {
        padding: 0.65rem 1rem;
        text-decoration: none;
        color: #555;
        font-size: 0.85rem;
        font-weight: 500;
        transition: color 0.2s;
    }

    .mobile-nav-sub a:hover {
        color: var(--accent-color);
    }

    /* Simple link (no accordion) */
    .mobile-nav-link {
        display: block;
        padding: 0.9rem 1.4rem;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-color);
        transition: color 0.2s, background 0.2s;
    }

    .mobile-nav-link:hover {
        color: var(--accent-color);
        background: var(--hover-bg);
    }

    /* Sidebar Footer */
    .mobile-sidebar-footer {
        flex-shrink: 0;
        padding: 1.2rem 1.4rem;
        border-top: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-book-btn {
        display: block;
        text-align: center;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        letter-spacing: 0.5px;
        border-radius: 0;
    }

    .mobile-sidebar-icons {
        display: flex;
        gap: 0.5rem;
    }

    .mobile-icon-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex: 1;
        justify-content: center;
        padding: 0.6rem 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: 0;
        text-decoration: none;
        color: var(--text-color);
        font-size: 0.82rem;
        font-weight: 600;
        transition: background 0.2s, color 0.2s, border-color 0.2s;
    }

    .mobile-icon-link:hover {
        background: var(--hover-bg);
        border-color: var(--accent-color);
        color: var(--accent-color);
    }

    .mobile-icon-link img {
        width: 18px;
        height: 18px;
    }
}
