/* ============================================================
   TOP END LIQUOR — Layout: Header, Footer, Navigation
   ============================================================ */

/* ---- Header / Navbar ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-light);
    padding: 0 var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    height: 68px;
}

/* Logo */
.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-image {
    height: 52px;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.logo-container:hover .logo-image {
    transform: scale(1.03);
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    padding: 6px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-green);
    transition: width var(--transition-base);
    border-radius: 1px;
}

/* Dark green, not #79C142 — the brand green on the near-white header is
   2.21:1, so the *current page* in the nav was the hardest item to read. */
.nav-link:hover,
.nav-link.active {
    color: var(--dark-green);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Header Actions (cart, auth) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.cart-trigger {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main);
    /* Was padding: 6px — a 31px tap target for the single most-used control
       in the header. 44px is the minimum a thumb can hit reliably. */
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.cart-trigger:hover {
    color: var(--dark-green);
    background: var(--dark-green-light);
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--primary-green);
    /* White on #79C142 is 2.21:1 and this badge is 0.65rem — the count was
       effectively unreadable. Dark ink on the same green is 6.99:1. */
    color: var(--on-primary);
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg-secondary);
}

/* Hamburger / Mobile Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    /* Was padding: 8px on a 1.35rem glyph — roughly 37px. */
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.35rem;
}

.mobile-toggle:hover {
    background: var(--dark-green-light);
    color: var(--dark-green);
}

/* Mobile Drawer */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-secondary);
    z-index: 201;
    transition: right var(--transition-base);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    /* Was padding: 4px — a 26px target on the touch-only surface. */
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: -0.5rem;
}

.drawer-close:hover {
    color: var(--text-main);
    background: var(--bg-tertiary);
}

.drawer-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.drawer-nav {
    padding: var(--space-md) 0;
    flex: 1;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    /* 0.85rem vertical gave a 46px row; kept, but stated explicitly so a
       future font-size change cannot quietly drop it under 44. */
    padding: 0.85rem var(--space-xl);
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

/* #79C142 on #e8f5e0 is 1.95:1 — the selected drawer item was the least
   readable item in the list. Dark green on the same tint is 4.63:1. */
.drawer-link:hover,
.drawer-link.active {
    color: var(--dark-green);
    background-color: var(--dark-green-light);
}

.drawer-link.active {
    box-shadow: inset 3px 0 0 var(--primary-green);
}

.drawer-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.drawer-footer {
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border-light);
}

/* ---- Main Content ---- */
.site-main {
    flex: 1;
    width: 100%;
}

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl);
}

/* ---- Alert Banners ---- */
.alert-container {
    padding: var(--space-md) var(--space-xl) 0;
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
}

.alert {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Aligned to the same tone ramp the .notice component already uses, so a
   flash message and an inline notice cannot disagree about what "success"
   looks like. The old success text (#438a16 on #e8f5e0) measured 3.80:1;
   the tone pair measures 6.29:1. */
.alert-success {
    background-color: var(--tone-success-bg);
    border: 1px solid var(--tone-success-br);
    color: var(--tone-success-fg);
}

.alert-error {
    background-color: var(--tone-danger-bg);
    border: 1px solid var(--tone-danger-br);
    color: var(--tone-danger-fg);
}

.alert i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* A validation summary lists several messages; they need to stack, which was
   being done with a style attribute in the layout. */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* ---- Footer ---- */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-3xl) var(--space-xl) var(--space-xl);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-logo {
    height: 60px;
    object-fit: contain;
    margin-bottom: var(--space-lg);
}

.footer-description {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.footer-sec-title {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.footer-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-list a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: all var(--transition-fast);
}

.footer-list a:hover {
    color: var(--dark-green);
    padding-left: 3px;
}

/* The store-hours column is a definition list of facts, not a link list;
   it was carrying its type scale in a style attribute on the <ul>. */
.footer-list.footer-facts {
    font-size: 0.85rem;
    gap: 0.5rem;
}

.footer-list .footer-api-link {
    display: inline-flex;
    margin-top: 0.6rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-xl);
    text-align: center;
    font-size: 0.85rem;
}

.footer-compliance {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    color: var(--text-light);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .header-inner {
        height: 60px;
    }

    .logo-image {
        height: 44px;
    }

    .site-main .main-content {
        padding: var(--space-lg);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .site-footer {
        padding: var(--space-2xl) var(--space-lg) var(--space-lg);
    }
}

@media (max-width: 480px) {
    .site-main .main-content {
        padding: var(--space-md);
    }
}
