/* ==========================================================================
   SAN & SAN TOURS - CUSTOM NAVIGATION MODULAR STYLESHEET
   ========================================================================== */

/* --- TOP BAR MOBILE RESPONSIVE OPTIMIZATIONS --- */
.top-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #495057;
}

/* Fixes top bar breaking or content going missing on small devices */
@media (max-width: 767.98px) {
    .top-bar .top-left {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100%;
        padding-left: 5px;
    }
    .top-bar .text-nowrap {
        white-space: normal !important; /* Allows long address to wrap without disappearing */
        display: flex;
        align-items: flex-start;
        gap: 6px;
    }
    .top-bar .text-nowrap i {
        margin-top: 3px;
        flex-shrink: 0;
    }
}

.social-circle {
    width: 28px;
    height: 28px;
    background-color: #e9ecef;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 512px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.social-circle:hover {
    background-color: #d67d2a;
    color: #fff;
}

/* --- BRAND LOGO AND LINKS --- */
.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}
.brand-text strong {
    color: #212529;
    font-size: 1.15rem;
    line-height: 1.2;
}
.brand-text small {
    font-size: 0.75rem;
    letter-spacing: 1px;
}
.btn-safari {
    background-color: #d67d2a;
    border-color: #d67d2a;
    transition: all 0.3s ease;
}
.btn-safari:hover {
    background-color: #bd691e;
    border-color: #bd691e;
}

/* --- DESKTOP HOVER ARCHITECTURE WITH HIT-AREA BRIDGES --- */
@media (min-width: 992px) {
    /* Main Trigger Items */
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
        margin-top: 0;
    }

    .navbar-nav .nav-item.dropdown .dropdown-menu {
        display: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    /* CRITICAL FIX: The CSS Pseudo-Bridge. Stops the dropdown from closing when cursor moves down */
    .navbar-nav .nav-item.dropdown > .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 0;
        right: 0;
        height: 20px;
        background: transparent;
    }

    /* Mega-Dropdown Container Parameters */
    .mega-dropdown {
        position: static !important;
    }
    .mega-menu-content {
        width: 100%;
        left: 0;
        right: 0;
        border-radius: 0 0 8px 8px !important;
    }

    /* Sub-menu Multi-tier Hover flyout under Services */
    .dropdown-submenu {
        position: relative;
    }
    .dropdown-submenu .dropdown-menu {
        top: 0;
        left: 100%;
        margin-left: 0px;
        border-radius: 4px;
        min-width: 760px; /* Expands deep layout grids */
    }
    .dropdown-submenu:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
    }
    /* Horizontal structural gap bridge for sub-menu panels */
    .dropdown-submenu > .dropdown-menu::before {
        content: '';
        position: absolute;
        top: 0;
        left: -20px;
        width: 20px;
        height: 100%;
        background: transparent;
    }
}

/* --- RE-STYLED INNER COMPONENT LAYOUTS --- */
.mega-side-tabs {
    min-width: 220px;
    border-right: 1px solid #e9ecef;
}
.mega-side-tabs .nav-link {
    color: #495057;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.mega-side-tabs .nav-link.active, 
.mega-side-tabs .nav-link:hover {
    background-color: #d67d2a !important;
    color: #ffffff !important;
}
.mega-links li {
    margin-bottom: 0.4rem;
}
.mega-links a {
    color: #495057;
    text-decoration: none;
    font-size: 0.88rem;
    display: inline-block;
    transition: all 0.2s ease;
}
.mega-links a:hover {
    color: #d67d2a;
    padding-left: 4px;
}

/* --- MOBILE TABS & SMARTPHONE TAP FIXES --- */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: 75vh;
        overflow-y: auto;
        padding-bottom: 20px;
    }
    .mega-menu-content {
        position: relative !important;
        box-shadow: none !important;
        background-color: #f8f9fa !important;
    }
    .mega-side-tabs {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        flex-direction: row !important;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px !important;
    }
    .mega-side-tabs .nav-link {
        margin-bottom: 0 !important;
        margin-right: 6px;
        padding: 6px 12px !important;
        font-size: 0.85rem;
    }
    /* Restores nested flyout items back into static linear vertical lists for mobile viewing */
    .dropdown-submenu .dropdown-menu {
        position: relative !important;
        left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        box-shadow: none !important;
        background-color: #ffffff !important;
        border: 1px solid #e9ecef !important;
        padding: 15px !important;
    }
}