:root {
    --primary: #1a237e;
    /* Azul oscuro principal */
    --primary-light: #303f9f;
    --accent: #00bcd4;
    /* Toque de azul claro para acentos */
    --white: #ffffff;
    --black: #000000;
    --gray: #f5f5f5;
    --dark-gray: #333333;

    /* Variables para modo claro */
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg: #ffffff;
    --section-bg: #f5f5f5;
    --footer-bg: #000000;
    --header-bg: #ffffff;
    --nav-text: #000000;
    --hero-text: #ffffff;

    /* Resultados en modo claro */
    --results-bg: #ffffff;
    --results-text: #000000;
    --results-card-bg: rgba(0, 0, 0, 0.03);
    --results-label: rgba(0, 0, 0, 0.7);

    /* Sombras para modo claro */
    --shadow-small: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 32px rgba(26, 35, 126, 0.18), 0 1.5px 6px rgba(0, 0, 0, 0.10);
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --section-bg: #1a1a1a;
    --footer-bg: #000000;
    --header-bg: #1a1a1a;
    --nav-text: #e0e0e0;
    --hero-text: #ffffff;
    --primary: #3d5afe;
    /* Azul más vibrante en oscuro */

    /* Resultados en modo oscuro */
    --results-bg: #121212;
    --results-text: #ffffff;
    --results-card-bg: rgba(255, 255, 255, 0.07);
    --results-label: rgba(255, 255, 255, 0.8);

    /* Sombras para modo oscuro */
    --shadow-small: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.4), 0 1.5px 6px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Helvetica', Arial, sans-serif;
    transition: background-color 0.3s, color 0.2s;
}

body {
    color: var(--text-color);
    line-height: 1.7;
    background-color: var(--bg-color);
}

html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Switch modo oscuro */
.theme-switcher {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 999;
    background: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-small);
}

.theme-switcher i {
    color: white;
    font-size: 1.3rem;
}

/* Header */
header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Logo con estilo original */
.logo {
    font-family: 'Montserrat', 'Helvetica', Arial, sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary, #1a237e);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.logo .logo-highlight {
    color: var(--accent);
    font-weight: 500;
    margin-left: 2px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 35px;
}

nav ul li a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    bottom: -5px;
    left: 0;
    transition: width 0.3s;
}

nav ul li a:hover:after {
    width: 100%;
}

nav ul li a:hover {
    color: var(--primary);
}

/* Menú hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    z-index: 11001;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 4px;
    background: var(--primary, #1a237e);
    margin-bottom: 6px;
    border-radius: 2px;
    transition: 0.3s;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

/* Responsive: menú hamburguesa a la izquierda y logo centrado */
@media (max-width: 900px) {
    .container.nav-container {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        height: 60px;
    }

    .hamburger {
        display: flex;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        margin: 0;
        z-index: 11001;
    }

    .logo {
        margin: 0 auto;
        font-size: 1.6rem;
        position: relative;
        left: 0;
        right: 0;
        text-align: center;
        z-index: 1;
    }

    nav#main-nav {
        position: fixed;
        top: 0;
        left: -100vw;
        width: 70vw;
        max-width: 320px;
        height: 100vh;
        background: var(--card-bg, #fff);
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.10);
        transition: left 0.3s;
        z-index: 11000;
        display: flex;
        flex-direction: column;
        padding-top: 60px;
    }

    nav#main-nav.open {
        left: 0;
    }

    nav#main-nav ul {
        flex-direction: column;
        gap: 24px;
        align-items: flex-start;
        padding-left: 24px;
    }

    nav#main-nav ul li a {
        font-size: 1.2rem;
        padding: 10px 15px;
        display: inline-block;
    }
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1499951360447-b19be8fe80f5?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80') no-repeat center center/cover;
    color: var(--hero-text);
    padding: 220px 0 120px;
    text-align: center;
}

.hero h1 {
    font-size: 3.2rem;
    margin-bottom: 25px;
    color: var(--hero-text);
    letter-spacing: 1px;
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 40px;
    color: rgba(255, 255, 255, 0.9);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 14px 35px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.4s;
    border: none;
    cursor: pointer;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--white);
    border-color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary);
}

/* Secciones */
.section {
    padding: 100px 0;
    background-color: var(--section-bg);
}

.section.white-bg {
    background-color: var(--bg-color);
}

.section-title {
    text-align: center;
    margin-bottom: 70px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.section-title h2:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--primary);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.section-title p {
    color: var(--text-color);
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow-small);
    transition: all 0.4s;
    border: 1.8px solid rgba(26, 35, 126, 0.18);
}

body:not(.dark-mode) .service-card,
body:not(.dark-mode) .feature,
body:not(.dark-mode) .result-item,
body:not(.dark-mode) .testimonial-card,
body:not(.dark-mode) .faq-item {
    box-shadow: var(--shadow-medium);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(61, 90, 254, 0.1);
}

.service-icon {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 25px;
}

.service-card h3 {
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.service-card p {
    color: var(--text-color);
    opacity: 0.8;
}

/* Why Us */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    transition: all 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 25px;
}

.feature h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature p {
    color: var(--text-color);
    opacity: 0.8;
}

/* SECCIÓN DE RESULTADOS ADAPTABLE A MODO CLARO/OSCURO */
.results {
    background-color: var(--results-bg);
    color: var(--results-text);
    padding: 100px 0;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.results h2 {
    font-size: 2.5rem;
    margin-bottom: 60px;
    color: var(--results-text);
}

.results h2 span {
    color: var(--accent);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.result-item {
    background-color: var(--results-card-bg);
    padding: 40px 20px;
    border-radius: 10px;
    transition: all 0.4s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    max-width: 260px;
    min-width: 150px;
}

.result-item:hover {
    transform: translateY(-10px);
    background-color: rgba(0, 0, 0, 0.07);
}

body.dark-mode .result-item:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.result-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 20px;
}

.result-number {
    display: inline-block;
    min-width: 2.6em;
    font-variant-numeric: tabular-nums;
    font-family: 'Montserrat', 'Helvetica', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    transition: color 0.3s;
    text-align: center;
}

.result-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 10px;
    word-break: break-word;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Responsive: reduce el tamaño de fuente en móviles */
@media (max-width: 480px) {
    .results .result-label {
        font-size: 0.98rem;
        padding-left: 2px;
        padding-right: 2px;
    }

    .results .result-item {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* Estilos para el Carrusel de Testimonios */
.testimonial-carousel {
    display: flex;
    overflow-x: auto;
    /* Permite el scroll horizontal */
    scroll-snap-type: x mandatory;
    /* Asegura que los elementos se detengan en su posición */
    -webkit-overflow-scrolling: touch;
    /* Mejor scroll en iOS */
    gap: 30px;
    padding-bottom: 20px;
    /* Espacio para la barra de scroll */
    padding-left: 20px;
    padding-right: 20px;
    /* Padding para que los extremos se vean bien */
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    /* Asegura que no desborde en pantallas pequeñas */
}

.testimonial-carousel::-webkit-scrollbar {
    height: 8px;
}

.testimonial-carousel::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 10px;
}

.testimonial-carousel::-webkit-scrollbar-track {
    background-color: var(--gray);
    border-radius: 10px;
}

body.dark-mode .testimonial-carousel::-webkit-scrollbar-thumb {
    background-color: var(--primary);
}

body.dark-mode .testimonial-carousel::-webkit-scrollbar-track {
    background-color: #333;
}


.testimonial-card {
    flex: 0 0 auto;
    /* Evita que los elementos se encojan */
    width: 300px;
    /* Ancho fijo para cada tarjeta */
    scroll-snap-align: start;
    /* Alinea la tarjeta al inicio del scroll-snap */
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.testimonial-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--primary);
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
}

.testimonial-card h4 {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.testimonial-card span {
    font-size: 0.9em;
    color: var(--text-color);
    opacity: 0.7;
}

/* Estilos para la Sección de Preguntas Frecuentes (FAQ) */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    border: 1.5px solid rgba(26, 35, 126, 0.13);
}

.faq-question {
    padding: 20px;
    background: var(--section-bg);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text-color);
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: var(--primary-light);
    color: var(--white);
}

body.dark-mode .faq-question:hover {
    background: var(--primary);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    color: var(--text-color);
    opacity: 0.8;
}

/* Se aumentó la max-height para asegurar que el contenido completo sea visible */
.faq-answer.active {
    max-height: 500px;
    /* Un valor lo suficientemente grande para la mayoría de los contenidos */
    padding: 20px;
}

/* CTA */
.cta {
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1470&q=80') no-repeat center center/cover;
    color: var(--white);
    padding: 120px 0;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--white);
}

.cta p {
    max-width: 700px;
    margin: 0 auto 40px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--white);
    padding: 100px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 15px;
    color: var(--white);
}

.footer-col h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary);
}

.footer-col p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-col .contact-info {
    color: rgba(255, 255, 255, 0.7);
}

.footer-col .contact-info i {
    margin-right: 10px;
    color: var(--primary);
    width: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .section {
        padding: 80px 0;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 180px 0 80px;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .btn {
        padding: 12px 25px;
    }

    .theme-switcher {
        right: 20px;
        bottom: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero .btn {
        display: block;
        width: 80%;
        margin: 0 auto 15px;
    }

    /* Ajuste para el carrusel de testimonios en móviles */
    .testimonial-carousel {
        padding-left: 10px;
        padding-right: 10px;
    }

    .testimonial-card {
        width: 280px;
        /* Ajusta el ancho de las tarjetas en pantallas más pequeñas */
    }
}

/* Estilos del chat */
#chat-access-btn {
    position: fixed;
    bottom: 100px;
    right: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    font-size: 2rem;
    transition: background 0.2s, width 0.2s, height 0.2s, bottom 0.2s, right 0.2s;
}

/* Responsive para tablets */
@media (max-width: 768px) {
    #chat-access-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 80px;
        right: 20px;
    }
}

/* Responsive para móviles */
@media (max-width: 480px) {
    #chat-access-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        bottom: 70px;
        right: 20px;
    }
}

#chat-access-btn:hover {
    background: var(--primary);
}

/* Área de chat */
#chat-area {
    position: fixed;
    bottom: 100px;
    right: 32px;
    width: 320px;
    max-width: 95vw;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    border: 1.5px solid rgba(26, 35, 126, 0.18);
}

#chat-area.active {
    display: flex;
    animation: fadeInUp 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

#close-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.chat-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

.whatsapp-btn:hover {
    background: #128c7e;
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Aplicar animaciones */
.chat-header {
    animation: slideIn 0.4s ease-out;
}

.chat-body {
    animation: slideIn 0.6s ease-out;
}

/* Estilos para impresión */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    header,
    .theme-switcher,
    #chat-access-btn {
        display: none !important;
    }

    .container {
        width: 100% !important;
        padding: 0 !important;
    }

    .section {
        padding: 50px 0 !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-col {
        margin-bottom: 30px;
    }

    .copyright {
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
        padding-top: 15px !important;
    }
}

@media (max-width: 480px) {
    .result-item {
        max-width: 95vw;
        min-width: 0;
        padding-left: 8px;
        padding-right: 8px;
    }
}