/* styles.css */
:root {

    /* Agrega esto al inicio de styles.css */
@font-face {
    font-family: 'Baloo';
    src: url('./fonts/Baloo-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Quicksand';
    src: url('fonts/Quicksand-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Quicksand';
    src: url('fonts/Quicksand-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
        /* NUEVA PALETA DE COLORES */
    --primary: #4E2b75;          /* Violeta principal */
    --primary-light: #A59BCD;    /* Violeta suave */
    --primary-dark: #3A1F5A;     /* Violeta oscuro */
    --secondary: #3C8E5f;        /* Verde principal */
    --secondary-light: #82C89B;  /* Verde suave */
    --secondary-dark: #2D6B48;   /* Verde oscuro */
    --accent: #FF6B6B;           /* Color de acento (rojo coral para contraste) */
    --accent-light: #FF8E8E;     /* Acento claro */
    --accent-dark: #E05252;      /* Acento oscuro */
    
    --text-dark: #2c3e50;
    --text-medium: #546e7a;
    --text-light: #78909c;
    --white: #ffffff;
    --light-bg: #f8fafc;
    --light-gray: #eef2f7;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 15px 40px rgba(0, 0, 0, 0.18);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.2s ease;
    
    --error: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* A continuación, necesito actualizar algunos gradientes específicos para que usen los nuevos colores */

/* Gradientes que usan los colores primarios y secundarios */
.nav-links a:after {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.section-title:after {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.section-title.light:after {
    background: linear-gradient(90deg, var(--white), rgba(255,255,255,0.7));
}

.card:before {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
}

/* Actualizar gradientes en secciones */
.section-pattern {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
}

/* Gradiente para el logo */
.logo-name {
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Gradiente para stats en sección pattern */
.section-pattern .stat-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
}

/* Gradiente en footer h3 */
.footer-section h3:after {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Gradiente en botones del chat */
.chat-toggle,
.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.chat-toggle.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
}

/* Botón WhatsApp */
.whatsapp-float {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

/* Efecto parallax para el slider */
.hero-slider::before {
    background: linear-gradient(
        45deg,
        rgba(78, 43, 117, 0.1) 0%,    /* #4E2b75 con opacidad */
        rgba(60, 142, 95, 0.1) 100%   /* #3C8E5f con opacidad */
    );
}

/* Actualizar algunos efectos hover específicos */
.stat-item:hover::before {
    background: linear-gradient(135deg, rgba(78, 43, 117, 0.1), rgba(60, 142, 95, 0.1));
}

/* Ajustes para elementos que usan los colores primarios */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

/* Para botones outline que usan primary */
.btn-outline {
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
}

/* Para el número en stats */
.stat-number {
    color: var(--primary);
}

/* Para iconos en contact-item */
.contact-item i {
    color: var(--primary);
}

/* Para botón trabajar con nosotros */
.work-with-us-btn {
    background: var(--secondary);
}

.work-with-us-btn:hover {
    background: var(--secondary-dark);
}

/* Para iconos en footer-contact */
.footer-contact i {
    color: var(--primary-light);
}

/* Para mensajes de user en chat */
.user-message {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* Ajuste específico para shadow de botón primary */
.btn-primary {
    box-shadow: 0 6px 20px rgba(255, 123, 84, 0.4); /* Mantiene el color original del acento */
}

/* Ajuste para stat-item hover */
.stat-item:hover {
    box-shadow: 0 15px 40px rgba(78, 43, 117, 0.25);
    border-color: rgba(78, 43, 117, 0.3);
}

/* Ajuste para logo-container hover */
.logo-container:hover .logo-icon-wrapper {
    box-shadow: 0 6px 18px rgba(78, 43, 117, 0.35);
}

/* Ajuste para las sombras de las cards con nuevos colores */
.card:hover {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(78, 43, 117, 0.1);
}

/* Ajuste para el botón de chat pulse */
.chat-toggle.pulse {
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(78, 43, 117, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(78, 43, 117, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(78, 43, 117, 0);
    }
}

/* Ajuste para el botón de WhatsApp pulse */
@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 35px rgba(37, 211, 102, 0.8), 0 0 15px rgba(37, 211, 102, 0.6);
        transform: translateY(-5px);
    }
}

/* Ajuste para elementos con hover usando primary-light */
.quick-reply:hover {
    background: var(--primary-light);
    color: white;
}

/* Ajuste para el slider prev/next hover */
.slider-prev:hover,
.slider-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Si quieres mantener el color del acento para algunos elementos,
   puedes dejar los valores originales o ajustarlos a la nueva paleta */

/* Aquí continúa el resto de tu CSS existente sin cambios... */

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    color: var(--text-dark);
    overflow-x: hidden;
    background-color: var(--light-bg);
font-family: 'Quicksand', 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    font-weight: 400;
}

/* Aplicar Baloo a todos los encabezados */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Baloo', 'Quicksand', sans-serif;
    font-weight: normal; /* Para coincidir con Baloo-Regular */
}

.btn, strong, .highlight {
    font-family: 'Quicksand', sans-serif;
    font-weight: bold; /* Esto activará la variante "Bold" */
}

/* Tipografía mejorada */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.8rem;
}

h3 {
    font-size: 2rem;
}

p {
    margin-bottom: 1.5rem;
}

/* Utilidades */
.container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: white;
    padding: 12px;
    z-index: 10000;
    text-decoration: none;
    border-radius: 0 0 8px 8px;
    transition: var(--transition);
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Header mejorado */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
    padding: 0;
}

header.scrolled {
    padding: 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
}

/* ================= LOGO NUEVO ESTILIZADO ================= */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    position: relative;
}

.logo-icon-wrapper {
    width: 70px;
    height: 65px;
    border-radius:50px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 1.6rem;
    box-shadow: 0 4px 12px rgba(3, 65, 18, 0.25);
    transform: rotate(-5deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Responsive logo image */
.logo-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Adjust logo wrapper on small screens */
@media (max-width: 768px) {
    .logo-icon-wrapper { width: 90px; height: 85px; }
}

@media (min-width: 1200px) {
    .logo-icon-wrapper { width: 80px; height: 75px; }
}

.logo-container:hover .logo-icon-wrapper {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 6px 18px rgba(6, 73, 4, 0.35);
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-medium);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.logo-name {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Baloo', 'Segoe UI', sans-serif;
    letter-spacing: -0.5px;
}
/* ================= FIN LOGO NUEVO ================= */

.nav-links {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.05rem;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
    cursor: pointer;
}

.nav-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
    border-radius: 2px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

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

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--primary);
    padding: 8px;
    transition: var(--transition);
}

.hamburger:hover {
    transform: scale(1.1);
}

/* ========== HERO SLIDER MEJORADO ========== */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 1.2s ease-in-out;
    transform: scale(1.1);
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.3);
}

/* Efecto parallax para el slider */
.hero-slider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(109, 74, 255, 0.1) 0%,
        rgba(76, 175, 80, 0.1) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Controles del slider mejorados */
.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 3;
}

.slider-prev,
.slider-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-size: 1.4rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.slider-prev:hover,
.slider-next:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Indicadores mejorados */
.slider-indicators {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 3;
}

.indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--white);
    transition: var(--transition);
}

.indicator.active::before {
    left: 0;
}

.indicator.active {
    transform: scale(1.3);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* Contador de slides */
.slide-counter {
    position: absolute;
    bottom: 40px;
    right: 40px;
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 3;
}

/* Asegurar que el contenido esté por encima del slider */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    max-width: 900px;
    padding: 0 2rem;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: var(--white);
    opacity: 1;
    animation: fadeInUp 1s ease 0.2s both;
}

/* Botones mejorados con efecto ripple */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 10px;
    position: relative;
    overflow: hidden;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600; /* Semi-bold */
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: var(--transition);
}

.btn:hover:before {
    left: 100%;
}

/* Efecto ripple */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
    
.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--white);
    box-shadow: 0 6px 20px rgba(255, 123, 84, 0.4);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(255, 123, 84, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-outline {
    background: transparent url('img/btn-download-bg.svg') center/cover no-repeat;
    color: var(--primary);
    border: 2px solid var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 0.95rem;
    border-radius: 12px;
    min-height: 40px;
    line-height: 1;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Keep button visible and slightly smaller on very small screens */
@media (max-width: 480px) {
    .btn-outline {
        padding: 7px 10px;
        font-size: 0.9rem;
        min-height: 36px;
    }
}

/* Secciones mejoradas */
section {
    padding: 120px 0;
    position: relative;
}

.section-light {
    background: var(--white);
}

.section-gray {
    background: var(--light-gray);
}

.section-pattern {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    display: block;
}

.section-title.light h2 {
    color: var(--white);
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.section-title.light:after {
    background: linear-gradient(90deg, var(--white), rgba(255,255,255,0.7));
}

.section-subtitle {
    font-size: 1.3rem;
    color: var(--text-medium);
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.section-subtitle.light {
    color: rgba(255, 255, 255, 0.9);
}

/* ========== CARDS MEJORADAS CON ALINEACIÓN PERFECTA ========== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Cambia esto */
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 992px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Versión responsiva mejorada */

.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(109, 74, 255, 0.1);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-icon {
    font-size: 5rem; /* increased from 3.5rem for better visibility */
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: transform 220ms ease;
}

/* Larger screens: even bigger */
@media (min-width: 1200px) {
    .card-icon { font-size: 5.5rem; }
}

/* Medium screens */
@media (max-width: 992px) {
    .card-icon { font-size: 4.5rem; }
}

/* Small screens */
@media (max-width: 768px) {
    .card-icon { font-size: 3.5rem; }
}

/* Hover/focus effect: subtle lift */
.card-icon:hover,
.card-icon:focus {
    transform: translateY(-6px) scale(1.05);
}

/* image variant for card icons (rounded rectangle) */
.card-icon-img {
    width: 140px; /* rectangle width */
    height: 100px; /* rectangle height */
    border-radius: 16px; /* rounded corners */
    object-fit: contain; /* show full logo without cropping */
    object-position: center;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 80% auto; /* make the logo larger and centered */
    padding: 8px; /* visual padding inside the rectangle */
    overflow: hidden; /* crop any overflow from svg */
    display: block;
    margin: 0 auto 1.25rem;
    align-self: center;
    box-shadow: 0 14px 36px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
    background-color: var(--white);
    transition: transform 220ms ease, box-shadow 220ms ease;
} 

/* Large screens slightly bigger */
@media (min-width: 1200px) {
    .card-icon-img { width: 160px; height: 110px; }
} 

/* Medium screens */
@media (max-width: 992px) {
    .card-icon-img { width: 120px; height: 90px; }
} 

/* Slightly smaller on small screens */
@media (max-width: 768px) {
    .card-icon-img { width: 96px; height: 72px; border-radius: 12px; }
}

/* subtle hover/focus lift for emphasis */
.card-icon-img:hover,
.card-icon-img:focus {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 22px 48px rgba(0,0,0,0.28);
}

.card h3 {
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    color: var(--text-dark);
}

.card p {
    color: var(--text-medium);
    font-size: 1.05rem;
    flex: 1;
    margin-bottom: 1.5rem;
}

/* Contenedor de imágenes consistente */
.image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

/* Reusable responsive image utility */
.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure image-container images also use fluid pattern */
.image-container img { width: 100%; height: 100%; display: block; object-fit: cover; }

.image-container:hover img {
    transform: scale(1.05);
}

/* Stats mejorados */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 0;
    z-index: 2;
    position: relative;
}


.stat-item {
    text-align: center;
    padding: 1.5rem 1rem;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 30px rgba(109, 74, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid rgba(109, 74, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stat-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 15px 40px rgba(109, 74, 255, 0.25);
    border-color: rgba(109, 74, 255, 0.3);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1;
    font-family: 'Segoe UI', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    opacity: 0.9;
}

.section-pattern .stat-item {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
}

.section-pattern .stat-number {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-pattern .stat-label {
    color: var(--text-dark);
    opacity: 0.9;
}

/* ========== MEDIA QUERIES ESPECÍFICAS PARA STATS ========== */

/* Tablets */
@media (max-width: 992px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 1.5rem 0.5rem;
    }
    
    .stat-number {
        font-size: 2.8rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
        margin-top: 2rem;
        padding: 0 10px;
    }
    
    .stat-item {
        padding: 1.2rem 0.5rem;
        border-radius: var(--border-radius);
    }
    
    .stat-number {
        font-size: 2.5rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
        letter-spacing: 0.5px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .stat-item {
        padding: 1rem 0.5rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.2rem 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
}

/* ========== FIX ESPECÍFICO PARA XIAOMI Y DISPOSITIVOS CON PROBLEMAS ========== */
@media (max-width: 768px) {
    .stats-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    
    .stat-item {
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Forzar renderizado en GPU */
    .stat-number, .stat-label {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* ========== ANIMACIONES PARA LOS NÚMEROS ========== */
.stat-number {
    position: relative;
    overflow: hidden;
}

.stat-number::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: transform 0.6s ease;
}

.stat-item:hover .stat-number::after {
    transform: translateX(200%);
}

/* ========== EFECTO DE BRILLO AL PASAR EL MOUSE ========== */
.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(109, 74, 255, 0.1), rgba(76, 175, 80, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: -1;
}

.stat-item:hover::before {
    opacity: 1;
}

/* Testimonials mejorados */
.testimonials-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

/* Center the testimonies title and improve text justification */
#testimonios .section-title h2 {
    text-align: center;
}

.testimonial {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
}

.testimonial:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.testimonial-content {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.7;
    position: relative;
    z-index: 1;
    text-align: justify; /* Justify testimonial text */
    text-justify: inter-word;
    hyphens: auto;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.2rem;
}

.author-info strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}

.author-info span {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Make author info centered on small screens for better visual balance */
@media (max-width: 900px) {
    .testimonial-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.4rem;
    }
    .author-avatar {
        width: 56px;
        height: 56px;
    }
    .testimonial-content {
        font-size: 1rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .testimonial-content {
        font-size: 0.98rem;
        line-height: 1.55;
    }
}

/* Gallery mejorada con alineación perfecta */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    align-items: center;
}

.gallery-item {
    height: auto;
    aspect-ratio: 4/3;
    min-height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Contact section mejorada */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start; /* Cambiado de stretch a start */
}
    

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%; /* Asegura que ocupe toda la altura */
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.contact-item i {
    font-size: 1.4rem;
    color: var(--primary);
    margin-top: 0.2rem;
    min-width: 30px;
}

.contact-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-item p {
    margin: 0;
    color: var(--text-medium);
}

.contact-info h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    font-size: 1.8rem;
    text-align: left;
}

.map-container {
    height: 500px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#map {
    width: 100%;
    height: 100%;
    border: none;
}

/* Formulario mejorado */
.form-container {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
}

.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.contact-form h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-container h3 {
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    text-align: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.7rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-bg);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(74, 107, 175, 0.1);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Estados de validación del formulario */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.error-message {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

.success-message {
    color: var(--success);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group.success .success-message {
    display: block;
}

/* Footer mejorado */
footer {
    background: linear-gradient(135deg, var(--text-dark) 0%, #1a2536 100%);
    color: var(--white);
    padding: 5rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    position: relative;
    padding-bottom: 0.8rem;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.footer-section p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.footer-contact p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.footer-contact i {
    margin-right: 0.8rem;
    margin-top: 0.2rem;
    color: var(--primary-light);
    min-width: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding: 0.3rem 0;
    cursor: pointer;
}

.footer-links a:hover {
    color: var(--white);
    transform: translateX(8px);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    font-size: 1.2rem;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.work-with-us-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 12px 25px;
    background: var(--secondary);
    color: var(--white);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.work-with-us-btn:hover {
    background: var(--secondary-dark);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(44, 138, 113, 0.4);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* WhatsApp button mejorado - Corregir visibilidad inicial */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    border-radius: 50px;
    text-align: center;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
    z-index: 9999; /* Aumentar z-index */
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 14px 22px;
    transition: var(--transition);
    animation: float 3s ease-in-out infinite, whatsappPulse 2s ease-in-out infinite;
    cursor: pointer;
    transform: translateZ(0); /* Forzar aceleración GPU */
    will-change: transform, box-shadow; /* Optimizar animaciones */
}

@keyframes whatsappPulse {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(37, 211, 102, 0.5);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 35px rgba(37, 211, 102, 0.8), 0 0 15px rgba(37, 211, 102, 0.6);
        transform: translateY(-5px);
    }
}

/* Asegurar que sea visible en móviles desde el inicio */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 70px; /* Debajo del chat-toggle (140px) con espacio */
        right: 20px;
        padding: 0; /* Eliminar padding para hacerlo circular */
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
        /* Forzar visibilidad inicial */
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        animation: float 3s ease-in-out infinite, whatsappPulse 2s ease-in-out infinite;
    }
    
    .whatsapp-text {
        display: none !important;
    }

    
    
    .whatsapp-float {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
        padding: 0;
    }
}

/* Forzar visibilidad en dispositivos Xiaomi específicamente */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .whatsapp-float {
        bottom: calc(80px + env(safe-area-inset-bottom)); /* Considerar área segura */
        z-index: 10001;
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

.whatsapp-float:hover {
    transform: translateY(-5px);
    animation: none;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.7);
}

.whatsapp-text {
    font-size: 15px;
    margin-right: 8px;
    color: #fff;
    font-weight: 600;
}

.whatsapp-float i {
    font-size: 1.6rem;
    color: #fff;
}

/* ========== CHATBOT MEJORADO ========== */

/* Estado base: oculto */
.chat-widget {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: none;
    flex-direction: column;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(20px);
}

.chat-toggle {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex !important; /* Forzar display */
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 10000; /* Aumentar z-index */
    transition: var(--transition);
    transform: translateZ(0); /* Forzar aceleración GPU */
    will-change: transform; /* Optimizar animaciones */
    opacity: 1 !important; /* Forzar visibilidad */
    visibility: visible !important;
}

/* Estado activo del botón del chat */
.chat-toggle.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(109, 74, 255, 0.6);
}

/* Ajustes específicos para móviles */
@media (max-width: 768px) {
    .chat-toggle {
        bottom: 140px; /* Separar del botón de WhatsApp */
        right: 20px;
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
        /* Forzar visibilidad */
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ajustar posición del widget del chat en móviles */
    .chat-widget {
        width: calc(100vw - 40px);
        height: 65vh;
        bottom: 80px;
        right: 20px;
        left: 20px;
        margin: 0 auto;
        display: none; /* Mantener hidden por defecto */
    }
    
    .chat-widget.active {
        display: flex;
        animation: chatSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
}

/* Asegurar visibilidad en dispositivos con notch o bordes redondeados */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .chat-toggle {
        bottom: calc(140px + env(safe-area-inset-bottom));
        right: max(20px, env(safe-area-inset-right));
    }
}

.chat-widget.active {
    display: flex;
    animation: chatSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes chatSlideIn {
    from {
        transform: translateY(30px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    animation: avatarPulse 2s infinite;
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.chat-title {
    font-weight: 600;
    font-size: 1.2rem;
}

.chat-status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--light-bg);
}

.chat-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.4;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background: var(--white);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--light-gray);
}

.user-message {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(109, 74, 255, 0.3);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 6px;
    text-align: right;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply {
    background: var(--light-gray);
    border: none;
    border-radius: 15px;
    padding: 8px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
}

.quick-reply:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
}

.chat-input-container {
    padding: 18px;
    border-top: 1px solid var(--light-gray);
    background: var(--white);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--light-gray);
    border-radius: 25px;
    outline: none;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(109, 74, 255, 0.1);
}

.chat-send {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
}

.chat-send:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.chat-send:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.chat-toggle {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 100;
    transition: var(--transition);
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle.pulse {
    animation: chatPulse 2s infinite;
}

@keyframes chatPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(109, 74, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(109, 74, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(109, 74, 255, 0);
    }
}

/* Typing indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--white);
    border-radius: 18px;
    align-self: flex-start;
    border: 1px solid var(--light-gray);
    margin-bottom: 10px;
}

.typing-indicator.active {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingAnimation {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Booking Modal */
.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.booking-modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Blog Section */
.blog-card {
    text-align: left;
    position: relative;
}

.blog-date {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Animaciones mejoradas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll animations mejoradas */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    animation: gracefulAppear 0.8s ease-out;
}

@keyframes gracefulAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Progress scroll indicator */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 1001;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 99;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
}

/* Message styles */
.message-toast {
    position: fixed;
    top: 100px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 10px;
    color: white;
    z-index: 3000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    font-weight: 600;
}

.message-toast.success {
    background: var(--success);
}

.message-toast.error {
    background: var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== MEJORAS DE RESPONSIVIDAD ========== */

/* Base mejorada para móviles */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* Chatbot 100% responsivo */
@media (max-width: 768px) {
    .chat-widget {
        width: 95vw;
        height: 70vh;
        bottom: 80px;
        right: 2.5vw;
        left: 2.5vw;
    }
}

/* Formularios optimizados para móviles */
@media (max-width: 576px) {
    .form-group input, 
    .form-group textarea, 
    .form-group select {
        font-size: 16px; /* Previene zoom en iOS */
        padding: 12px;
    }
}

/* Mejoras específicas para móviles muy pequeños */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .container {
        width: 92%;
    }
    
    /* Ajuste logo móvil pequeño */
    .logo-container {
        justify-content: center;
        width: 100%;
    }
    .logo-name {
        font-size: 1.3rem;
    }
    .logo-icon-wrapper {
        width: 60px;
        height: 56px;
        font-size: 1.2rem;
    }
    
    .card {
        padding: 2rem 1.5rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

/* Media Queries - Responsividad mejorada */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }
    
    h1 {
        font-size: 3.2rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.3rem;
    }
    
    .section-title h2 {
        font-size: 2.5rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .chat-widget {
        width: 380px;
        height: 550px;
    }
}

@media (max-width: 768px) {
    nav {
        justify-content: center;
    }

    .hamburger {
        display: block;
        position: absolute;
        right: 20px;
    }

   .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        /* CORREGIR: Cambiar de transparente a sólido */
        background: var(--white); /* Fondo sólido blanco */
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 4rem;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 999; /* Asegurar que esté por encima */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .hero {
        margin-top: 80px;
        height: 80vh;
        min-height: 600px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    section {
        padding: 80px 0;
    }

    .section-title h2 {
        font-size: 2.2rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .testimonials-container {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .slider-controls {
        padding: 0 1rem;
    }

    .slider-prev,
    .slider-next {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .slider-indicators {
        bottom: 25px;
    }

    .slide-counter {
        bottom: 25px;
        right: 25px;
        font-size: 0.9rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h3:after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-contact {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-contact p {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        padding: 0;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
    }

    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
    }

    .message-toast {
        right: 20px;
        left: 20px;
        max-width: none;
    }

    .chat-toggle {
        bottom: 150px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .chat-widget {
        width: calc(100vw - 40px);
        height: 60vh;
        bottom: 80px;
        right: 20px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .btn {
        padding: 14px 28px;
        font-size: 1rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .card {
        padding: 2.5rem 1.5rem;
    }

    .form-container {
        padding: 2rem 1.5rem;
    }

    .testimonial {
        padding: 2rem 1.5rem;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-top: 0;
    }

    .stat-item {
        padding: 0.75rem 0.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
        margin-bottom: 0.25rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }

    .slider-controls {
        padding: 0 0.5rem;
    }

    .slider-prev,
    .slider-next {
        width: 40px;
        height: 40px;
    }

    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        padding: 0;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        justify-content: center;
    }

    .back-to-top {
        bottom: 15px;
        left: 15px;
        width: 40px;
        height: 40px;
    }

    .chat-widget {
        width: calc(100vw - 30px);
        height: 65vh;
        bottom: 70px;
        right: 15px;
    }
}

@media (max-width: 400px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .chat-widget {
        width: calc(100vw - 20px);
        right: 10px;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .whatsapp-float {
        animation: none;
    }
    
    .chat-toggle.pulse {
        animation: none;
    }
    
    .typing-dot {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f8f9fa;
        --text-medium: #e9ecef;
        --text-light: #adb5bd;
        --white: #212529;
        --light-bg: #343a40;
        --light-gray: #495057;
    }
    
    body {
        background-color: var(--light-bg);
        color: var(--text-medium);
    }
    
    .section-light {
        background: var(--white);
    }
    
    .section-gray {
        background: var(--light-gray);
    }
    
    .card {
        background: var(--white);
    }
    
    .card h3 {
        color: var(--text-dark);
    }
    
    .card p {
        color: var(--text-medium);
    }
    
    .testimonial {
        background: var(--white);
    }
    
    .author-info strong {
        color: var(--text-dark);
    }
    
    .form-container {
        background: var(--white);
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: var(--light-bg);
        color: var(--text-medium);
        border-color: var(--light-gray);
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        background: var(--white);
    }
}

/* Lazy loading styles */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy-loaded {
    opacity: 1;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========== VIDEO SECTION STYLES ========== */
#video {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.video-container {
    max-width: 1200px;
    margin: 0 auto;
}

.video-wrapper {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    margin-bottom: 3rem;
}

.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-player {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16/9;
}

.video-element {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.video-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-button {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(109, 74, 255, 0.4);
    margin-bottom: 1.5rem;
}

.play-button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(109, 74, 255, 0.6);
}

.video-info {
    text-align: center;
    color: white;
}

.video-info h3 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.video-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* Video controls */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 3;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.video-player:hover .video-controls {
    opacity: 1;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.progress-container {
    flex: 1;
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
    z-index: 1;
}

.time-display {
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

.volume-slider {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.volume:hover .volume-slider {
    opacity: 1;
}

/* Thumbnails gallery */
.video-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.thumbnail {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 16/9;
}

.thumbnail.active {
    box-shadow: 0 0 0 3px var(--primary), 0 8px 25px rgba(109, 74, 255, 0.3);
    transform: translateY(-5px);
}

.thumbnail:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail:hover img {
    transform: scale(1.05);
}

.thumbnail-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
}

.thumbnail-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.thumbnail:hover .thumbnail-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.thumbnail h4 {
    color: white;
    margin-bottom: 0.3rem;
    font-size: 1.2rem;
}

.thumbnail p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Video description */
.video-description {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.video-description h3 {
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.video-description p {
    color: var(--text-medium);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.video-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-light);
}

.stat i {
    color: var(--primary);
    font-size: 1.2rem;
}

.video-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Fullscreen mode */
.video-player.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
}

.video-player.fullscreen .video-element {
    width: 100%;
    height: 100%;
}

.video-player.fullscreen .video-controls {
    padding: 2rem 3rem;
}

/* Loading state */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    z-index: 2;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .video-thumbnails {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-controls {
        padding: 1rem 1.5rem;
    }
    
    .play-button {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    .video-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .video-thumbnails {
        grid-template-columns: 1fr;
    }
    
    .video-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .video-controls {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }
    
    .progress-container {
        order: 1;
        flex: 0 0 100%;
        margin-top: 0.5rem;
    }
    
    .play-button {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }
    
    .video-info h3 {
        font-size: 1.3rem;
    }
    
    .video-description {
        padding: 2rem;
    }
}

@media (max-width: 576px) {
    .video-controls {
        opacity: 1;
        background: rgba(0,0,0,0.8);
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .video-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========== CORRECCIONES ESPECÍFICAS PARA XIAOMI ========== */
@media screen and (device-width: 360px) and (device-height: 780px) and (-webkit-device-pixel-ratio: 3) {
    /* Xiaomi Note 14 Pro específico */
    .whatsapp-float {
        bottom: 90px !important;
        right: 15px !important;
        z-index: 10001 !important;
    }
    
    .chat-toggle {
        bottom: 160px !important;
        right: 15px !important;
        z-index: 10000 !important;
    }
    
    .back-to-top {
        left: 15px !important;
        bottom: 15px !important;
    }
    
    /* Asegurar que los botones sean táctiles */
    .whatsapp-float,
    .chat-toggle,
    .back-to-top {
        min-width: 44px !important;
        min-height: 44px !important;
    }
}

/* ========== FIX GENERAL PARA MÓVILES ========== */
@media (max-width: 768px) {
    /* Prevenir desplazamiento horizontal */
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Asegurar que los elementos fijos estén siempre visibles */
    .whatsapp-float,
    .chat-toggle,
    .back-to-top {
        transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
    }
}

/* Ocultar flechas de navegación en móviles (pantallas menores a 768px) */
@media (max-width: 768px) {
    .slider-prev,
    .slider-next {
        display: none !important;
    }

    /* Si quieres ocultar otros elementos, agrégalos aquí. 
       Por ejemplo, los indicadores redondos si tampoco los quieres: */
    .slider-indicators {
        display: none;
    }
}

/* Forzar movimiento de los iconos flotantes de la derecha */
.whatsapp-button, 
[class*="whatsapp"], 
.joinchat, 
#ht-ctc-chat {
    bottom: 70px !important;
}

/* 1. Mover el botón de WhatsApp (el de abajo) */
.joinchat--right {
    bottom: 40px !important;
}

/* 2. Mover el botón del Chatbot (el de arriba) */
#hubspot-messages-loader-container, 
.social-button.chat {
    bottom: 120px !important;
}

/* 3. Asegurar que no se tapen en móviles */
@media (max-width: 768px) {
    .joinchat--right {
        bottom: 30px !important;
    }
    #hubspot-messages-loader-container {
        bottom: 110px !important;
    }
}

/* FIX PARA EL CHATBOT - Asegurar que sea visible cuando está activo */
.chat-widget.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* FIX para el botón del chat en móviles */
@media (max-width: 768px) {
    .chat-toggle {
        z-index: 10001 !important;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .chat-widget {
        z-index: 10002 !important;
    }
}

/* Forzar visibilidad del botón del chat */
.chat-toggle {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Animación para que los elementos aparezcan */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats mejorados - Corrección de visibilidad */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding: 20px;
}

.stat-item {
    text-align: center;
    padding: 2rem 1rem;
    /* Cambiado a un fondo sutil gris para que resalte en fondos claros */
    background: var(--white); 
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 800;
    /* Cambiado de var(--white) a violeta para que sea visible */
    color: var(--primary); 
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 1.1rem;
    /* Cambiado a gris oscuro para legibilidad */
    color: var(--text-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* FIX PARA LAS CARDS EN CASCADA */
#proyecto .cards-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-flow: row !important;
}

/* Para móviles */
@media (max-width: 992px) {
    #proyecto .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #proyecto .cards-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .hero h1, .hero p {
        color: #ffffff !important; /* Fuerza el color blanco puro en móviles */
    }
}

/* Añade esto al final de tu archivo styles.css */

/* ========== CORRECCIÓN PARA MODO OSCURO EN RESOLUCIÓN 771px A 906px ========== */
@media screen and (min-width: 771px) and (max-width: 906px) and (prefers-color-scheme: dark) {
    /* 1. Corregir texto en el header/navbar */
    header {
        background: rgba(33, 37, 41, 0.95) !important; /* Fondo oscuro para modo oscuro */
    }
    
    .nav-links a {
        color: #f8f9fa !important; /* Texto blanco para enlaces del menú */
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        color: var(--primary-light) !important; /* Color primario claro en hover */
    }
    
    /* 2. Corregir texto del hero (Educación Innovadora...) */
    .hero h1,
    .hero p {
        color: #ffffff !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7) !important;
    }
    
    /* 3. Corregir texto del logo */
    .logo-name {
        -webkit-text-fill-color: #ffffff !important;
        color: #ffffff !important;
    }
    
    .logo-brand {
        color: rgba(255, 255, 255, 0.8) !important;
    }
    
    /* 4. Corregir icono del hamburger menu si es visible */
    .hamburger {
        color: #ffffff !important;
    }
    
    /* 5. Asegurar que el overlay del slider sea más oscuro en modo oscuro */
    .hero-slider::before {
        background: linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.6) 0%,
            rgba(0, 0, 0, 0.8) 100%
        ) !important;
    }
    
    .slide img {
        filter: brightness(0.2) !important;
    }
}

/* ========== CORRECCIÓN GENERAL PARA MODO OSCURO ========== */
@media (prefers-color-scheme: dark) {
    /* Asegurar que el texto sea legible en modo oscuro */
    body {
        color: #e9ecef !important;
    }
    
    /* Corregir secciones que podrían tener problemas */
    .section-light {
        background: #212529 !important;
    }
    
    .section-gray {
        background: #343a40 !important;
    }
    
    /* Corregir texto de encabezados */
    h1, h2, h3, h4, h5, h6 {
        color: #f8f9fa !important;
    }
    
    /* Corregir texto en cards */
    .card h3 {
        color: #f8f9fa !important;
    }
    
    .card p {
        color: #e9ecef !important;
    }
    
    /* Corregir navegación en modo oscuro */
    header {
        background: rgba(33, 37, 41, 0.95) !important;
        backdrop-filter: blur(15px) !important;
    }
    
    .nav-links a {
        color: #f8f9fa !important;
    }
    
    /* Corregir hero section en modo oscuro */
    .hero h1,
    .hero p {
        color: #ffffff !important;
    }
    
    /* Asegurar visibilidad de botones en modo oscuro */
    .btn-secondary {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }
}

/* ========== CORRECCIÓN ESPECÍFICA PARA RANGOS DE RESOLUCIÓN ========== */
@media screen and (min-width: 771px) and (max-width: 992px) {
    /* Asegurar que el texto sea visible en tablets en modo oscuro */
    @media (prefers-color-scheme: dark) {
        .hero-content {
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
        }
        
        /* Mejorar contraste del menú */
        .nav-links a {
            font-weight: 600 !important;
        }
    }
}

/* ========== FORZAR COLORES EN MODO OSCURO PARA ELEMENTOS ESPECÍFICOS ========== */
@media (prefers-color-scheme: dark) {
    /* Elementos que deben ser siempre claros en modo oscuro */
    .text-dark {
        color: #f8f9fa !important;
    }
    
    .text-medium {
        color: #e9ecef !important;
    }
    
    .text-light {
        color: #adb5bd !important;
    }
    
    /* Logo en modo oscuro */
    .logo-container {
        filter: brightness(1.2);
    }
    
    /* Mejorar visibilidad del menú hamburguesa si existe */
    .hamburger {
        color: #ffffff !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px;
    }
}

/* SOLUCIÓN DE EMERGENCIA - Añadir esto al final del archivo */
@media screen and (min-width: 771px) and (max-width: 906px) {
    /* Detectar automáticamente si está en modo oscuro y forzar colores */
    @media (prefers-color-scheme: dark) {
        /* Forzar color blanco en TODOS los textos del hero */
        .hero *:not(button):not(a):not(.btn) {
            color: #ffffff !important;
        }
        
        /* Forzar color blanco en el menú de navegación */
        nav * {
            color: #ffffff !important;
        }
        
        /* Asegurar que los enlaces también sean visibles */
        a {
            color: #ffffff !important;
        }
        
        .nav-links a {
            color: #ffffff !important;
        }
        
        .logo-name {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }
    }
}

/* Detección manual de modo oscuro para navegadores antiguos */
@media screen and (min-width: 771px) and (max-width: 906px) {
    body.dark-mode .hero h1,
    body.dark-mode .hero p,
    body.dark-mode .nav-links a,
    body.dark-mode .logo-name {
        color: #ffffff !important;
    }
}

