/* Paleta de colores extraída de la imagen */
:root {
    --primary-dark: #2B3A42;
    --secondary-light: #E0EBF2;
    --accent-warm: #E6B09B;
    --text-light: #F0F5F8;
    --text-dark: #3C4F59;
    --bg-neutral: #8DA9BC;
    --glass-bg: rgba(43, 58, 66, 0.7);
    --shadow-color: rgba(0, 0, 0, 0.25);
    --shadow-color-light: rgba(0, 0, 0, 0.1);
}

/* Base & Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--primary-dark);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Overlay para menú móvil */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001; /* Detrás del header y del panel */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.gradient-text {
    background: linear-gradient(90deg, var(--secondary-light), var(--accent-warm));
    -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1002; /* Encima del overlay */
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
    padding: 10px 0;
}

.header.scrolled {
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px var(--shadow-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-light);
    text-shadow: 2px 2px 5px var(--shadow-color);
    z-index: 1003; 
}

.nav-logo img{
    height: 60px;
}

/* --- ESTILOS "MOBILE FIRST" (POR DEFECTO) --- */

.menu-toggle {
    display: flex; 
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1004; /* Encima de todo en el header */
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Menú lateral deslizante (VERTICAL - POR DEFECTO) */
.nav-menu {
    position: fixed;
    top: 0;
    right: -300px; 
    width: 300px; 
    max-width: 80%;
    height: 100vh;
    background-color: var(--primary-dark);
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
    padding: 100px 40px 40px 40px;
    gap: 25px;
    z-index: 1003; /* Encima del header y del overlay */
    transition: transform 0.4s ease-out;
    box-shadow: -10px 0 30px var(--shadow-color);
}

.nav-menu.active {
    transform: translateX(-300px); 
}

.nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 25px;
}

.nav-item {
    text-align: left;
    width: 100%;
}
.nav-item a {
    font-size: 1.2em;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}
.nav-item a:hover {
    color: var(--accent-warm);
}

.lang-switcher {
    margin: 10px 0; 
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--text-light);
    border-radius: 5px;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.lang-switcher:hover {
    background-color: var(--accent-warm);
    color: var(--primary-dark);
    border-color: var(--accent-warm);
}


/* --- ESTILOS DE ESCRITORIO (min-width: 769px) --- */

@media (min-width: 769px) {
    .menu-toggle {
        display: none; 
    }

    .nav-menu {
        position: static;
        top: auto;
        right: auto;
        width: auto;
        max-width: none;
        height: auto;
        background-color: transparent;
        flex-direction: row; 
        align-items: center;
        padding: 0;
        gap: 30px;
        z-index: auto; 
        transition: none;
        box-shadow: none;
        transform: none !important; 
    }

    .nav-menu.active {
        transform: none; 
    }

    .nav-links {
        flex-direction: row; 
        width: auto;
        gap: 30px;
    }

    .nav-item {
        width: auto;
    }
    .nav-item a {
        font-size: 1em; 
    }

    .nav-item a::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 0;
        height: 2px;
        background: var(--accent-warm);
        transition: width 0.3s ease;
    }
    .nav-item a:hover::after {
        width: 100%;
    }


    .lang-switcher {
        margin: 0 0 0 20px; 
    }

    .overlay.active {
        opacity: 0;
        visibility: hidden;
    }
}


/* Hero Section */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--primary-dark);
}

.hero-overlay {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); 
    z-index: 2; 
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bg.webp');
    background-size: cover;
    background-position: center 87%;
    will-change: transform;
    z-index: 1; 
    filter: brightness(0.8) contrast(1.1);
}

.hero-content {
    position: relative;
    justify-content: center;
    align-items: center;
    z-index: 3; 
    color: var(--text-light);
    text-shadow: 3px 3px 10px var(--shadow-color);
}

.hero-logo {
    display: block; /* Convertir en bloque para centrar */
    font-size: 5em;
    font-weight: 700;
    margin: 0 auto 20px auto; /* Centrar horizontalmente y añadir margen inferior */
    letter-spacing: 2px;
    animation: fadeInScale 1.5s ease-out forwards;
    max-width: 500px; /* Limitar el ancho máximo para que no se estire demasiado */
}

.hero-logo img {
    max-width: 100%;
    max-height: 250px; /* Tamaño ideal para desktops */
}


.hero-tagline {
    font-size: 1.5em;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 40px;
    animation: fadeIn 2s ease-out 0.5s forwards;
    opacity: 0;
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-light);
    font-size: 0.9em;
    letter-spacing: 1px;
    opacity: 0.8;
    animation: bounce 2s infinite, fadeIn 2s ease-out 1s forwards;
    opacity: 0;
    z-index: 3;
}

.scroll-down::after {
    content: '↓';
    display: block;
    font-size: 2em;
    margin-top: 5px;
}

/* General Section Styling */
.section {
    padding: 100px 0;
    position: relative;
    z-index: 5;
    background-color: var(--primary-dark);
    color: var(--text-light);
    /* --- NUEVA SOMBRA SUPERIOR --- */
    /* Sombra sutil en el borde superior para dar profundidad */
    box-shadow: 0 -10px 30px -15px rgba(0, 0, 0, 0.4);
}

.section:nth-of-type(even) {
    background-color: var(--bg-neutral);
    color: var(--text-dark);
}

.section-title {
    font-size: 3em;
    margin-bottom: 60px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    color: var(--text-light);
}

/* --- CORRECCIÓN DE CONTRASTE --- */
.section:nth-of-type(even) .section-title {
    color: var(--primary-dark); /* Color más oscuro para mejor contraste */
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-warm), var(--secondary-light));
    border-radius: 2px;
}

/* Section Fade-in Animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* About Us - Galería */
.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.about-text {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    font-size: 1.1em;
    line-height: 1.8;
    text-align: left;
}

.about-gallery {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    grid-template-areas:
        "main thumb1"
        "main thumb2";
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--shadow-color-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px var(--shadow-color);
}
.img-main { grid-area: main; }
.img-thumb1 { grid-area: thumb1; }
.img-thumb2 { grid-area: thumb2; }


/* Services - Imágenes */
.services-slider {
    width: 100%;
    padding-top: 20px;
    padding-bottom: 50px; /* Espacio para la paginación */
}

.swiper-slide {
    height: auto; /* Permite que las tarjetas crezcan si el contenido es diferente */
}

.service-card {
    background-color: var(--primary-dark);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    height: 100%; /* Asegura que todas las tarjetas en una vista tengan la misma altura */
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer; 
}

.section:nth-of-type(even) .service-card {
     background-color: var(--text-light);
     color: var(--text-dark);
     box-shadow: 0 10px 30px var(--shadow-color-light);
     border: 1px solid rgba(0, 0, 0, 0.1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--accent-warm), var(--secondary-light));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.service-card:hover::before {
    opacity: 0.1;
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 40px var(--shadow-color);
}

.service-img-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px auto;
    box-shadow: 0 5px 15px var(--shadow-color-light);
    border: 3px solid var(--accent-warm);
    z-index: 2;
    background: var(--primary-dark); 
}
.section:nth-of-type(even) .service-img-wrapper {
     border-color: var(--primary-dark);
}


.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.service-card:hover .service-img {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

.service-card p {
    font-size: 1em;
    line-height: 1.7;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Estilos para la paginación de Swiper */
.swiper-pagination-bullet {
    background-color: var(--text-light);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background-color: var(--accent-warm);
    opacity: 1;
}

/* Contact */
.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: center;
    color: inherit;
}

.contact-info {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
}

.section:nth-of-type(even) .contact-info {
    background: linear-gradient(90deg, var(--accent-warm), var(--secondary-light));
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-dark);
}

.contact-info h3 {
    font-size: 2em;
    margin-bottom: 25px;
    font-weight: 600;
    color: var(--accent-warm);
}
.section:nth-of-type(even) .contact-info h3 {
    color: var(--primary-dark);
}

.contact-info p {
    font-size: 1.1em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-info p i {
    font-size: 1.5em;
    color: var(--secondary-light);
}
.section:nth-of-type(even) .contact-info p i {
    color: var(--primary-dark);
}

.contact-map {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color-light);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(100%) contrast(1.2) opacity(0.8);
}

/* Modal Styling */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); 
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--primary-dark);
    color: var(--text-light);
    border-radius: 15px;
    box-shadow: 0 10px 40px var(--shadow-color);
    width: 100%;
    max-width: 900px;
    max-height: 90vh; 
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-bg);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-container.active .modal {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5em; 
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    z-index: 10;
    transition: color 0.2s ease;
}
.modal-close-btn:hover {
    color: var(--accent-warm);
}

.modal-content {
    display: flex;
    width: 100%;
    height: 100%;
    max-height: 90vh; 
}

.modal-img {
    flex: 1;
    min-width: 40%;
    object-fit: cover;
    display: block;
}

.modal-text {
    flex: 1.5; 
    padding: 40px;
    overflow-y: auto; 
}

.modal-title {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--accent-warm);
    margin-bottom: 20px;
}

.modal-description {
    font-size: 1.1em;
    line-height: 1.8;
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 40px 0;
    border-top: 1px solid var(--glass-bg);
    font-size: 0.9em;
    opacity: 0.8;
}

.footer-content {
    display: flex;
    flex-direction: column; /* Apilado en móvil por defecto */
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

/* Contenedor para los logos de socios */
.partner-logos {
    display: flex; /* En escritorio, volvemos a flex para una sola fila */
    gap: 20px; /* Espacio entre logos */
    align-items: center;
    justify-content: center;
}

.partner-logo {
    height: 50px; /* Aumentamos un poco el tamaño para mejor visibilidad */
    width: auto;
    padding: 0px 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.partner-logo:hover {
    opacity: 1;
}

.copyright {
    margin: 0; /* Reseteamos el margen por si acaso */
}




/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive del Modal y Galería */
@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2.2em;
        margin-bottom: 40px;
    }

    /* Galería About en móvil */
    .about-gallery {
        grid-template-areas:
            "main main"
            "thumb1 thumb1"
            "thumb2 thumb2";
        gap: 5px; /* Reducimos el espacio entre imágenes */
    }

    .gallery-img {
        height: 60%;
    }

    /* Logos del footer en escritorio */
    .partner-logos {
        gap: 25px;
        display: grid; /* Por defecto (móvil), usamos una grilla de 2 columnas */
        grid-template-columns: repeat(2, auto); /* Crea 2 columnas */
    }

    .about-text, .contact-info {
        font-size: 1em;
        padding: 30px;
    }

    .service-card {
        padding: 25px;
    }

    .service-card h3 {
        font-size: 1.5em;
    }

    .contact-info p {
        font-size: 1em;
    }

    .contact-map {
        height: 300px;
    }

    /* --- Modal Responsivo --- */
    .modal-content {
        flex-direction: column; /* Imagen arriba, texto abajo */
    }

    .modal-img {
        min-width: 100%;
        max-height: 250px; /* Altura fija para la imagen en móvil */
    }

    .modal-text {
        padding: 30px; /* Menos padding en móvil */
    }

    .modal-title {
        font-size: 2em; /* Título más pequeño en móvil */
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .hero-logo,
    .hero-tagline,
    .scroll-down,
    .fade-in,
    .service-card,
    .gallery-img,
    .modal-container .modal {
        animation: none !important;
        transition: none !important;
    }
}

/* Menu Toggle Animation */
.menu-toggle.active span {
    background-color: var(--text-light); 
}
.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}