/* ============================================
   OLEVS PERÚ - MENÚ MÓVIL ESTANDARIZADO
   Versión 2.0 - Funciona en todas las páginas
   ============================================ */

/* ===== VARIABLES ===== */
:root {
    --nav-bg: #0a0a0a;
    --nav-accent: #C5A572;
    --nav-accent-light: #D4B88A;
    --nav-text: rgba(255, 255, 255, 0.95);
    --nav-text-muted: rgba(255, 255, 255, 0.6);
}

/* ===== RESET PARA MENÚ ===== */
.nav,
.nav * {
    box-sizing: border-box;
}

/* ===== BURGER BUTTON ===== */
.burger {
    display: none;
    width: 44px;
    height: 44px;
    background: rgba(197, 165, 114, 0.1);
    border: 1px solid rgba(197, 165, 114, 0.25);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    z-index: 1100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.burger:hover {
    background: rgba(197, 165, 114, 0.2);
}

.burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #D4B88A;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mostrar burger solo en móvil */
@media (max-width: 768px) {
    .burger {
        display: flex !important;
    }
}

/* ===== NAV OVERLAY ===== */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== PANEL DE NAVEGACIÓN MÓVIL ===== */
@media (max-width: 768px) {
    .nav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 300px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: var(--nav-bg) !important;
        z-index: 1050 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin: 0 !important;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        visibility: hidden;
    }

    .nav.active {
        right: 0 !important;
        visibility: visible;
    }

    /* ===== HEADER DEL NAV ===== */
    .nav-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 25px 20px !important;
        /* Más padding vertical */
        min-height: 90px !important;
        /* Altura mínima más grande */
        border-bottom: 1px solid rgba(197, 165, 114, 0.15);
        background: rgba(197, 165, 114, 0.05);
        flex-shrink: 0;
        box-sizing: border-box;
    }

    .nav-logo {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        /* Más padding vertical */
        line-height: 1 !important;
        flex-shrink: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .nav-logo img {
        max-width: 140px !important;
        width: auto !important;
        height: auto !important;
        max-height: 55px !important;
        /* Más altura para el logo */
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    /* Botón X para cerrar */
    .nav-close {
        width: 40px;
        height: 40px;
        background: rgba(197, 165, 114, 0.1);
        border: 1px solid rgba(197, 165, 114, 0.2);
        border-radius: 10px;
        color: #D4B88A;
        font-size: 24px;
        font-weight: 300;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        line-height: 1;
    }

    .nav-close:hover {
        background: rgba(197, 165, 114, 0.2);
    }

    /* ===== LISTA DE NAVEGACIÓN ===== */
    .nav-list {
        list-style: none !important;
        padding: 16px 0 !important;
        margin: 0 !important;
        flex: 1;
    }

    .nav-list li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .nav-link {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 16px 24px !important;
        color: var(--nav-text) !important;
        text-decoration: none !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
        border-left: 3px solid transparent;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(197, 165, 114, 0.1);
        color: #D4B88A !important;
        border-left-color: #D4B88A;
    }

    .nav-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
    }

    .nav-text {
        font-size: 15px;
    }

    /* ===== SECCIÓN DE CONTACTO ===== */
    .nav-contact {
        display: block !important;
        padding: 20px 24px;
        border-top: 1px solid rgba(197, 165, 114, 0.15);
        background: rgba(0, 0, 0, 0.3);
    }

    .nav-contact-title {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: #D4B88A;
        margin-bottom: 14px;
        font-weight: 600;
    }

    .nav-contact-item {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--nav-text-muted);
        font-size: 13px;
        margin-bottom: 10px;
    }

    /* ===== REDES SOCIALES ===== */
    .nav-social {
        display: flex !important;
        gap: 10px;
        margin-top: 16px;
    }

    .nav-social a {
        width: 40px;
        height: 40px;
        background: rgba(197, 165, 114, 0.1);
        border: 1px solid rgba(197, 165, 114, 0.2);
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--nav-text);
        transition: all 0.3s ease;
    }

    .nav-social a:hover {
        background: rgba(197, 165, 114, 0.2);
    }

    .nav-social a svg {
        width: 16px;
        height: 16px;
    }

    /* ===== BOTÓN CTA WHATSAPP ===== */
    .nav-cta {
        display: block !important;
        padding: 16px 24px 24px;
    }

    .nav-cta-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px 20px;
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        color: #fff;
        text-decoration: none;
        font-size: 14px;
        font-weight: 700;
        border-radius: 12px;
        transition: all 0.3s ease;
    }

    .nav-cta-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    }

    .nav-cta-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== HEADER PRINCIPAL ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(197, 165, 114, 0.1);
}

.header.scrolled {
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header .container {
    padding: 0 16px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    max-width: 1400px;
    margin: 0 auto;
    gap: 16px;
}

/* ===== LAYOUT MÓVIL DEL HEADER ===== */
@media (max-width: 768px) {
    .header {
        height: 60px;
        /* Altura fija para evitar saltos */
        display: flex;
        align-items: center;
    }

    .header-content {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        /* Espacio fijo para burger y carrito */
        align-items: center;
        width: 100%;
        padding: 0;
        gap: 10px;
    }

    /* Burger a la izquierda */
    .burger {
        order: 1;
        grid-column: 1;
        position: relative !important;
        /* Asegurar que no sea fixed */
        left: 0 !important;
        margin: 0 !important;
        z-index: 1001;
        /* Mayor que el logo */
    }

    /* Logo centrado */
    .logo {
        order: 2;
        grid-column: 2;
        justify-self: center;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
    }

    .logo img {
        height: auto;
        max-height: 35px;
        /* Permitir más altura */
        width: auto;
        max-width: 140px;
        /* Permitir más ancho */
        object-fit: contain;
        display: block;
    }

    /* Carrito a la derecha */
    .header-actions {
        order: 3;
        grid-column: 3;
        justify-self: end;
        width: 44px;
        /* Coincidir con ancho de columna */
        justify-content: flex-end;
    }

    /* Ajustar icono de carrito en móvil */
    .cart-icon {
        width: 40px;
        height: 40px;
        background: transparent;
        /* Más limpio en móvil */
        border: none;
    }

    .cart-icon:hover {
        background: rgba(197, 165, 114, 0.1);
    }

    /* Overlay del menú */
    .nav-overlay {
        z-index: 1040;
    }

    /* Menú lateral */
    .nav {
        z-index: 1050;
        top: 0 !important;
        height: 100vh !important;
    }
}

/* ===== CARRITO ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-icon-container {
    position: relative;
}

.cart-icon {
    width: 42px;
    height: 42px;
    background: rgba(197, 165, 114, 0.1);
    border: 1px solid rgba(197, 165, 114, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4B88A;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    background: rgba(197, 165, 114, 0.2);
}

.cart-icon svg {
    width: 20px;
    height: 20px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

@media (max-width: 768px) {
    .cart-icon {
        width: 38px;
        height: 38px;
    }

    .cart-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== DESKTOP NAV ===== */
@media (min-width: 769px) {
    .nav {
        display: flex;
        align-items: center;
    }

    .nav-header,
    .nav-close,
    .nav-contact,
    .nav-cta,
    .nav-social,
    .nav-icon {
        display: none !important;
    }

    .nav-list {
        display: flex;
        align-items: center;
        gap: 4px;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .nav-link {
        padding: 10px 16px;
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        color: #D4B88A;
        background: rgba(197, 165, 114, 0.1);
    }

    .nav-text {
        font-size: 14px;
    }
}

/* ===== BLOQUEO DE SCROLL ===== */
body.nav-open {
    overflow: hidden !important;
}

/* ===== OCULTAR ELEMENTOS EN MÓVIL ===== */
@media (max-width: 768px) {

    /* Ocultar botones de login y otros en header */
    .header-actions .btn,
    .header-actions button.btn,
    .header-actions [class*="btn-primary"],
    #authContainer .btn,
    .login-nav-btn,
    #openLogin {
        display: none !important;
    }
}