/*
==========================================================================
NAVIGATION.CSS — Nav Bar, Dropdowns, Hamburger
Mobile-first. Sticky. Dark background.
Hamburger on mobile and tablet up to 50rem (800px).
Full horizontal nav at 50rem+.
No non-color variables — all values hardcoded directly.
==========================================================================
*/


/* ==========================================================================
   NAV WRAPPER
   ========================================================================== */

.nav {
    position: sticky;
    top: 0;
    z-index: 300;
    width: 100%;
    background-color: var(--color-nav-bg);
    border-bottom: 0.0625rem solid var(--color-border-dark);
}

.nav-container {
    width: 100%;
    max-width: 90rem;
    margin-inline: auto;
    padding: 0 clamp(1rem, 2vw, 3rem);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}


/* ==========================================================================
   NAV LOGO
   ========================================================================== */

.nav-logo {
    font-family: 'Cooper Black', serif;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--color-beige);
    text-decoration: none;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 250ms ease;
}

.nav-logo:hover {
    color: var(--color-light-green);
    text-decoration: none;
}


/* ==========================================================================
   NAV LINKS — Mobile: slides down from nav bar, auto height, sits over content
   ========================================================================== */

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--color-nav-bg);
    border-bottom: 0.0625rem solid var(--color-border-dark);
    box-shadow: 0 0.625rem 0.9375rem rgba(0, 0, 0, 0.10),
                0 0.25rem 0.375rem rgba(0, 0, 0, 0.07);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.35s ease,
                opacity 250ms ease;
    z-index: 300;
    display: flex;
    flex-direction: column;
}

.nav-links.is-open {
    max-height: 100vh;
    opacity: 1;
    pointer-events: all;
}


/* ==========================================================================
   NAV ITEMS
   ========================================================================== */

.nav-item {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}


/* ==========================================================================
   NAV DROPDOWN TRIGGER — Mobile
   Arrow on left, label text after it
   ========================================================================== */

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem clamp(1rem, 4vw, 4rem);
    color: var(--color-nav-text);
    font-family: 'Cooper Black', serif;
    font-size: 0.875rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
    background: none;
    border: none;
    border-bottom: 0.0625rem solid var(--color-border-dark);
    cursor: pointer;
    text-align: left;
    min-height: 2.75rem;
    transition: color 150ms ease,
                background-color 150ms ease;
    line-height: 1.2;
}

.nav-dropdown-trigger:hover,
.nav-item--dropdown.is-open > .nav-dropdown-trigger {
    color: var(--color-nav-hover);
    background-color: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

/* Arrow — left side, rotates when open */
.nav-dropdown-trigger::before {
    content: '▸';
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: transform 250ms ease;
    color: var(--color-hillside-green);
}

.nav-item--dropdown.is-open > .nav-dropdown-trigger::before {
    transform: rotate(90deg);
}


/* ==========================================================================
   DROPDOWN MENUS — Mobile: accordion
   ========================================================================== */

.nav-dropdown {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.25);
    max-height: 0;
    overflow: hidden;
    transition: max-height 250ms ease;
}

.nav-item--dropdown.is-open > .nav-dropdown {
    max-height: 20rem;
}

.nav-dropdown li {
    margin-bottom: 0;
}

.nav-dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 3rem;
    color: #D8E6C8;
    text-decoration: none;
    font-family: 'Cooper Black', serif;
    font-size: 0.75rem;
    letter-spacing: 0;
    min-height: 2rem;
    transition: color 150ms ease,
                background-color 150ms ease;
}

.nav-dropdown-link:hover {
    color: var(--color-beige);
    background-color: rgba(255, 255, 255, 0.05);
    text-decoration: none;
}


/* ==========================================================================
   NAV ACTIONS — Cart icon, hamburger
   ========================================================================== */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    color: var(--color-nav-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: color 150ms ease,
                background-color 150ms ease;
}

.nav-action-btn:hover {
    color: var(--color-nav-hover);
    background-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.nav-action-btn svg {
    width: 1.375rem;
    height: 1.375rem;
}

.nav-cart-count {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: var(--color-burnt-orange);
    color: var(--color-beige);
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    min-width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
}


/* ==========================================================================
   HAMBURGER BUTTON
   ========================================================================== */

.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3125rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 0.5rem;
    transition: background-color 150ms ease;
}

.nav-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-hamburger-bar {
    display: block;
    width: 100%;
    height: 0.125rem;
    background-color: var(--color-beige);
    border-radius: 9999px;
    transition: transform 250ms ease,
                opacity 250ms ease;
    transform-origin: center;
}

.nav-hamburger.is-active .nav-hamburger-bar:nth-child(1) {
    transform: translateY(0.4375rem) rotate(45deg);
}

.nav-hamburger.is-active .nav-hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.is-active .nav-hamburger-bar:nth-child(3) {
    transform: translateY(-0.4375rem) rotate(-45deg);
}


/* ==========================================================================
   DESKTOP NAV — 50rem (800px) and up
   Full horizontal nav, hamburger hidden
   ========================================================================== */

@media (min-width: 50rem) {

    .nav-hamburger {
        display: none;
    }

    /* Grid: logo col1 | 1fr gap col2 | nav-right col3 */
    .nav-container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: stretch;
        gap: 0;
    }

    /* nav-right must explicitly occupy column 3 */
    .nav-right {
        grid-column: 3;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
        height: 100%;
    }

    .nav-links {
        position: static;
        flex-direction: row;
        align-items: flex-start;
        background-color: transparent;
        overflow: visible;
        max-height: none;
        opacity: 1;
        pointer-events: all;
        height: var(--nav-height);
        gap: 0;
        flex: 0 1 auto;
        justify-content: flex-end;
        border-bottom: none;
        box-shadow: none;
        padding: 0;
    }

    .nav-item {
        position: relative;
        width: auto;
        height: 100%;
        display: flex;
        align-items: flex-start;
        align-self: flex-start;
        margin-bottom: 0;
    }

    .nav-dropdown-trigger {
        width: auto;
        height: var(--nav-height);
        padding-top: 1rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        padding-bottom: 0;
        justify-content: flex-start;
        align-items: flex-start;
        align-self: flex-start;
        border-bottom: 0.1875rem solid transparent;
        font-size: 0.75rem;
        text-align: center;
        flex-direction: column;
        gap: 0;
    }

    /* Remove left arrow on desktop */
    .nav-dropdown-trigger::before {
        display: none;
    }

    .nav-dropdown-trigger:hover,
    .nav-item--dropdown.is-open > .nav-dropdown-trigger,
    .nav-item--dropdown:hover > .nav-dropdown-trigger {
        border-bottom-color: var(--color-light-green);
        background-color: transparent;
    }

    .nav-logo {
        align-self: center;
    }

    /* Cart flush right of nav-links, icon top-aligned with nav text */
    .nav-actions {
        display: flex;
        align-items: flex-start;
        gap: 0;
        flex-shrink: 0;
        padding-top: 1rem;
        padding-left: 0.5rem;
    }

    /* Desktop dropdown panel */
    .nav-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 12rem;
        background-color: var(--color-dark-section);
        border: 0.0625rem solid var(--color-border-dark);
        border-top: none;
        border-radius: 0 0 0.5rem 0.5rem;
        box-shadow: 0 0.625rem 0.9375rem rgba(0, 0, 0, 0.10),
                    0 0.25rem 0.375rem rgba(0, 0, 0, 0.07);
        max-height: 0;
        overflow: hidden;
        z-index: 100;
        transition: max-height 250ms ease;
    }

    .nav-item--dropdown:hover > .nav-dropdown,
    .nav-item--dropdown.is-open > .nav-dropdown {
        max-height: 20rem;
    }

    .nav-dropdown-link {
        padding: 0.75rem 1.5rem;
        white-space: nowrap;
        font-size: 0.75rem;
        min-height: 2.25rem;
    }
}

@media (min-width: 64rem) {

    .nav-dropdown-trigger {
        /* Explicit per-side — never shorthand here, preserves padding-top */
        padding-top: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        font-size: 0.875rem;
    }

    .nav-dropdown-link {
        font-size: 0.875rem;
    }
}