/* CSS Variables for raw usage if needed */
:root {
--color-primary: #102a43;
--color-accent: #d97706;
--wa-color: #25D366;
}

/* Base styles */
body {
font-family: 'Inter', sans-serif;
background-color: #f8fafc;
color: #334e68;
overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
font-family: 'Montserrat', sans-serif;
}

/* Smooth Scroll Reveal Animations */
.reveal {
opacity: 0;
transform: translateY(30px);
transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
opacity: 1;
transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }

/* Custom Gradients */
.text-gradient {
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-image: linear-gradient(90deg, #102a43, #334e68);
}

.bg-gradient-hero {
background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

/* Glassmorphism Navigation */
.glass-nav {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* --- BOTÓN FLOTANTE WHATSAPP --- */
.wa-widget {
    position: fixed;
    /* Elevamos el botón a 105px para que quede justo arriba del sol/luna */
    bottom: 105px; 
    /* Lo movemos a la derecha */
    right: 30px;
    left: auto; /* Anulamos la posición izquierda que tenía antes */
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.wa-button {
    width: 55px; /* Reducido a 55px para igualar al modo oscuro */
    height: 55px; /* Reducido a 55px */
    background-color: var(--wa-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 30px; /* Icono ligeramente más pequeño */
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wa-widget:hover .wa-button {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.wa-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444; /* Rojo para notificaciones */
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #fff;
    animation: pulse-badge 2s infinite;
}

.wa-tooltip {
    background-color: white;
    color: #102a43;
    padding: 12px 20px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    opacity: 0;
    /* Ahora la animación empieza desde la derecha ocultándose ligeramente */
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform-origin: right center;
}

/* Triangulito del Tooltip apuntando hacia la derecha */
.wa-tooltip::after {
    content: '';
    position: absolute;
    left: 100%; /* Colocamos la flecha en el lado derecho del texto */
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px;
    border-style: solid;
    /* Colores del borde para formar la flecha apuntando a la derecha */
    border-color: transparent transparent transparent white;
}

.wa-widget:hover .wa-tooltip {
    opacity: 1;
    transform: translateX(0); /* Vuelve a su posición original al hacer hover */
}

/* Keyframes y animaciones globales */
@keyframes pulse-badge {
0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes float {
0% { transform: translateY(0px); }
50% { transform: translateY(-15px); }
100% { transform: translateY(0px); }
}

.animate-float {
animation: float 6s ease-in-out infinite;
}

/* --- ESTILOS DEL BOTÓN FLOTANTE --- */
.theme-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #2563eb; /* Azul corporativo */
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: background-color 0.3s, transform 0.2s;
}

.theme-toggle-btn:hover {
    background-color: #1d4ed8;
    transform: scale(1.1);
}

/* --- TRANSICIÓN SUAVE PARA TODA LA PÁGINA --- */
body, section, div, h1, h2, h3, p, label, input, select {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* --- REGLAS DEL MODO OSCURO (ESTILO CORPORATIVO ELEGANTE) --- */

/* 1. El Fondo Principal (Gris Pizarra Profundo) */
body.dark-theme,
body.dark-theme section.bg-gray-50,
body.dark-theme section.bg-brand-50,
body.dark-theme section.bg-white,
body.dark-theme section#inicio,
body.dark-theme .bg-gradient-hero {
background-color: #0f172a !important;
background-image: none !important; / ¡CLAVE! Borra el degradado claro original */
color: #e2e8f0 !important;
}

/* 2. EL HERO: Forzar los títulos principales a blanco brillante */
body.dark-theme .font-heading.text-brand-900,
body.dark-theme h1.text-brand-900,
body.dark-theme h2.text-brand-900,
body.dark-theme h3.text-brand-900,
body.dark-theme h4.text-brand-900 {
color: #ffffff !important;
}

/* Forzar la letra "y" o cualquier texto general dentro del Hero a blanco */
body.dark-theme section#inicio {
    color: #758dac !important; /* Asegura que el texto suelto herede un color claro */
}

/* 3. Textos Secundarios y Párrafos (Incluyendo el texto debajo del título Hero) */
body.dark-theme p, 
body.dark-theme p.text-brand-600,
body.dark-theme p.text-brand-500,
body.dark-theme label {
    color: #bacbdb !important; /* Gris claro muy legible */
}

/* 4. Estilos para las Bento Boxes / Tarjetas */
body.dark-theme .bg-white,
body.dark-theme form.bg-white {
    background-color: #1e293b !important; /* Gris un tono más claro que el fondo */
    border-color: #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

/* 5. ARREGLO DE ICONOS en las Bento Boxes */
/* Seleccionamos las cajitas que envuelven los iconos */
body.dark-theme .bg-brand-50.flex.items-center,
body.dark-theme .w-16.h-16.bg-brand-50 {
    background-color: #4b5e77 !important; /* Fondo del icono un poco más oscuro */
}

/* Forzar que los iconos (FontAwesome) sean blancos en lugar de azules */
body.dark-theme .bg-brand-50 i.text-brand-900,
body.dark-theme .w-16.h-16 i.text-brand-900 {
    color: #648aaf !important; 
}

/* 6. Mantener el color naranja (acento) intacto en Modo Oscuro */
body.dark-theme .text-accent {
    color: #d97706 !important; 
}

/* 7. Inputs de los Formularios */
body.dark-theme input, 
body.dark-theme select,
body.dark-theme textarea {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid #475569 !important;
}

body.dark-theme input:focus, 
body.dark-theme select:focus,
body.dark-theme textarea:focus {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 1px #d97706 !important;
    background-color: #1e293b !important;
}

/* 8. Arreglo para el Navbar flotante */
body.dark-theme .glass-nav {
    background: rgba(15, 23, 42, 0.85) !important; /* Transparencia oscura */
    border-bottom-color: rgba(255,255,255,0.1) !important;
}

body.dark-theme .glass-nav a.text-brand-700 {
    color: #e2e8f0 !important; /* Enlaces del menú en blanco/gris */
}

/* --- BOTÓN FLOTANTE DEL MODO OSCURO --- */
.theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px; /* A la derecha para no chocar con WhatsApp */
    z-index: 99999;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #102a43; /* Azul oscuro marca RIMO */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    background-color: #243b53;
}

/* Solución para que el clic funcione siempre (Edge/Safari) */
.theme-toggle-btn svg {
    pointer-events: none !important;
}

/* Adaptación del botón cuando el Modo Oscuro ESTÁ ACTIVO */
body.dark-theme .theme-toggle-btn {
    background-color: #1e293b !important; /* Forzamos el gris oscuro */
    color: #d97706 !important; /* Forzamos el naranja */
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3) !important;
}

body.dark-theme .theme-toggle-btn:hover {
    background-color: #334155 !important;
}