
/* =========================================================
   MOBILE RESPONSIVE MAIN MENU
   For the existing .nav-container / .nav-links structure
   ========================================================= */

/* Desktop */
.nav-container {
    position: relative;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-light, #e8e3d8);
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark, #000);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    z-index: 110;
}

.mobile-menu-toggle span {
    display: block;
    width: 21px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .25s ease, opacity .25s ease;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 1024px) {
    .nav-container {
        padding-left: 28px;
        padding-right: 28px;
    }

    .nav-links {
        gap: 18px;
    }

    .nav-links a {
        font-size: 13px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 767px) {

    body.menu-open {
        overflow: hidden;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav-container {
        min-height: 68px;
        height: 68px;
        padding: 0 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    /* Keep logo visible */
    .brand-logo {
        position: relative;
        z-index: 110;
        max-width: calc(100% - 60px);
        white-space: nowrap;
    }

    /* Hamburger */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile dropdown */
    .nav-links {
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 0;
        margin: 0;
        padding: 10px 18px 18px;

        list-style: none;
        text-transform: uppercase;

        background: rgba(255, 255, 255, .98);
        border-top: 1px solid var(--border-light, #e8e3d8);
        border-bottom: 1px solid var(--border-light, #e8e3d8);
        box-shadow: 0 12px 30px rgba(0, 0, 0, .08);

        max-height: calc(100vh - 68px);
        overflow-y: auto;

        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px);
        pointer-events: none;

        transition:
            opacity .25s ease,
            transform .25s ease,
            visibility .25s ease;

        z-index: 105;
    }

    .nav-links.mobile-open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-links a {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 52px;
        padding: 14px 4px;

        color: var(--text-dark, #000);
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 1px;
        text-decoration: none;

        border-bottom: 1px solid var(--border-light, #e8e3d8);
    }

    .nav-links li:last-child a {
        border-bottom: 0;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: #bfa15f;
    }

    /* Remove desktop underline animation on mobile */
    .nav-links a::after {
        display: none !important;
    }

    /* Dim page behind opened menu */
    header::after {
        content: "";
        position: fixed;
        inset: 68px 0 0;
        background: rgba(0, 0, 0, .18);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .25s ease, visibility .25s ease;
        z-index: 90;
    }

    header.menu-open::after {
        opacity: 1;
        visibility: visible;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .nav-container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand-logo {
        font-size: 18px;
    }

    .nav-links {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mobile-menu-toggle span,
    .nav-links,
    header::after {
        transition: none;
    }
}
