﻿/* =========================================
    NEW HEADER & MEGA MENU STYLES
========================================= */
.site-header {
    background-color: var(--brand-surface);
    border-bottom: 1px solid var(--brand-accent);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.header-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Keeps desktop layout spaced out */
}

.brand-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
    height: 70px;
    align-items: center;
}

.nav-item-trigger {
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    border-bottom: 3px solid transparent;
    transition: color 0.2s;
    white-space: nowrap;
}

    .nav-item-trigger:hover, .nav-item-trigger.active {
        color: var(--brand-accent);
    }

    .nav-item-trigger.active {
        border-bottom: 3px solid var(--brand-accent);
    }

.down-caret {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-item-trigger.open .down-caret {
    transform: rotate(180deg);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.btn-xs {
    padding: 0.225rem 0.25rem !important;
    font-size: 0.85rem;
    line-height: 1.5;
    border-radius: 0.15rem !important;
    font-weight: 500;
}


.icon-btn {
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="dark"] .icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Desktop Mega Menus */
.mega-menu {
    position: absolute;
    top: 70px;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 999;
    padding: 0;
    overflow: hidden;
}

    .mega-menu.show {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

.mega-grid {
    display: flex;
    min-height: 350px;
}

.mega-sidebar {
    width: 220px;
    background-color: var(--brand-bg);
    padding: 30px 20px;
    border-right: 1px solid var(--brand-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .mega-sidebar ul {
        list-style: none;
        padding: 0;
    }

    .mega-sidebar li {
        margin-bottom: 20px;
        font-size: 15px;
        font-weight: 600;
        color: var(--text-main);
        cursor: pointer;
    }

        .mega-sidebar li:hover {
            color: var(--brand-accent);
        }

.sidebar-footer {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: auto;
}

    .sidebar-footer a {
        color: var(--brand-accent);
        font-weight: 600;
        text-decoration: none;
    }

.mega-main {
    flex: 1;
    padding: 30px 40px;
    background: var(--brand-surface);
}

    .mega-main h4 {
        font-size: 13px;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 20px;
        letter-spacing: 0.5px;
    }

    .mega-main ul {
        list-style: none;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .mega-main a {
        color: var(--text-main);
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
    }

        .mega-main a:hover {
            color: var(--brand-accent);
        }

.mega-contact-footer {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 40px;
}

.mega-promo {
    width: 280px;
    padding: 30px;
    background-color: var(--brand-accent-light);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border-left: 1px solid var(--brand-border);
}

[data-theme="dark"] .mega-promo {
    background-color: var(--brand-primary);
}

.mega-promo h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.3;
    font-weight: 700;
}

.mega-promo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.mega-promo .promo-btn {
    background-color: var(--brand-accent);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
    font-size: 14px;
}

/* Menu Positions */
.location-mega-menu {
    left: 150px;
    width: 850px;
    padding: 30px;
    min-height: auto;
}

.dealer-mega-menu {
    right: 130px;
    width: 850px;
}

.generic-menu {
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 800px;
}

    .generic-menu.show {
        transform: translateX(-50%) translateY(0);
    }

/* Location Specific */
.menu-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 25px;
}

.menu-tabs {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--brand-border);
    margin-bottom: 25px;
}

.menu-tab {
    font-size: 16px;
    color: var(--text-muted);
    padding-bottom: 12px;
    cursor: pointer;
    position: relative;
    font-weight: 500;
}

    .menu-tab.active {
        color: var(--brand-accent);
        font-weight: 600;
    }

        .menu-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--brand-accent);
            border-radius: 2px;
        }

.search-block {
    display: flex;
    align-items: center;
    background: var(--brand-surface);
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    padding: 6px 6px 6px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .search-input-wrap input {
        border: none;
        outline: none;
        width: 100%;
        font-size: 15px;
        color: var(--text-main);
        background: transparent;
    }

.explore-btn {
    background-color: var(--brand-accent);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Mobile Navigation */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
    margin-left: 5px;
}

    .hamburger span {
        width: 25px;
        height: 2px;
        background: var(--text-main);
        transition: 0.3s;
    }

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--brand-surface);
    z-index: 998;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

    .mobile-nav-overlay.show {
        display: flex;
    }

.mobile-nav-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--brand-border);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}

    .mobile-nav-item.open {
        color: var(--brand-accent);
        border-bottom-color: transparent;
    }

        .mobile-nav-item.open .down-caret {
            transform: rotate(180deg);
        }

.mobile-submenu {
    display: none;
    background: var(--brand-bg);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    margin-top: 5px;
}

    .mobile-submenu.show {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-submenu h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    margin-top: 15px;
}

.mobile-submenu a {
    display: block;
    padding: 8px 0;
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
}

/* Toggles */
.desktop-toggles {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 15px;
}

.mobile-toggles {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

/* Mobile Profile Box */
.mobile-profile-box {
    background-color: var(--brand-bg);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--brand-border);
}

.mobile-profile-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    color: var(--text-main) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s;
    border-radius: 6px;
}

    .mobile-profile-link:hover {
        background: rgba(0,0,0,0.03);
        color: var(--brand-accent) !important;
    }

[data-theme="dark"] .mobile-profile-link:hover {
    background: rgba(255,255,255,0.05);
}

.mobile-profile-link.text-danger {
    color: #DC2626 !important;
}

    .mobile-profile-link.text-danger:hover {
        background: rgba(220, 38, 38, 0.05);
    }

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mega-menu {
        display: none !important;
    }
    /* Toggle visibility */
    .desktop-toggles {
        display: none !important;
    }

    .mobile-toggles {
        display: flex;
    }
    /* Hide elements on mobile */
    .desktop-support {
        display: none !important;
    }

    .mobile-hide-profile {
        display: none !important;
    }
    /* Push hamburger to the right by forcing space-between */
    .header-container {
        justify-content: space-between !important;
    }
    /* Let the actions container take up the remaining space and align right */
    .nav-actions {
        flex-grow: 1;
        justify-content: flex-end;
    }

    .mobile-left-group {
        gap: 5px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }
}
