/* =================================================================
   STYLE.CSS - Asesoría Aduaneras
   =================================================================
   Este archivo controla TODA la apariencia visual de la página.
   
   ESTRUCTURA DEL ARCHIVO:
   1. Variables CSS (colores, fuentes, sombras)
   2. Reset y estilos globales
   3. Componentes reutilizables (botones, títulos)
   4. Preloader (pantalla de carga)
   5. Top Bar (barra superior)
   6. Header y Navegación
   7. Hero (banner principal)
   8. Estadísticas (contadores)
   9. Servicios (tarjetas)
   10. Nosotros (sobre la empresa)
   11. Por qué elegirnos
   12. Testimonios (carrusel)
   13. CTA (llamada a la acción)
   14. Contacto y formulario
   15. WhatsApp flotante
   16. Botón subir
   17. Footer
   18. Animaciones
   19. Media Queries (responsive)
   ================================================================= */


/* =================================================================
   1. VARIABLES CSS
   Se definen aquí y se usan en todo el archivo con var(--nombre).
   Para cambiar un color en toda la página, solo se cambia aquí.
   ================================================================= */
:root {
    /* Paleta de colores principal */
    --primario: #003d7a;          /* Azul marino - color principal de la marca */
    --primario-claro: #0056a8;    /* Azul más claro para hovers */
    --primario-oscuro: #002d5c;   /* Azul más oscuro para footer */
    --secundario: #dc3545;        /* Rojo - inspirado en la bandera peruana */
    --secundario-claro: #e85765;  /* Rojo claro para hovers */
    --acento: #f0b429;            /* Dorado - para badges y acentos */
    --acento-claro: #f4c752;      /* Dorado claro */

    /* Colores neutros */
    --blanco: #ffffff;
    --claro: #f8f9fa;             /* Fondo de secciones alternas */
    --gris-claro: #e9ecef;        /* Bordes y separadores */
    --gris: #6c757d;              /* Texto secundario */
    --gris-oscuro: #495057;       /* Texto de párrafos */
    --oscuro: #212529;            /* Texto principal / títulos */

    /* Tipografía */
    --fuente-titulos: 'Montserrat', sans-serif;
    --fuente-cuerpo: 'Open Sans', sans-serif;

    /* Efectos */
    --sombra-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --sombra-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --sombra-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --sombra-primario: 0 4px 20px rgba(0, 61, 122, 0.3);
    --radio: 8px;                 /* Border-radius estándar */
    --radio-lg: 16px;             /* Border-radius grande */
    --transicion: all 0.3s ease;  /* Transición estándar */
    --transicion-lenta: all 0.5s ease;
}


/* =================================================================
   2. RESET Y ESTILOS GLOBALES
   Elimina márgenes y paddings predeterminados del navegador.
   Establece la fuente base y comportamiento del scroll.
   ================================================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* El padding no suma al ancho total */
}

html {
    scroll-behavior: smooth; /* Scroll suave al hacer clic en enlaces ancla */
    scroll-padding-top: 80px; /* Compensa el header fijo al navegar a secciones */
}

body {
    font-family: var(--fuente-cuerpo);
    font-size: 16px;
    line-height: 1.7;
    color: var(--gris-oscuro);
    background-color: var(--blanco);
    overflow-x: hidden; /* Evita scroll horizontal no deseado */
    -webkit-font-smoothing: antialiased;
}

/* Títulos usan Montserrat */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--fuente-titulos);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transicion);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Contenedor principal: centra el contenido con ancho máximo */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* =================================================================
   3. COMPONENTES REUTILIZABLES
   Botones y títulos de sección que se usan en varias partes.
   ================================================================= */

/* --- Botones --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-family: var(--fuente-titulos);
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 50px; /* Bordes redondeados tipo píldora */
    cursor: pointer;
    transition: var(--transicion);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
}

/* Botón principal: fondo azul */
.btn-primario {
    background: var(--primario);
    color: var(--blanco);
    border-color: var(--primario);
}

.btn-primario:hover {
    background: var(--primario-claro);
    border-color: var(--primario-claro);
    transform: translateY(-3px);
    box-shadow: var(--sombra-primario);
}

/* Botón outline: solo borde, fondo transparente */
.btn-outline {
    background: transparent;
    color: var(--blanco);
    border-color: var(--blanco);
}

.btn-outline:hover {
    background: var(--blanco);
    color: var(--primario);
    transform: translateY(-3px);
}

/* Botón outline claro: para sección CTA con fondo de color */
.btn-outline-claro {
    background: transparent;
    color: var(--blanco);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline-claro:hover {
    background: var(--blanco);
    color: var(--primario);
    border-color: var(--blanco);
    transform: translateY(-3px);
}

/* Botón WhatsApp: fondo verde */
.btn-whatsapp {
    background: #25D366;
    color: var(--blanco);
    border-color: #25D366;
}

.btn-whatsapp:hover {
    background: #128C7E;
    border-color: #128C7E;
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

/* --- Títulos de sección --- */
/* Cada sección principal tiene un subtítulo y un título con línea decorativa */
.titulo-seccion {
    text-align: center;
    margin-bottom: 50px;
}

.titulo-seccion h2 {
    font-size: 2.2rem;
    color: var(--oscuro);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

/* Línea roja decorativa debajo del título */
.titulo-seccion h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secundario);
    border-radius: 2px;
}

/* Subtítulo pequeño encima del título */
.subtitulo {
    display: block;
    font-family: var(--fuente-titulos);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secundario);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

/* Versión clara del título para fondos oscuros */
.titulo-claro h2 {
    color: var(--blanco);
}

.titulo-claro h2::after {
    background: var(--acento);
}

.titulo-claro .subtitulo {
    color: var(--acento);
}

/* Texto con gradiente (usado en hero) */
.texto-gradiente {
    background: linear-gradient(135deg, var(--acento), var(--acento-claro));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* =================================================================
   4. PRELOADER (PANTALLA DE CARGA)
   Se muestra al cargar la página y desaparece con JS.
   Enlazado con: index.html → #preloader
   Controlado por: script.js → ocultarPreloader()
   ================================================================= */
.preloader {
    position: fixed;
    inset: 0; /* top:0, right:0, bottom:0, left:0 */
    background: var(--primario);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999; /* Por encima de todo */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.oculto {
    opacity: 0;
    visibility: hidden;
}

.preloader p {
    color: var(--blanco);
    font-family: var(--fuente-titulos);
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
    letter-spacing: 2px;
}

/* Spinner: círculo giratorio animado */
.preloader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--acento);
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}


/* =================================================================
   5. TOP BAR (BARRA SUPERIOR)
   Barra delgada sobre el header con info de contacto rápido.
   Solo visible en desktop (se oculta en < 992px).
   Enlazado con: index.html → .top-bar
   ================================================================= */
.top-bar {
    background: var(--primario-oscuro);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar-contenido {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-derecha {
    display: flex;
    gap: 20px;
}

.top-bar-derecha a,
.top-bar-izquierda span {
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-bar-derecha a:hover {
    color: var(--acento);
}


/* =================================================================
   6. HEADER Y NAVEGACIÓN
   Barra de navegación fija (sticky) que cambia al hacer scroll.
   Enlazado con: index.html → header, .nav-links, .boton-menu-movil
   La clase .header-scroll se agrega desde script.js al hacer scroll.
   ================================================================= */
header {
    background: var(--blanco);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transicion);
    box-shadow: none;
}

/* Clase que JS agrega al hacer scroll → agrega sombra */
header.header-scroll {
    box-shadow: var(--sombra-md);
}

.contenedor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 45px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.35rem;
    margin-bottom: 0;
    color: var(--primario);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo h1 span {
    color: var(--secundario);
}

/* --- Menú de navegación desktop --- */
.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    font-family: var(--fuente-titulos);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gris-oscuro);
    padding: 8px 16px;
    border-radius: 50px;
    position: relative;
    transition: var(--transicion);
}

.nav-link:hover,
.nav-link.activo {
    color: var(--primario);
    background: rgba(0, 61, 122, 0.06);
}

/* Indicador debajo del enlace activo */
.nav-link.activo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--secundario);
    border-radius: 2px;
}

/* --- Botón menú hamburguesa (solo visible en móviles) --- */
.boton-menu-movil {
    display: none; /* Se muestra con media query < 768px */
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    width: 40px;
    height: 40px;
}

/* Las 3 líneas del ícono hamburguesa */
.hamburguesa-linea {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--primario);
    border-radius: 2px;
    transition: var(--transicion);
    transform-origin: center;
}

/* Animación X cuando el menú está abierto */
.boton-menu-movil.activo .hamburguesa-linea:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.boton-menu-movil.activo .hamburguesa-linea:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.boton-menu-movil.activo .hamburguesa-linea:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}


/* =================================================================
   7. SECCIÓN HERO (BANNER PRINCIPAL)
   La primera sección visible con fondo de imagen + gradiente.
   Enlazado con: index.html → .hero, .contenido-hero
   ================================================================= */
.hero {
    background:
        linear-gradient(135deg, rgba(0, 45, 92, 0.92), rgba(0, 61, 122, 0.85)),
        url('https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--blanco);
    padding: 100px 0 80px;
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Contenedor de partículas decorativas (generadas con JS) */
.hero-particulas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particula {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: flotar 15s infinite ease-in-out;
}

@keyframes flotar {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-40px) rotate(180deg); opacity: 0.7; }
}

.contenido-hero {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

/* Badge/etiqueta encima del título */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 25px;
    backdrop-filter: blur(4px);
}

.hero-badge i {
    color: var(--acento);
}

.contenido-hero h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}

.contenido-hero p {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    max-width: 650px;
    margin: 0 auto 35px;
    opacity: 0.92;
    line-height: 1.8;
}

.hero-botones {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}


/* =================================================================
   8. SECCIÓN ESTADÍSTICAS (CONTADORES)
   Banda de números clave con contadores animados.
   Enlazado con: index.html → .estadisticas, .stat-numero
   Los contadores se animan con: script.js → animarContadores()
   ================================================================= */
.estadisticas {
    background: linear-gradient(135deg, var(--primario), var(--primario-oscuro));
    padding: 50px 0;
    position: relative;
}

.estadisticas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}

.stat-item {
    color: var(--blanco);
    padding: 20px;
    position: relative;
}

/* Separador vertical entre stats (excepto el último) */
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: rgba(255, 255, 255, 0.15);
}

.stat-icono {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--acento);
}

.stat-numero {
    font-family: var(--fuente-titulos);
    font-size: 2.8rem;
    font-weight: 800;
    display: inline;
}

.stat-simbolo {
    font-family: var(--fuente-titulos);
    font-size: 2rem;
    font-weight: 700;
    color: var(--acento);
}

.stat-item p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 5px;
    color: var(--blanco);
}


/* =================================================================
   9. SECCIÓN SERVICIOS
   Grid de tarjetas con los servicios de la agencia.
   Cada tarjeta tiene animación de entrada al scroll.
   Enlazado con: index.html → .servicios, .tarjeta-servicio
   ================================================================= */
.servicios {
    padding: 80px 0;
    background: var(--claro);
}

.grid-servicios {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.tarjeta-servicio {
    background: var(--blanco);
    border-radius: var(--radio-lg);
    padding: 35px 30px;
    text-align: center;
    transition: var(--transicion);
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--gris-claro);
    position: relative;
    overflow: hidden;
}

/* Línea de color en la parte superior de la tarjeta */
.tarjeta-servicio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primario), var(--secundario));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.tarjeta-servicio:hover::before {
    transform: scaleX(1);
}

.tarjeta-servicio:hover {
    transform: translateY(-8px);
    box-shadow: var(--sombra-lg);
    border-color: transparent;
}

/* Círculo con ícono */
.tarjeta-icono {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 61, 122, 0.08), rgba(0, 61, 122, 0.04));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: var(--transicion);
}

.tarjeta-icono i {
    font-size: 1.8rem;
    color: var(--primario);
    transition: var(--transicion);
}

.tarjeta-servicio:hover .tarjeta-icono {
    background: var(--primario);
}

.tarjeta-servicio:hover .tarjeta-icono i {
    color: var(--blanco);
}

.tarjeta-servicio h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--oscuro);
}

.tarjeta-servicio p {
    font-size: 0.92rem;
    color: var(--gris);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Enlace "Más información" al final de cada tarjeta */
.tarjeta-enlace {
    font-family: var(--fuente-titulos);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primario);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transicion);
}

.tarjeta-enlace:hover {
    color: var(--secundario);
    gap: 10px; /* La flecha se aleja al hacer hover */
}


/* =================================================================
   10. SECCIÓN NOSOTROS
   Dos columnas: texto con ventajas | imagen con badge flotante.
   Enlazado con: index.html → .nosotros, .contenido-nosotros
   ================================================================= */
.nosotros {
    padding: 80px 0;
    background: var(--blanco);
}

.contenido-nosotros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.texto-nosotros .subtitulo {
    text-align: left;
}

.texto-nosotros h2 {
    font-size: 2rem;
    color: var(--primario);
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.texto-nosotros h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--secundario);
    border-radius: 2px;
}

.texto-nosotros p {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--gris-oscuro);
}

/* Lista de ventajas con íconos de check */
.ventajas-lista {
    margin: 25px 0;
    display: grid;
    gap: 12px;
}

.ventaja-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--oscuro);
}

.ventaja-item i {
    color: #28a745; /* Verde check */
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Imagen con posición relativa para el badge */
.imagen-nosotros {
    position: relative;
    border-radius: var(--radio-lg);
    overflow: hidden;
}

.imagen-nosotros img {
    width: 100%;
    border-radius: var(--radio-lg);
    box-shadow: var(--sombra-lg);
    transition: transform 0.5s ease;
}

.imagen-nosotros:hover img {
    transform: scale(1.03);
}

/* Badge flotante "15+ Años" sobre la imagen */
.badge-experiencia {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--primario);
    color: var(--blanco);
    padding: 15px 20px;
    border-radius: var(--radio);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--sombra-lg);
}

.badge-numero {
    font-family: var(--fuente-titulos);
    font-size: 2rem;
    font-weight: 800;
    color: var(--acento);
    line-height: 1;
}

.badge-texto {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* =================================================================
   11. SECCIÓN ¿POR QUÉ ELEGIRNOS?
   Fondo oscuro con tarjetas de razones diferenciales.
   Enlazado con: index.html → .por-que, .razon-item
   ================================================================= */
.por-que {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primario-oscuro), var(--primario));
    position: relative;
}

.razones-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.razon-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radio-lg);
    padding: 35px 25px;
    text-align: center;
    transition: var(--transicion);
    backdrop-filter: blur(4px);
}

.razon-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.razon-icono {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: rgba(240, 180, 41, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.razon-icono i {
    font-size: 1.5rem;
    color: var(--acento);
}

.razon-item h3 {
    font-size: 1.1rem;
    color: var(--blanco);
    margin-bottom: 10px;
}

.razon-item p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
}


/* =================================================================
   12. SECCIÓN TESTIMONIOS (CARRUSEL)
   Carrusel horizontal con opiniones de clientes.
   Controlado por: script.js → iniciarCarruselTestimonios()
   Enlazado con: index.html → .testimonios, .testimonio-card
   ================================================================= */
.testimonios {
    padding: 80px 0;
    background: var(--claro);
}

.testimonios-carrusel {
    position: relative;
    overflow: hidden;
    padding: 0 50px;
}

.testimonios-track {
    display: flex;
    transition: transform 0.5s ease;
}

.testimonio-card {
    min-width: 100%;
    padding: 40px;
    background: var(--blanco);
    border-radius: var(--radio-lg);
    box-shadow: var(--sombra-sm);
    border: 1px solid var(--gris-claro);
    margin: 0 10px;
}

.testimonio-estrellas {
    margin-bottom: 15px;
    color: var(--acento);
    font-size: 1rem;
    display: flex;
    gap: 3px;
}

.testimonio-texto {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--gris-oscuro);
    line-height: 1.8;
    margin-bottom: 25px;
    position: relative;
    padding-left: 25px;
}

/* Comilla decorativa */
.testimonio-texto::before {
    content: '"';
    font-family: Georgia, serif;
    font-size: 3rem;
    color: var(--primario);
    opacity: 0.2;
    position: absolute;
    left: 0;
    top: -10px;
    line-height: 1;
}

.testimonio-autor {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Círculo con iniciales del cliente */
.testimonio-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primario), var(--primario-claro));
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.testimonio-autor h4 {
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--oscuro);
}

.testimonio-autor span {
    font-size: 0.82rem;
    color: var(--gris);
}

/* Botones de navegación del carrusel */
.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--gris-claro);
    background: var(--blanco);
    color: var(--primario);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transicion);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carrusel-btn:hover {
    background: var(--primario);
    color: var(--blanco);
    border-color: var(--primario);
}

.carrusel-prev { left: 0; }
.carrusel-next { right: 0; }

/* Indicadores (dots) debajo del carrusel */
.carrusel-indicadores {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.carrusel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gris-claro);
    border: none;
    cursor: pointer;
    transition: var(--transicion);
    padding: 0;
}

.carrusel-dot.activo {
    background: var(--primario);
    width: 30px;
    border-radius: 5px;
}


/* =================================================================
   13. SECCIÓN CTA (LLAMADA A LA ACCIÓN)
   Banda con fondo degradado que invita a contactar.
   Enlazado con: index.html → .cta
   ================================================================= */
.cta {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--secundario), var(--secundario-claro));
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Patrón decorativo sutil en el fondo */
.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E");
}

.cta-contenido {
    position: relative;
    z-index: 1;
}

.cta-contenido h2 {
    font-size: 2rem;
    color: var(--blanco);
    margin-bottom: 15px;
}

.cta-contenido p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
}

.cta-botones {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}


/* =================================================================
   14. SECCIÓN CONTACTO Y FORMULARIO
   Enlazado con: index.html → .contacto, .formulario-contacto
   El formulario se valida con: script.js → manejarFormulario()
   ================================================================= */
.contacto {
    padding: 80px 0;
    background: var(--blanco);
}

.contenedor-contacto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

/* --- Columna de información de contacto --- */
.info-contacto h3,
.formulario-contacto h3 {
    font-size: 1.4rem;
    color: var(--primario);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gris-claro);
}

.item-contacto {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 22px;
}

.item-contacto-icono {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 61, 122, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-contacto-icono i {
    color: var(--primario);
    font-size: 1rem;
}

.item-contacto h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--oscuro);
}

.item-contacto p {
    font-size: 0.92rem;
    color: var(--gris);
    line-height: 1.6;
}

.item-contacto a {
    color: var(--gris);
}

.item-contacto a:hover {
    color: var(--primario);
}

/* --- Redes sociales --- */
.enlaces-sociales {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.enlaces-sociales a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primario);
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transicion);
}

.enlaces-sociales a:hover {
    background: var(--secundario);
    transform: translateY(-4px);
    box-shadow: var(--sombra-md);
}

/* --- Formulario --- */
.formulario-contacto {
    position: relative;
}

.fila-formulario {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grupo-formulario {
    margin-bottom: 18px;
}

.grupo-formulario label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--oscuro);
    margin-bottom: 6px;
    font-family: var(--fuente-titulos);
}

.grupo-formulario input,
.grupo-formulario textarea,
.grupo-formulario select {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--gris-claro);
    border-radius: var(--radio);
    font-family: var(--fuente-cuerpo);
    font-size: 0.95rem;
    color: var(--oscuro);
    background: var(--blanco);
    transition: var(--transicion);
    outline: none;
}

.grupo-formulario input:focus,
.grupo-formulario textarea:focus,
.grupo-formulario select:focus {
    border-color: var(--primario);
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

/* Estado de error del campo */
.grupo-formulario input.error,
.grupo-formulario textarea.error {
    border-color: var(--secundario);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-mensaje {
    display: block;
    font-size: 0.8rem;
    color: var(--secundario);
    margin-top: 4px;
    min-height: 1em;
}

.grupo-formulario textarea {
    resize: vertical;
    min-height: 120px;
}

.grupo-formulario select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Botón de enviar con estados de carga y éxito */
.btn-enviar {
    width: 100%;
    justify-content: center;
}

/* Mensaje de éxito después de enviar */
.mensaje-exito {
    text-align: center;
    padding: 40px;
    background: rgba(40, 167, 69, 0.05);
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: var(--radio-lg);
    margin-top: 20px;
}

.mensaje-exito i {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 15px;
}

.mensaje-exito h4 {
    font-size: 1.2rem;
    color: #28a745;
    margin-bottom: 8px;
}

.mensaje-exito p {
    color: var(--gris);
    font-size: 0.95rem;
}

/* --- Mapa --- */
.mapa-contenedor {
    border-radius: var(--radio-lg);
    overflow: hidden;
    box-shadow: var(--sombra-md);
}

.mapa-contenedor iframe {
    display: block;
}


/* =================================================================
   15. BOTÓN FLOTANTE WHATSAPP
   Siempre visible en la esquina inferior derecha con animación.
   Enlazado con: index.html → .whatsapp-flotante
   ================================================================= */
.whatsapp-flotante {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-flotante a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: var(--blanco);
    border-radius: 50%;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: var(--transicion);
    position: relative;
    z-index: 2;
}

.whatsapp-flotante a:hover {
    background: #128C7E;
    transform: scale(1.1);
}

/* Animación de pulso alrededor del botón */
.whatsapp-flotante a::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: pulso-whatsapp 2s infinite;
    z-index: -1;
}

@keyframes pulso-whatsapp {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Tooltip "¿Necesita ayuda?" */
.whatsapp-tooltip {
    background: var(--blanco);
    color: var(--oscuro);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: var(--sombra-md);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transicion);
    pointer-events: none;
    position: absolute;
    right: 70px;
}

.whatsapp-flotante:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}


/* =================================================================
   16. BOTÓN VOLVER ARRIBA
   Aparece al hacer scroll. Controlado por script.js.
   Enlazado con: index.html → #btnSubir
   Controlado por: script.js → manejarBotonSubir()
   ================================================================= */
.btn-subir {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primario);
    color: var(--blanco);
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transicion);
    box-shadow: var(--sombra-md);
    z-index: 997;
}

.btn-subir.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-subir:hover {
    background: var(--primario-claro);
    transform: translateY(-3px);
}


/* =================================================================
   17. FOOTER (PIE DE PÁGINA)
   4 columnas con información general.
   Enlazado con: index.html → footer, .contenido-footer
   ================================================================= */
footer {
    background: var(--primario-oscuro);
    color: rgba(255, 255, 255, 0.85);
    padding: 60px 0 0;
}

.contenido-footer {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.footer-logo h3 {
    color: var(--blanco);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.columna-footer h3 {
    font-size: 1.1rem;
    color: var(--blanco);
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

/* Línea dorada debajo del título del footer */
.columna-footer h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background: var(--acento);
    border-radius: 2px;
}

.columna-footer > p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* Redes sociales en el footer */
.footer-sociales {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.footer-sociales a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--blanco);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: var(--transicion);
}

.footer-sociales a:hover {
    background: var(--acento);
    color: var(--primario-oscuro);
    transform: translateY(-3px);
}

/* Enlaces del footer */
.enlaces-footer {
    list-style: none;
}

.enlaces-footer li {
    margin-bottom: 10px;
}

.enlaces-footer a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transicion);
}

.enlaces-footer a i {
    font-size: 0.6rem;
    color: var(--acento);
}

.enlaces-footer a:hover {
    color: var(--blanco);
    padding-left: 4px;
}

/* Items de contacto en el footer */
.footer-contacto-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.footer-contacto-item i {
    color: var(--acento);
    margin-top: 3px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.footer-contacto-item a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-contacto-item a:hover {
    color: var(--blanco);
}

/* Copyright */
.copyright {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
}

.copyright p {
    margin-bottom: 3px;
}


/* =================================================================
   18. ANIMACIONES (SCROLL REVEAL)
   Las clases .animar-entrada se agregan en el HTML a los elementos
   que deben animarse. El JS los detecta con IntersectionObserver.
   Enlazado con: script.js → iniciarAnimacionesScroll()
   ================================================================= */
.animar-entrada {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animar-entrada.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variante: entrada desde la izquierda */
.animar-izquierda {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animar-izquierda.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Variante: entrada desde la derecha */
.animar-derecha {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animar-derecha.visible {
    opacity: 1;
    transform: translateX(0);
}


/* =================================================================
   19. MEDIA QUERIES (RESPONSIVE)
   Adapta el diseño a diferentes tamaños de pantalla.
   Los breakpoints estándar son:
   - < 1200px → Desktop pequeño
   - < 992px  → Tablet landscape
   - < 768px  → Tablet portrait / Móvil grande
   - < 576px  → Móvil pequeño
   - < 400px  → Móvil muy pequeño
   ================================================================= */

/* --- TABLET LANDSCAPE (< 992px) --- */
@media (max-width: 992px) {
    .top-bar {
        display: none; /* Se oculta la barra superior */
    }

    .estadisticas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item:nth-child(2)::after {
        display: none;
    }

    .grid-servicios {
        grid-template-columns: repeat(2, 1fr);
    }

    .contenido-nosotros {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .razones-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contenedor-contacto {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contenido-footer {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* --- TABLET PORTRAIT / MÓVIL GRANDE (< 768px) --- */
@media (max-width: 768px) {
    /* Header: muestra el botón hamburguesa */
    .boton-menu-movil {
        display: flex;
    }

    /* Menú se convierte en panel lateral (drawer) */
    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--blanco);
        flex-direction: column;
        padding: 80px 30px 30px;
        box-shadow: var(--sombra-lg);
        transition: left 0.35s ease;
        z-index: 1000;
        overflow-y: auto;
        gap: 0;
    }

    .nav-links.activo {
        left: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 14px 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--gris-claro);
        border-radius: 0;
    }

    .nav-link.activo::after {
        display: none;
    }

    /* Overlay del menú */
    .overlay-menu {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .overlay-menu.activo {
        display: block;
        opacity: 1;
    }

    /* Hero */
    .hero {
        padding: 70px 0 60px;
        min-height: 60vh;
        background-attachment: scroll; /* Quita parallax en móvil */
    }

    .hero-botones {
        flex-direction: column;
        align-items: center;
    }

    .hero-botones .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    /* Estadísticas */
    .stat-numero {
        font-size: 2.2rem;
    }

    .stat-item::after {
        display: none !important;
    }

    /* Servicios */
    .grid-servicios {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Razones */
    .razones-grid {
        grid-template-columns: 1fr;
    }

    /* Formulario */
    .fila-formulario {
        grid-template-columns: 1fr;
    }

    /* Logo */
    .logo-img {
        height: 38px;
        max-width: 130px;
    }

    .logo h1 {
        font-size: 1.15rem;
    }

    /* WhatsApp */
    .whatsapp-flotante a {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .whatsapp-tooltip {
        display: none;
    }

    /* Testimonios */
    .testimonios-carrusel {
        padding: 0 10px;
    }

    .carrusel-btn {
        display: none;
    }

    .testimonio-card {
        padding: 25px 20px;
    }
}

/* --- MÓVIL PEQUEÑO (< 576px) --- */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 50px 0 40px;
        min-height: auto;
    }

    .contenido-hero h2 {
        font-size: 1.7rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .servicios,
    .nosotros,
    .contacto,
    .testimonios {
        padding: 50px 0;
    }

    .por-que,
    .cta {
        padding: 50px 0;
    }

    .estadisticas-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-numero {
        font-size: 1.8rem;
    }

    .titulo-seccion h2 {
        font-size: 1.6rem;
    }

    .contenido-footer {
        grid-template-columns: 1fr;
    }

    .item-contacto {
        flex-direction: row;
    }

    .btn-subir {
        width: 42px;
        height: 42px;
        bottom: 20px;
        left: 20px;
    }

    .whatsapp-flotante {
        bottom: 20px;
        right: 20px;
    }
}

/* --- MÓVIL MUY PEQUEÑO (< 400px) --- */
@media (max-width: 400px) {
    .logo h1 {
        display: none; /* Solo muestra la imagen del logo */
    }

    .logo-img {
        height: 32px;
    }

    .contenido-hero h2 {
        font-size: 1.4rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 14px;
    }

    .estadisticas-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-item {
        padding: 15px 10px;
    }

    .stat-numero {
        font-size: 1.5rem;
    }
}
