:root {
    --primary-color: #005a7d;
    --secondary-color: #0084b5;
    --dark-color: #222;
    --light-bg: #f4f7f6;
    --white: #ffffff;
    --whatsapp-color: #25d366;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: var(--light-bg);
    line-height: 1.6;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Detrás del contenido pero visible */
}

/* --- NAVBAR --- */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    position: relative; /* Para que esté sobre el canvas */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    position: relative;
    font-weight: 600;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-menu a:hover {
    color: var(--primary-color);
}
.nav-menu a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- HERO SECTION CON CARRETE DE IMÁGENES --- */
/* --- HERO SECTION CON CARRETE DE IMÁGENES --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px;
    min-height: 65vh;
    position: relative;
    overflow: hidden;
    background-color: #222;
    
    /* --- REGLAS PARA QUE LA IMAGEN OCUPE EL 100% --- */
    background-size: cover;      /* Escala la imagen para cubrir el 100% del espacio sin deformarse */
    background-repeat: no-repeat; /* Evita que se formen mosaicos o cuadros repetidos */
    background-position: center;  /* Centra la imagen perfectamente */
    
    /* Suaviza el cambio entre una imagen y otra */
    transition: background-image 0.8s ease-in-out; 
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* La animación se controlará por JS para sincronizar con el texto */
    transition: background-image 1s ease-in-out;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 40, 60, 0.65);
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    position: relative; /* Ya es relativo, está bien */
    z-index: 4;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--white);
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-content h1, .hero-content p {
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}
.is-hidden {
    opacity: 0;
    transform: translateY(15px);
}
.hero p {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* --- SECCIONES GENERALES --- */
section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* Para que esté sobre el canvas */
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 10px auto 0 auto;
    border-radius: 2px;
}

/* --- SERVICIOS (GRILLA ESCRITORIO) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--white);
    padding: 40px 30px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid transparent;

    /* Estilos para la animación de aparición */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 90, 125, 0.15);
    border-color: var(--secondary-color);
    background-color: #f8feff;
}

.service-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.service-card:hover i {
    color: var(--primary-color);
    transform: scale(1.15);
}

.service-card h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 15px;
}

.service-card p {
    color: #666;
    font-size: 1rem;
    flex-grow: 1;
}

/* --- QUIÉNES SOMOS --- */
.about-container {
    max-width: 800px; /* Limitamos el ancho para mejor legibilidad */
    margin: 0 auto;
    text-align: center;
}
.about-content {
    text-align: center; /* Centramos todo el contenido */
}

.about-content h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.about-content p {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.1rem; /* Aumentamos ligeramente el tamaño para mejor legibilidad */
    line-height: 1.7;
    text-align: center; /* Centrado por defecto */
}

.about-content p.text-justify {
    text-align: justify; /* Justifica los párrafos largos para mejor lectura */
}

.about-values {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.value-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.value-item i {
    font-size: 1.8rem;
    color: var(--primary-color);
    background-color: #eef5f8;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: background-color 0.3s, color 0.3s;
}

.value-item:hover i {
    background-color: var(--primary-color);
    color: var(--white);
}

.value-item p {
    margin: 0;
    color: #444;
    font-size: 1rem;
    line-height: 1.5;
}
.value-item p strong {
    color: var(--dark-color);
    display: block;
    margin-bottom: 5px;
}

/* --- CONTACTO / FORMULARIO --- */
.contact-container {
    background-color: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    background-color: #f8f9fa;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    border-color: var(--secondary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(0, 132, 181, 0.15);
}

.btn-submit {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: var(--secondary-color);
}

/* --- BOTÓN FLOTANTE DE WHATSAPP --- */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: var(--whatsapp-color);
    color: var(--white);
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s, background-color 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    background-color: #20ba5a;
}

/* --- VISUAL DEL FOOTER --- */
footer {
    background: linear-gradient(135deg, #aedae7 0%, #cbdfe6 100%);
    padding: 60px 20px 30px 20px;
    color: #1e4e60;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
    text-align: center;
}

.footer-column:first-child {
    text-align: center;
}

footer .footer-logo {
    width: 20%;
    height: 20%;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
    filter: contrast(1.2);
    margin: 0 auto 20px; /* Centra el logo dentro de su contenedor */
}

.footer-description {
    color: #2b5b6e;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 10px;
}

footer h3 {
    font-size: 1.25rem;
    color: #0b3f52;
    margin-bottom: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    position: relative;
}

.footer-info-list, .footer-links-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-info-list li {
    font-size: 0.95rem;
    color: #1e4e60;
    margin-bottom: 14px;
    display: flex;
    justify-content: center; /* Centra los íconos y el texto */
}

.footer-info-list i {
    color: #105e7a;
    margin-right: 12px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.footer-links-list li {
    margin-bottom: 12px;
}

.footer-links-list a {
    color: #1e4e60;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-block;
    transition: all 0.25s ease;
}

.footer-links-list a:hover {
    color: #105e7a;
    transform: translateX(4px);
}

.footer-divider {
    border: 0;
    border-top: 1px solid rgba(16, 94, 122, 0.15);
    margin: 40px auto 25px auto;
    max-width: 1200px;
}

footer p.footer-copy {
    color: #5c7e8c;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 400;
}

@keyframes aparecer {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- RESPONSIVO --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    section {
        padding: 50px 20px;
    }

    /* --- CONVERSIÓN CRÍTICA A CARRETE HORIZONTAL DESLIZABLE --- */
    .services-grid {
        display: flex; /* Cambia de cuadrícula a fila continua */
        overflow-x: auto; /* Permite el scroll horizontal */
        scroll-snap-type: x mandatory; /* Bloquea el carrete tarjeta por tarjeta */
        scroll-behavior: smooth;
        gap: 20px;
        padding: 20px 10px;
        scrollbar-width: none; /* Oculta la barra de scroll molesta en Firefox */
    }

    .services-grid::-webkit-scrollbar {
        display: none; /* Oculta la barra de scroll molesta en Chrome/Safari */
    }

    .service-card {
        flex: 0 0 85%; /* Hace que cada tarjeta ocupe el 85% de la pantalla */
        scroll-snap-align: center; /* Alinea la tarjeta en el centro al deslizar */
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
    .footer-container {
        text-align: center;
        gap: 30px;
    }
    .footer-info-list li {
        justify-content: center;
    }
}