/* 🛠️ RESETEO DE CONTROL DE CAJAS GLOBAL */
*, *::before, *::after {
    box-sizing: border-box;
}
/* --- SISTEMA DE DISEÑO CORPORATIVO (Paleta Slate & Indigo Premium) --- */
:root {
    --color-fondo: #f0edff;        
    --color-superficie: #ffffff;   
    --color-texto-prm: #0f172a;    
    --color-texto-sec: #475569;    
    --color-primario: #1e40af;     
    --color-primario-hover: #1d4ed8;
    --color-enfoque: #f59e0b;      
    --color-borde: #cbd5e1;        
    --color-error: #b91c1c;        
    --color-exito: #15803d;        
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto-prm);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- 🥇 BARRA DE NAVEGACIÓN SUPERIOR CONTROLADA --- */
.header-principal {
    background-color: #000000 !important;     
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 999999 !important; /* Prioridad absoluta frente a cualquier componente */
}

/* Asegurar que ningún contenedor intermedio recorte el dropdown */
.header-principal, 
.nav-contenedor,
.header-principal * {
    overflow: visible !important; 
}

.nav-contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;                
    text-decoration: none;
    letter-spacing: -0.5px;
}

.brand-logo span {
    color: #a78bfa;                
}

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

nav a, .btn-dropdown-trigger {
    min-height: 44px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    color: #cbd5e1;                
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: none;
    border: none;
    cursor: pointer;
}

nav a:hover, .btn-dropdown-trigger:hover {
    color: #ffffff;                
    background-color: #1e293b;     
}

nav a.nav-carrito {
    background-color: #064e3b;     
    color: #a7f3d0;                
    border: 1px solid #047857;
}

nav a.nav-carrito:hover {
    background-color: #059669;
    color: #ffffff;
    border-color: #059669;
}

/* --- 🛠️ DROPDOWN MENÚ DE ADMINISTRACIÓN --- */
.menu-admin-root {
    position: relative;
}

.dropdown-admin-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1e293b;    
    min-width: 240px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid #334155;
    padding: 6px 0;
    margin: 4px 0 0 0;
    list-style: none;
    flex-direction: column;
    z-index: 999999 !important; 
}

.dropdown-admin-content li {
    width: 100%;
}

.dropdown-admin-content a {
    color: #cbd5e1;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0;
    min-height: 40px;
    font-size: 0.9rem;
}

.dropdown-admin-content a:hover {
    background-color: #334155;
    color: #ffffff;
}

.menu-admin-root:hover .dropdown-admin-content,
.menu-admin-root:focus-within .dropdown-admin-content {
    display: flex;
}

/* --- 🎴 BANNERS DE TÍTULOS DE PÁGINAS --- */
.hero-banner {
    background-color: #000000 !important;
    color: #ffffff !important;
    padding: 40px 30px;
    border-radius: 14px;
    text-align: center;
    margin-bottom: 50px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10; /* Prioridad baja controlada */
}

.hero-banner h1 {
    color: #ffffff !important;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.hero-banner p {
    color: #cbd5e1 !important; 
    margin-top: 15px;
    font-size: 1.1rem;
}

.hero-banner span {
    color: #94a3b8 !important;
}

/* --- ACCESIBILIDAD Y ENFOQUE --- */
.enlace-salto {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--color-texto-prm);
    color: var(--color-fondo);
    padding: 12px 24px;
    z-index: 1000;
    text-decoration: none;
    border-radius: 0 0 6px 6px;
    font-weight: bold;
    transition: top 0.2s ease;
}

.enlace-salto:focus {
    top: 0;
    outline: 4px solid var(--color-enfoque) !important;
}

a:focus, button:focus, input:focus, textarea:focus, select:focus, li.menu-admin-root:focus-within > a {
    outline: 4px solid var(--color-enfoque) !important;
    outline-offset: 2px !important;
}

/* --- CONTENEDOR PRINCIPAL SEMÁNTICO --- */
main {
    max-width: 1200px; 
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    flex-grow: 1; 
}

/* --- COMPONENTES GLOBALES FORMULARIOS --- */
.contenedor-formulario {
    background-color: var(--color-superficie);
    border: 1px solid var(--color-borde);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 0 auto;
}

.campo-formulario, .campo-archivo {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    margin-top: 8px;
    margin-bottom: 24px;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1rem;
    background-color: #f8fafc;
    transition: all 0.2s ease;
}

.btn-accion {
    min-height: 44px;
    padding: 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primario);
    color: white !important;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    box-sizing: border-box;
}

.btn-accion:hover {
    background-color: var(--color-primario-hover);
}

/* --- PIE DE PÁGINA --- */
footer {
    background-color: var(--color-superficie);
    border-top: 1px solid var(--color-borde);
    padding: 30px 20px;
    text-align: center;
    margin-top: auto;
}

footer p {
    margin: 0;
    color: var(--color-texto-sec);
    font-size: 0.9rem;
}

/* --- WIDGETS FLOTANTES INTERACTIVOS --- */
.btn-whatsapp-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 58px;
    height: 58px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 500000;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.btn-whatsapp-flotante:hover {
    transform: scale(1.05);
    background-color: #128C7E;
}

/* ==========================================================================
   🚀 SECCIÓN DE MEDIA QUERIES AL FINAL ABSOLUTO (Garantiza prioridad de cascada)
   ========================================================================== */

@media only screen and (max-width: 768px) {
    .btn-whatsapp-flotante {
        width: 42px;
        height: 42px;
        bottom: 30px;
        right: 30px;
    }
    .btn-whatsapp-flotante svg {
        width: 22px !important;
        height: 22px !important;
    }
}

@media only screen and (max-width: 1024px) {
    /* Desbloqueamos el alto fijo de escritorio para que Firefox estire la barra */
    .header-principal {
        height: auto !important;
        position: sticky !important;
    }

    .nav-contenedor {
        flex-direction: column !important;
        height: auto !important;
        padding: 15px 10px !important;
        gap: 12px !important;
    }

    /* Convertimos la botonera en pastillas adaptables envolventes */
    nav ul {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
    }

    nav ul li {
        display: inline-block !important;
    }

    nav a, .btn-dropdown-trigger {
        padding: 8px 14px !important;
        font-size: 0.85rem !important;
        min-height: 40px !important;
        background-color: #1e293b !important; 
        border: 1px solid #334155 !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    nav a:hover, .btn-dropdown-trigger:hover {
        background-color: #334155 !important;
        color: #ffffff !important;
    }

    nav a.nav-carrito {
        background-color: #064e3b !important;
        border-color: #047857 !important;
    }

    nav ul li[style*="color: #94a3b8"] {
        width: 100% !important;
        text-align: center !important;
        margin: 6px 0 !important;
    }

    .dropdown-admin-content {
        position: static !important;
        width: 100% !important;
        box-shadow: none !important;
        margin-top: 6px !important;
        background-color: #0f172a !important;
    }
}