/**
 * MPUREVOLT — Shared Mobile Navigation Styles
 * 
 * Provides consistent mobile navigation drawer across all pages.
 * Desktop navbar remains unchanged.
 */

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
}

/* Baseline heading font — all headings use the brand heading font */
h1, h2, h3 {
    font-family: var(--heading-font);
}

/* =========================================================
   NAVBAR — consistent across every storefront page
   (mirrors index.html: 13px link text, scaling down on small
   viewports so the desktop and mobile navbar fonts match.)
   ========================================================= */
.nav-links a {
    position: relative;
    color: #34352f;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -7px;
    width: 0;
    height: 2px;
    background: var(--green);
    transition: width 0.25s ease;
}

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

@media (max-width: 1100px) {
    .nav-links a { font-size: 11px; }
}

@media (max-width: 900px) {
    .nav-links a { font-size: 10px; }
}

@media (max-width: 700px) {
    .nav-links a { font-size: 8px; }
}


/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--black);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--black);
    stroke-width: 1.8;
    stroke-linecap: round;
}

/* Backdrop */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 17, 15, 0.6);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* Drawer */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--dark);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-drawer.open {
    transform: translateX(0);
}

/* Drawer header */
.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.nav-drawer-brand {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-drawer-brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    color: white;
    border-radius: 7px;
    font-family: var(--heading-font);
    font-size: 13px;
    font-weight: 800;
}

.nav-drawer-brand-mark img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    display: block;
}

.nav-drawer-brand-text {
    font-family: var(--heading-font);
    font-size: 14px;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.03em;
}

.nav-drawer-brand-text span {
    display: block;
    margin-top: 5px;
    color: var(--gray);
    font-family: var(--body-font);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.nav-drawer-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.nav-drawer-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Drawer content */
.nav-drawer-content {
    flex: 1;
    padding: 24px 0;
}

/* Drawer links */
.nav-drawer-links {
    padding: 0 24px;
}

.nav-drawer-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--heading-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
}

.nav-drawer-link:last-child {
    border-bottom: none;
}

.nav-drawer-link:hover,
.nav-drawer-link.active {
    color: var(--white);
}

.nav-drawer-link.active {
    color: var(--green);
}

/* Divider */
.nav-drawer-divider {
    height: 1px;
    margin: 16px 24px;
    background: rgba(255, 255, 255, 0.08);
}

/* Drawer actions */
.nav-drawer-actions {
    padding: 0 24px;
}

.nav-drawer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 12px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-drawer-action:hover {
    color: var(--white);
}

.nav-drawer-cart-badge {
    display: none;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    align-items: center;
    justify-content: center;
    background: var(--green);
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.nav-drawer-cart-badge.visible {
    display: inline-flex;
}

/* Responsive - show mobile button and hide nav links */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav-links {
        display: none !important;
    }

    .navbar {
        padding: 0 16px;
    }

    .nav-button {
        width: 36px;
        height: 36px;
    }

    .nav-actions {
        gap: 6px;
    }
}

@media (max-width: 420px) {
    .navbar {
        padding: 0 12px;
    }

    .brand-text span {
        font-size: 7px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .nav-button {
        width: 34px;
        height: 34px;
    }

    .nav-actions {
        gap: 5px;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .nav-drawer {
        transition: none;
    }

    .nav-backdrop {
        transition: none;
    }
}


/* Shared user-page branding: show the complete original Mpurevolt logo. */
.navbar .brand-mark,
.footer-brand .brand-mark {
    width: 76px !important;
    height: 60px !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible;
}

.navbar .brand-mark img,
.footer-brand .brand-mark img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.nav-drawer-brand {
    gap: 2px;
}

.nav-drawer-brand-mark {
    width: 76px;
    height: 60px;
    background: transparent;
    border-radius: 0;
}

@media (max-width: 420px) {
    .navbar .brand-mark,
    .footer-brand .brand-mark,
    .nav-drawer-brand-mark {
        width: 70px !important;
        height: 56px !important;
    }
}
