/* --- Navigation --- */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(var(--blur-amount));
    border-bottom: 2px solid var(--border-color, var(--accent-primary));
    z-index: 1000;
    display: flex;
    align-items: center;
}

.mobile-logo, .mobile-biz-name, .mobile-theme-btn, .mobile-gm-btn {
    display: none;
}

.nav-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    height: var(--nav-height); /* Fill entire nav height for safe hover */
}

.nav-link:hover { color: var(--accent-gold); }

/* --- Dropdowns --- */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    list-style: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Overlap the navbar bottom border to eliminate the gap/separator line */
    margin-top: -2px; 
}

.nav-item {
    position: relative;
}

/* Add a pseudo-element bridge just in case */
.dropdown::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.nav-item:hover > .dropdown,
.dropdown-item:hover > .flyout {
    opacity: 1;
    visibility: visible;
}

.dropdown-link {
    color: var(--text-dim);
    text-decoration: none;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.dropdown-link:hover {
    background: rgba(181, 131, 90, 0.1);
    color: var(--accent-primary);
    padding-left: 25px;
}

.dropdown-item {
    position: relative;
}

/* Flyout (3rd Layer) */
.dropdown.flyout {
    top: -1px;
    left: 100%;
    margin-left: 0;
    margin-top: 0;
    border: none;
}

/* Bridge for the flyout to left side */
.dropdown.flyout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -15px;
    width: 15px;
    height: 100%;
}

/* Arrows */
.arrow {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.3s;
    display: inline-block;
    margin-left: 8px;
}

.arrow.side {
    transform: rotate(-45deg);
    margin-top: 0;
}

.has-dropdown:hover > .nav-link .arrow {
    transform: rotate(225deg);
    margin-top: 3px;
}

/* --- Responsive --- */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1001; }
.hamburger { display: block; width: 24px; height: 2px; background: var(--accent-primary); position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 100%; height: 2px; background: var(--accent-primary); left: 0; transition: transform 0.3s; }
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: var(--dropdown-bg);
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.4s;
        padding-top: 40px; /* Increased gap for better spacing */
    }
    .nav-menu.active { transform: translateX(0); }
    .nav-link { padding: 15px 40px; display: block; border-bottom: 1px solid rgba(181, 131, 90, 0.1); height: auto; }
    .nav-container { 
        justify-content: flex-start; 
        padding: 0 15px; 
    }

    /* Hamburger Animation */
    .nav-toggle.active .hamburger { background: transparent; }
    .nav-toggle.active .hamburger::before { transform: rotate(45deg) translate(6px, 6px); }
    .nav-toggle.active .hamburger::after { transform: rotate(-45deg) translate(6px, -6px); }

    .mobile-logo {
        display: block;
        height: 45px;
        width: 45px;
        object-fit: cover;
        border-radius: 50%;
        border: 1px solid var(--accent-primary);
        margin-left: 10px;
        box-shadow: 0 0 10px rgba(181, 131, 90, 0.3);
    }

    .mobile-biz-name {
        display: block;
        font-family: 'Cinzel', serif;
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--accent-primary);
        margin-left: 10px;
        letter-spacing: 2px;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .mobile-gm-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--theme-btn-bg);
        border: var(--theme-btn-border, none);
        outline: none;
        width: 40px;
        height: 40px;
        border-radius: var(--theme-btn-radius);
        margin-left: auto;
        margin-right: 10px;
        cursor: pointer;
        transition: all 0.3s;
        padding: 0;
    }

    .mobile-gm-btn:hover, .mobile-gm-btn:active {
        background: var(--theme-btn-hover-bg);
    }

    .mobile-gm-btn .mobile-gm-icon {
        width: 20px;
        height: 20px;
        object-fit: contain;
    }

    .mobile-theme-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--theme-btn-bg);
        border: var(--theme-btn-border, none);
        outline: none;
        color: var(--theme-btn-color);
        width: 40px;
        height: 40px;
        border-radius: var(--theme-btn-radius);
        margin-left: auto;
        cursor: pointer;
        transition: all 0.3s;
        padding: 0;
    }

    .mobile-gm-btn + .mobile-theme-btn {
        margin-left: 0;
    }

    .mobile-theme-btn:hover, .mobile-theme-btn:active {
        background: var(--theme-btn-hover-bg);
        color: var(--theme-btn-hover-color);
    }

    .mobile-theme-btn .theme-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

    /* Mobile Dropdowns */
    .nav-item.active > .dropdown,
    .dropdown-item.active > .flyout {
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        width: 100% !important;
        background: rgba(0,0,0,0.2) !important;
        display: block !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        left: auto !important;
        top: auto !important;
    }
    
    .dropdown {
        display: none;
    }
}
