/* ===========================
   MENÚ MÓVIL - PANEL LATERAL
   =========================== */

:root {
    --mobile-menu-width: 280px;
    --mobile-menu-bg: #ffffff;
    --mobile-menu-text: #2d3748;
    --mobile-menu-accent: #7fb069;
    --mobile-menu-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Overlay de fondo */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Panel lateral */
.mobile-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--mobile-menu-width);
    height: 100%;
    background: var(--mobile-menu-bg);
    box-shadow: var(--mobile-menu-shadow);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.mobile-menu-panel.active {
    transform: translateX(0);
}

/* Header del panel */
.mobile-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--mobile-menu-text);
    cursor: pointer;
    transition: color 0.2s;
}

.mobile-menu-close:hover {
    color: var(--mobile-menu-accent);
}

/* Navegación */
.mobile-nav-links {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-nav-links li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--mobile-menu-text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    background: #f7fafc;
    color: var(--mobile-menu-accent);
}

/* Sección usuario */
.mobile-user-section {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f9f9f9;
}

.mobile-user-info {
    margin-bottom: 1rem;
}

.mobile-user-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.25rem;
}

.mobile-vip-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.mobile-user-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-user-buttons button {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-btn-primary {
    background: var(--accent-green);
    color: white;
}

.mobile-btn-primary:hover {
    background: var(--light-green);
}

.mobile-btn-secondary {
    background: #e2e8f0;
    color: var(--dark-text);
}

.mobile-btn-secondary:hover {
    background: #cbd5e0;
}

.mobile-btn-danger {
    background: #fc8181;
    color: white;
}

.mobile-btn-danger:hover {
    background: #f56565;
}

/* Botón hamburguesa – SIEMPRE VISIBLE y anclado */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-text);
    cursor: pointer;
    transition: color 0.2s;
    /* NUEVO – fijo en su sitio */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

.mobile-menu-btn:hover {
    color: var(--accent-green);
}

/* Mostrar botón y ocultar navegación en móvil + evitar desborde */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .header-actions {
        gap: 1rem;
    }

    /* Evita que el header crezca y produzca scroll horizontal */
    body {
        overflow-x: hidden;
    }

    /* Deja hueco al botón para que no tape el logo */
    .header .container {
        position: relative;
        padding-right: 3.5rem;
    }
}




/* ==========  FIX MÓVILES REALES  ========== */
html, body {
    width: 100vw;
    overflow-x: hidden;
}

/* Header nunca mayor que viewport */
.header {
    max-width: 100vw;
}

/* Botón SIEMPRE visible y anclado */
@media (max-width: 768px) {
    .header .container {
        position: relative;
        padding-right: 3.5rem; /* hueco seguro */
    }
    .mobile-menu-btn {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }
}



/* Evita que la última sección quede bajo la UI del sistema 
.mobile-user-section {
    padding: 1rem 1rem 2rem;
}
*/

/*Scroll interno si el contenido es muy alto*/ 
/*.mobile-menu-panel {
    padding-bottom: env(safe-area-inset-bottom);*/ /* iPhone X+ */
/*    overflow-y: auto; 
}*/



@media (max-width: 768px) {
    .mobile-menu-panel {
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        /* el resto de tus reglas ya existentes */
    }
}

