@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

/* ================================ */
/* === VARIABLES Y ESTILOS BASE === */
/* ================================ */

:root {
    --background: linear-gradient(135deg, #7fa8ee77 0%, #2d2f35 100%);
    --padding-container: 80px 0;
    --boton-padding: 20px 40px;
    --aling-title: center;
    --box-shadow: 0 0 12px rgba(0,0,0, .2);
}

html {
    scroll-behavior: smooth;
    /* !!! AJUSTA ESTE VALOR a la altura EXACTA de tu menú cuando está fijo (.sticky-nav) !!! */
    scroll-padding-top: 70px;
}

body {
    font-family: "Montserrat", sans-serif;
    margin: 0; /* Asegurar que no haya margen por defecto */
}

.container {
    width: 90%;
    max-width: 1200px; /* Ancho máximo general */
    margin: 0 auto; /* Centrado */
    padding-left: 15px; /* Padding lateral base */
    padding-right: 15px;
    box-sizing: border-box;
}

.title {
    font-size: 2.5rem;
    margin: 0 0 40px 0; /* Margen inferior */
    color: #06519b; /* Azul principal */
    text-align: var(--aling-title, center); /* Usa variable o centra por defecto */
    font-weight: bold; /* Asegurar negrita */
}

.text-white {
    color: #fff !important;
}

.text-center {
    text-align: center;
}

.sr-only { /* Para accesibilidad (labels ocultos) */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


/* ================================ */
/* ========= HEADER Y MENÚ ======== */
/* ================================ */

.hero {
    min-height: 100vh; /* Usar min-height es más flexible que height */
    background-image: var(--background), url(../corpo.jpeg); /* Reemplaza con tu ruta */
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed; /* Para efecto parallax desktop */
    background-position: center;
    position: relative;
    display: flex; /* Para centrar contenido si es necesario */
    flex-direction: column; /* Apila nav y contenido */
    color: #fff;
}

/* --- Barra de Navegación Principal --- */
#main-nav {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    padding: 10px 0;
    transition: padding 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
    display: flex; /* Para alinear .menu__container y .hamburger-btn */
    align-items: center;
}

.menu__container { /* Contenedor interno para centrar logo y menú */
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Padding lateral consistente */
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
}

.nav-logo { /* Logo/Nombre siempre visible */
    font-weight: bold;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    padding: 10px 0;
    flex-shrink: 0;
    margin-right: 20px;
}
.nav-logo.link::after { /* Quitar subrayado hover del logo */
    display: none;
}

.menu { /* Lista de enlaces (Menú Desktop) */
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu__titulos {
    margin: 0 10px;
    list-style: none;
}

.link { /* Estilo de enlaces del menú */
    text-decoration: none;
    font-weight: bold;
    padding: 10px 15px;
    color: #fff;
    position: relative;
    transition: color 0.3s ease;
}

/* Efecto subrayado hover */
.link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: #fff;
    transition: width 0.4s ease;
    -webkit-transition: width 0.4s ease;
}
.link:hover::after {
    width: 100%;
    left: 0;
}
.link:hover {
    color: #ddd;
}

/* Botón CTA en menú desktop */
.menu__items--cta {
    border: 1px solid #fff;
    border-radius: 50px; /* Más redondeado */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.menu__items--cta:hover {
    background-color: #fff;
    color: #06519b; /* Azul principal */
    transform: scale(1.05);
}
.menu__items--cta:hover::after {
    display: none; /* Quitar subrayado del CTA */
}

/* Botón Hamburguesa (Oculto en Desktop) */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1100;
}
.hamburger-btn .bx-x { display: none; }
.hamburger-btn.active .bx-menu { display: none; }
.hamburger-btn.active .bx-x { display: block; }

/* --- Estilos Menú Fijo (Sticky) --- */
#main-nav.sticky-nav {
    position: fixed;
    background-color: rgba(45, 47, 53, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 5px 0; /* Padding reducido */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideDownNav 0.5s ease-out forwards;
}

@keyframes slideDownNav {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Contenido Principal del Hero --- */
.hero__main.container {
    flex-grow: 1; /* Ocupa el espacio restante */
    display: flex; /* Para centrar hero__contenedor */
    align-items: center;
    justify-content: center; /* O 'flex-start' si prefieres alineado a la izq */
    padding-top: 80px; /* Espacio para el nav absoluto */
    padding-bottom: 100px; /* Espacio antes de la ola */
}

.hero__contenedor {
    width: 100%; /* Ocupa el ancho del container */
    max-width: 900px; /* Limita el ancho del texto */
    /* display: flex; Ya es flex */
    flex-direction: column;
    /* justify-content: center; Ya está centrado por el padre */
    text-align: center; /* Centrar texto por defecto */
}

.hero__titulo {
    font-size: 3.2rem;
    opacity: 0; /* Estado inicial para animación */
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s ease-out 0.1s forwards; /* Delay ligero */
    margin-bottom: 15px; /* Añadir margen */
}

.hero__subtitulo {
    font-size: 2rem;
    font-weight: 300;
    margin: 0 0 25px 0; /* Ajustar márgenes */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s ease-out 0.3s forwards; /* Delay */
}

.hero__cta {
    display: inline-block;
    background: #fff;
    padding: var(--boton-padding, 15px 35px); /* Padding más ajustado */
    color: #06519b;
    text-decoration: none;
    border-radius: 40px;
    font-weight: bold; /* Hacerlo bold */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s ease-out 0.5s forwards; /* Delay */
}
.hero__cta:hover {
    background-color: #eee;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.hero__social {
    margin-top: 30px; /* Más espacio */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 0.8s ease-out 0.7s forwards; /* Delay */
}

.hero__social a {
    text-decoration: none;
    color: #fff;
    font-size: 1.8rem; /* Iconos un poco más pequeños */
    margin: 0 8px; /* Espacio entre iconos */
    transition: color 0.3s ease, transform 0.3s ease;
}
.hero__social a:hover {
    transform: scale(1.1);
}
.red__insta:hover { color: #DD2A7B; } /* Color específico Instagram */

@keyframes fadeInSlideUp { /* Renombrado desde fadeInHero para claridad */
    to { opacity: 1; transform: translateY(0); }
}

.hero__wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden; /* Añadido por si acaso */
}
.hero__wave svg{
    display: block; /* Evita espacio extra debajo */
}


/* ================================ */
/* ======= SECCIÓN ABOUT US ======= */
/* ================================ */

.about.container { /* Añadimos .container aquí también */
    padding-top: var(--padding-container, 80px);
    padding-bottom: var(--padding-container, 80px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px; /* Espacio entre elementos al envolver */
}

.about__texts {
    width: 100%; /* Por defecto ocupan todo */
    max-width: 550px; /* Ancho máximo para el texto */
    --aling-title: left; /* Título alineado a la izquierda */
}
.about__texts .title { text-align: left; } /* Forzar alineación */

.about__paragraph {
    line-height: 1.6; /* Mejor interlineado */
    margin-bottom: 1em; /* Espacio entre párrafos */
}

.about__cta {
    display: inline-block;
    border-radius: 30px;
    color: #fff;
    text-decoration: none;
    margin-top: 20px;
    background: #069b0d; /* Verde */
    padding: 15px 35px; /* Ajustar padding */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.about__cta:hover {
    background-color: #058a0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0, 0.2);
}

.about__img {
    width: 100%; /* Por defecto ocupan todo */
    max-width: 450px; /* Ancho máximo para imagen */
    text-align: center;
    margin: 0;
}

.about__picture {
    max-width: 100%; /* Imagen se ajusta al contenedor */
    height: auto; /* Mantiene proporción */
    border-radius: 15px; /* Redondeado más sutil */
    display: block; /* Evita espacio extra */
}

.about__video {
    width: 100%;
    margin-top: 40px;
    text-align: center;
}

.about__mp4 {
    width: 100%; /* Ocupa el ancho disponible */
    max-width: 700px; /* Limita el ancho máximo */
    height: auto;
    border-radius: 15px; /* Consistente con imagen */
    display: block;
    margin: 0 auto;
}


/* ================================ */
/* === SECCIÓN NUESTRA HISTORIA === */
/* ================================ */

#nuestra-historia {
    padding: var(--padding-container, 80px) 0;
    background-color: #f8f9fa;
}

.historia-container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

#nuestra-historia h2 {
    /* Hereda estilo .title, podemos especificar si es diferente */
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #333;
}

.historia-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 50px;
}

.historia-timeline {
    position: relative;
    max-width: 800px; /* Limita ancho de la timeline en desktop */
    margin: 0 auto; /* Centra la timeline */
}
.historia-timeline::before { /* Línea Vertical */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: #dee2e6;
    transform: translateX(-50%);
    z-index: 1;
}

.historia-item {
    padding: 10px 0;
    position: relative;
    margin-bottom: 40px;
    width: 100%;
    box-sizing: border-box;
}
.historia-item::after { /* Clearfix */
    content: "";
    display: table;
    clear: both;
}

.historia-content {
    position: relative;
    width: calc(50% - 60px); /* Ancho panel (50% - MitadIcono - EspacioExtra) */
    box-sizing: border-box;
}
.historia-content.left { float: left; text-align: right; }
.historia-content.right { float: right; text-align: left; }

.content-inner { /* Caja de texto */
    background-color: #ffffff;
    padding: 25px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative; /* Para la flecha y posible ajuste 'right' */
}
/* --- Fix solapamiento texto izquierdo (Ajustar '40px' si es necesario) --- */
/* Si la solución fue usar position: relative; right: 40px; en .content-inner */
#nuestra-historia .historia-content.left .content-inner {
     position: relative;
     right: 40px; /* Mueve el contenido 40px a la izquierda */
}
/* --- Si se usó padding (descomentar si fue esa la solución): ---
#nuestra-historia .historia-content.left .content-inner {
    padding-right: 65px;
}
*/


.content-inner h3 {
    font-size: 1.4rem;
    color: #003366;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: bold;
}
.content-inner p {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Flechas */
.historia-content::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 0;
    height: 0;
    border-style: solid;
}
.historia-content.left::after {
    /* right: -15px;  Valor original */
    /* Si .content-inner se movió con right: 40px, ajustamos: */
    right: -55px; /* -15px - 40px */
    border-width: 15px 0 15px 15px;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(1px 0px 0px #e9ecef);
}
.historia-content.right::after {
    left: -15px; /* Esta no necesita ajuste extra */
    border-width: 15px 15px 15px 0;
    border-color: transparent #ffffff transparent transparent;
    filter: drop-shadow(-1px 0px 0px #e9ecef);
}

/* Icono Central */
.historia-icon {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translateX(-50%);
    width: 80px; /* Tamaño desktop aumentado */
    height: 80px;
    background-color: #ffffff;
    border: 4px solid #dee2e6;
    border-radius: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px #ffffff;
}
.historia-icon img {
    max-width: 85%; /* Imagen ocupa más espacio en el icono */
    max-height: 85%;
    border-radius: 50%;
    object-fit: contain;
}

/* ================================ */
/* ====== SECCIÓN SERVICIOS ======= */
/* ================================ */

#servicios {
    padding: var(--padding-container, 80px) 0;
    background-color: #ffffff; /* Fondo blanco para alternar */
}

.portfolio-container { /* Reusamos clases, pero aplicamos a #servicios */
    width: 90%;
    margin: auto;
    max-width: 1200px;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 40px; /* Más espacio */
}
.portfolio-header .portfolio-title { /* Hereda de .title */
    color: #333; /* Color oscuro en fondo claro */
}
.portfolio-header .portfolio-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
}

.portfolio-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centrar items en la fila */
    margin: -15px; /* Gap negativo */
}

.portfolio-item {
    width: calc(33.333% - 30px); /* 3 columnas con gap */
    margin: 15px; /* Gap */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Sombra más suave */
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden; /* Para overlay y zoom */
    border-radius: 8px; /* Redondear item */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.portfolio-image-wrapper {
    position: relative;
    overflow: hidden;
}
.portfolio-image {
    width: 100%;
    display: block;
    transition: transform 0.4s ease-out;
}
.portfolio-item:hover .portfolio-image {
     transform: scale(1.1); /* Zoom más sutil */
}

.portfolio-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(6, 81, 155, 0.7); /* Azul principal con opacidad */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay i {
    color: white;
    font-size: 2.5rem; /* Icono un poco más pequeño */
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s; /* Delay en aparecer */
}
.portfolio-item:hover .portfolio-overlay i {
    opacity: 1;
    transform: scale(1);
}

.portfolio-caption {
    padding: 20px 25px; /* Más padding */
    text-align: center;
    flex-grow: 1; /* Para que todos tengan misma altura si el texto varía */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.portfolio-caption h4 {
    margin-top: 0; /* Quitar margen superior */
    margin-bottom: 8px; /* Menos espacio */
    font-size: 1.1rem; /* Ligeramente más pequeño */
    color: #333;
}
.portfolio-text {
    color: #6c757d;
    font-size: 0.9rem; /* Ligeramente más pequeño */
    line-height: 1.4;
}


/* ================================ */
/* ======== ESTILOS MODALES ======= */
/* ================================ */

.ce-portfolio-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1050;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.75); /* Más oscuro */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    padding: 20px;
}
.ce-portfolio-modal.modal-active {
    opacity: 1;
    visibility: visible;
}

.ce-modal-content {
    background-color: #fefefe;
    margin: 0;
    padding: 35px 45px; /* Más padding */
    border: none;
    width: 90%;
    max-width: 650px;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    transform: scale(0.95) translateY(10px); /* Efecto entrada */
    opacity: 0;
    transition: opacity 0.3s ease-out 0.1s, transform 0.3s ease-out 0.1s;
}
.ce-portfolio-modal.modal-active .ce-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.ce-modal-close {
    color: #aaa;
    position: absolute;
    top: 15px; right: 20px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.ce-modal-close:hover,
.ce-modal-close:focus {
    color: #333;
    transform: scale(1.2);
}

.ce-modal-icon-image {
    display: block;
    width: 50px; /* Icono modal más pequeño */
    height: 50px;
    margin: 0 auto 15px auto; /* Menos margen inferior */
    object-fit: contain;
}

.ce-modal-title {
    font-size: 1.6rem; /* Título modal más pequeño */
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #06519b; /* Azul principal */
}

.ce-modal-text {
    color: #444; /* Texto un poco más oscuro */
    line-height: 1.7; /* Más interlineado */
    font-size: 1rem;
    margin-bottom: 25px;
    text-align: left;
}
.ce-modal-text li { /* Estilo para listas si las usas */
    margin-bottom: 0.5em;
}

.ce-modal-image {
    width: 100%;
    max-width: 450px; /* Imagen modal un poco más grande */
    height: auto;
    object-fit: cover;
    margin-top: 15px;
    border-radius: 8px; /* Redondeado consistente */
    display: block;
    margin-left: auto;
    margin-right: auto;
}


/* ================================ */
/* ==== SECCIÓN NUESTRAS OFICINAS ==== */
/* ================================ */

.oficinas {
    padding: var(--padding-container, 80px) 0;
    background-color: #ffffff; /* Fondo blanco */
}

.oficinas-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Padding lateral consistente */
    box-sizing: border-box;
}

.oficinas .title {
    text-align: center;
    margin-bottom: 1rem;
    color: #333; /* Título oscuro en fondo claro */
}

.oficinas .oficinas-subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 3rem; /* Más espacio */
}

.oficinas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem; /* Más espacio entre oficinas */
}

.oficina-item {
    border: 1px solid #eee; /* Borde más suave */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    display: flex; /* Usar flex para alinear contenido */
    flex-direction: column;
}

.oficina-mapa {
    height: 280px; /* Altura mapa ajustada */
    border-bottom: 1px solid #eee; /* Línea divisoria */
}
.oficina-mapa iframe {
    width: 100%; height: 100%; border: 0; display: block;
}

.oficina-info-wrapper { /* Nuevo div para agrupar texto y social */
    padding: 25px;
    text-align: center;
    flex-grow: 1; /* Ocupa espacio restante */
    display: flex;
    flex-direction: column;
}


.oficina-nombre {
    font-size: 1.25rem; /* Un poco más grande */
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.oficina-direccion {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.oficina-contacto-info {
    color: #555;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1; /* Empuja social links hacia abajo */
}
.oficina-contacto-info i {
    margin-right: 0.4rem;
    color: #06519b;
    vertical-align: middle; /* Alinear icono con texto */
}
.oficina-contacto-info a {
    color: #06519b; /* Enlaces en azul */
    text-decoration: none;
}
.oficina-contacto-info a:hover {
    text-decoration: underline;
}

.oficina-social {
    display: flex;
    justify-content: center;
    padding-top: 1rem; /* Espacio arriba */
    margin-top: auto; /* Empuja al final si .flex-grow está en contacto-info */
    /* border-top: 1px solid #eee; No necesario si info-wrapper tiene padding */
}
.oficina-social a {
    font-size: 1.6rem; /* Iconos social más grandes */
    color: #777; /* Gris más oscuro */
    margin: 0 0.6rem;
    transition: color 0.3s ease, transform 0.3s ease;
}
.oficina-social a:hover {
    color: #06519b;
    transform: scale(1.1);
}

.oficinas-cita-final {
    text-align: center;
    font-style: italic;
    color: #888;
    margin-top: 4rem; /* Más espacio arriba */
    padding: 0 15px;
    max-width: 700px; /* Limita ancho de la cita */
    margin-left: auto;
    margin-right: auto;
}


/* ================================ */
/* ===== SECCIÓN CLIENTES LOGOS ===== */
/* ================================ */

.clientes {
    padding: var(--padding-container, 80px) 0;
    background-color: #f8f9fa;
}

.clientes .title {
    text-align: center;
    margin-bottom: 3rem;
    color: #333; /* Título oscuro */
}

.logo-scroll-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    /* Efecto difuminado en bordes */
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
/* Quitar pseudo-elementos si se usa mask-image */
/* .logo-scroll-container::before, .logo-scroll-container::after { display: none; } */


.logo-scroll-track {
    display: flex;
    /* !!! AJUSTA ESTOS VALORES SEGÚN TUS LOGOS !!! */
    width: calc(200px * 8); /* (Ancho slide * Total Slides) */
    animation: scrollLogos 25s linear infinite; /* Duración más larga = más lento */
}
.logo-scroll-container:hover .logo-scroll-track {
    animation-play-state: paused;
}

.logo-slide {
    width: 200px; /* Ancho logo desktop */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px; /* Más espacio entre logos */
    box-sizing: content-box;
}

.logo-slide img {
    display: block;
    max-width: 100%;
    height: 60px; /* Altura logos desktop */
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6; /* Más sutil */
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.logo-slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scrollLogos {
    0% { transform: translateX(0); }
    100% {
        /* !!! AJUSTA ESTOS VALORES SEGÚN TUS LOGOS !!! */
        transform: translateX(calc(-200px * 4)); /* (-Ancho slide * Num Originales) */
    }
}

/* ================================ */
/* ======= SECCIÓN CONTACTO ======= */
/* ================================ */

.contacto-section {
    position: relative;
    padding: var(--padding-container, 80px) 0;
    overflow: hidden;
}

.contacto-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    /* Overlay oscuro sobre imagen */
    background:
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), /* Más oscuro */
        url('../contacta.png'); /* Reemplaza con tu ruta */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.contacto-container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px; /* Padding lateral consistente */
    box-sizing: border-box;
}

.contacto-section .title { /* Título "CONTÁCTANOS" */
    margin-bottom: 0.5rem;
    color: #fff !important; /* Forzar blanco */
    text-align: center;
    /* Aplicar contorno */
    -webkit-text-stroke-width: 1px;
    -webkit-text-stroke-color: rgba(0,0,0,0.7); /* Negro semitransparente */
    paint-order: stroke fill;
     /* Fallback con sombra */
    /* text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; */
}

.contacto-subtitle {
    margin-bottom: 3rem;
    font-size: 1rem;
    font-weight: 300;
    color: #ddd; /* Gris claro */
    text-align: center;
}

.contacto-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2rem; /* Gap vertical y horizontal */
}

.contacto-form .form-group {
    flex: 1;
    min-width: 250px;
}

.contacto-form .form-group-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Espacio entre inputs */
}

.contacto-form input[type="text"],
.contacto-form input[type="email"],
.contacto-form input[type="tel"],
.contacto-form textarea {
    width: 100%;
    padding: 15px 20px;
    background-color: rgba(255, 255, 255, 0.95); /* Ligeramente transparente */
    border: 1px solid #ccc; /* Borde visible */
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    box-sizing: border-box;
}
.contacto-form input[type="text"]:focus,
.contacto-form input[type="email"]:focus,
.contacto-form input[type="tel"]:focus,
.contacto-form textarea:focus {
    outline: none;
    border-color: #0d6efd; /* Azul más brillante */
    background-color: #fff; /* Blanco sólido al enfocar */
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.contacto-form textarea {
    resize: vertical;
    min-height: calc( (15px * 4) + (1rem * 3) + (1.5rem * 2) ); /* Intentar alinear altura (aprox) */
    /* Altura calculada: (PaddingInput*4) + (FontSize*3) + (Gap*2) */
}

.contacto-form ::placeholder { color: #777; opacity: 1; }
.contacto-form :-ms-input-placeholder { color: #777; }
.contacto-form ::-ms-input-placeholder { color: #777; }

.form-submit { margin-top: 2rem; text-align: center;}

.btn-contacto {
    background-color: #0d6efd;
    color: #fff;
    padding: 15px 45px; /* Un poco más de padding */
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-contacto:hover {
    background-color: #0b5ed7;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#form-messages {
    margin-top: 1.5rem; padding: 12px 20px; border-radius: 5px; font-weight: bold; color: #fff; /* Texto blanco para mensajes */ display: none; /* Oculto hasta que haya mensaje */
}
#form-messages.success { background-color: rgba(25, 135, 84, 0.9); /* Verde oscuro translúcido */ display: block; }
#form-messages.error { background-color: rgba(220, 53, 69, 0.9); /* Rojo oscuro translúcido */ display: block; }


/* ================================ */
/* ===== MEDIA QUERIES FINAL ====== */
/* ================================ */

/* === Tablets (<= 992px) === */
@media (max-width: 992px) {
    :root { --padding-container: 60px 0; }
    html { scroll-padding-top: 65px; } /* Ajusta si altura sticky nav cambia */

    /* --- Menú Hamburguesa Activo --- */
    .menu__container { width: calc(100% - 60px); justify-content: flex-start; }
    .menu { display: none; } /* Oculta menú desktop */
    .hamburger-btn { display: block; position: absolute; right: 15px; top: 50%; transform: translateY(-50%); }

    .menu.active { /* Estilos menú desplegado */
        display: flex; flex-direction: column; position: absolute;
        top: 100%; left: 0; width: 100%;
        background-color: rgba(45, 47, 53, 0.98);
        backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
        padding: 0; border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        max-height: calc(100vh - 60px); overflow-y: auto;
        visibility: visible; opacity: 1;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .menu.active .menu__titulos { margin: 0; width: 100%; text-align: left; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
    .menu.active .menu__titulos:last-child { border-bottom: none; }
    .menu.active .link { display: block; padding: 18px 25px; color: #fff; font-size: 1rem; width: 100%; box-sizing: border-box; transition: background-color 0.2s ease; }
    .menu.active .link:hover { background-color: rgba(255, 255, 255, 0.08); color: #fff; }
    .menu.active .link::after { display: none; }
    .menu.active .menu__items--cta {
        border: none; background-color: #0d6efd; margin: 10px 20px;
        width: calc(100% - 40px); border-radius: 50px; text-align: center; padding: 12px 20px; /* Ajusta padding CTA */
    }
    .menu.active .menu__items--cta:hover { background-color: #0b5ed7; }
    /* --- Fin Menú Hamburguesa --- */

    .hero__titulo { font-size: 2.8rem; }
    .hero__subtitulo { font-size: 1.8rem; }
    .title { font-size: 2.2rem; }

    .about__texts, .about__img { max-width: 600px; margin-left: auto; margin-right: auto; width: 100%; text-align: center; }
    .about__texts .title { text-align: center; }
    .about__texts { order: 1; margin-bottom: 30px; }
    .about__img { order: 2; }
    .about__picture { max-width: 80%; } /* Imagen más pequeña que su contenedor */
    .about__video { width: 100%; max-width: 600px; margin: 40px auto 0 auto; }
    .about__mp4 { width: 100%; }

    .portfolio-item { width: calc(50% - 30px); /* 2 columnas */ }

    .logo-slide { width: 180px; padding: 0 15px; }
    .logo-scroll-track { width: calc(180px * 8); animation-duration: 18s; } /* AJUSTA CÁLCULO */
    @keyframes scrollLogos { /* Asegura que la animación también se actualice aquí */
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-180px * 4)); } /* AJUSTA CÁLCULO */
    }

    .contacto-container { max-width: 700px; }
}


/* === Móviles (<= 768px) === */
@media (max-width: 768px) {
    :root { --padding-container: 40px 0; }
    html { scroll-padding-top: 60px; } /* Ajusta si altura sticky nav cambia */

    /* Ajustes finos Menú */
    .nav-logo { font-size: 1rem; }
    .hamburger-btn { font-size: 2rem; }

    .hero { background-attachment: scroll; min-height: 85vh; padding-top: 60px; /* Espacio para nav */ }
    .hero__main.container { padding-top: 20px; padding-bottom: 20px; } /* Padding interno hero */
    .hero__titulo { font-size: 2rem; }
    .hero__subtitulo { font-size: 1.2rem; }
    .hero__wave { height: 60px; }

    .title { font-size: 1.8rem; margin-bottom: 25px; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }

    /* About */
    .about__img { width: 70%; }
    .about__picture { border-radius: 10px; }
    .about__video { width: 100%; padding: 0 15px; box-sizing: border-box; }

    /* Historia */
    .historia-container { padding: 0 15px; }
    #nuestra-historia h2 { font-size: 1.8rem; }
    .historia-timeline::before { left: 20px; }
    .historia-item { padding-left: 45px; padding-right: 15px; margin-bottom: 30px; }
    .historia-content { width: 100%; float: none !important; text-align: left !important; }
    .content-inner { padding: 15px; }
    /* Fix posición relativa para texto izquierdo */
     #nuestra-historia .historia-content.left .content-inner {
         position: relative; /* Asegúrate que esto siga si es tu fix */
         right: 40px;    /* Ajusta si es necesario */
    }
    .content-inner h3 { font-size: 1.1rem; overflow-wrap: break-word; word-wrap: break-word; }
    .content-inner p { font-size: 0.9rem; }
    .historia-icon {
        left: 20px; transform: translateX(-50%);
        width: 60px; height: 60px; /* Icono móvil aumentado */
        border-width: 4px; box-shadow: 0 0 0 4px #ffffff;
        top: 15px; /* Revisar alineación vertical */
    }
    .historia-content::after { /* Flecha */
        top: 20px; /* Alineada con top del icono (15px + 5px aprox) */
        border-width: 10px 10px 10px 0 !important;
        border-color: transparent #ffffff transparent transparent !important;
        filter: drop-shadow(-1px 0px 0px #e9ecef) !important;
    }
     /* Ajuste flecha izquierda si se usa position: relative */
     .historia-content.left::after {
        right: -55px; /* -15px - 40px (Ajusta si tu 'right' es diferente) */
        /* El resto igual que la otra flecha */
        left: auto !important;
        border-width: 15px 0 15px 15px !important;
        border-color: transparent transparent transparent #ffffff !important;
        filter: drop-shadow(1px 0px 0px #e9ecef) !important;
     }


    /* Servicios */
    .portfolio-item { width: calc(100% - 20px); margin: 10px; }
    .portfolio-grid { margin: -10px; }

    /* Oficinas */
    .oficinas-container { padding: 0 1rem; }
    .oficinas-grid { gap: 1.5rem; }
    .oficina-mapa { height: 220px; }

    /* Clientes Logos */
    .logo-scroll-container { -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent); } /* Máscara más estrecha */
    .logo-slide { width: 140px; padding: 0 10px; } /* Logos más pequeños */
    .logo-scroll-track { width: calc(140px * 8); animation-duration: 16s; } /* AJUSTA CÁLCULO */
     @keyframes scrollLogos { /* Re-declarar por si acaso */
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-140px * 4)); } /* AJUSTA CÁLCULO */
    }

    /* Contacto */
    .contacto-container { padding: 0 1rem; }
    .contacto-form .form-row { flex-direction: column; gap: 1rem; }
    .contacto-form .form-group { min-width: 100%; }
    .contacto-form textarea { min-height: 120px; }
    .btn-contacto { padding: 12px 30px; font-size: 0.9rem; }

    /* Modales */
    .ce-modal-content { width: 95%; padding: 20px; }
    .ce-modal-title { font-size: 1.5rem; }
    .ce-modal-text { font-size: 0.95rem; }
    .ce-modal-close { font-size: 30px; top: 10px; right: 15px;}
}


/* === Móviles muy pequeños (<= 480px) === */
@media (max-width: 480px) {
    :root { --padding-container: 30px 0; }
    html { scroll-padding-top: 55px; } /* Ajusta si altura sticky nav cambia */

    .hero__titulo { font-size: 1.7rem; }
    .hero__subtitulo { font-size: 1.05rem; }
    .title { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }

    .nav-logo { font-size: 1rem; }
    .hamburger-btn { font-size: 1.8rem; }
    .menu.active .link { font-size: 0.95rem; padding: 15px 20px; }

    .portfolio-caption h4 { font-size: 1.05rem; }
    .portfolio-text { font-size: 0.85rem; }

    .btn-contacto, .about__cta, .hero__cta { padding: 10px 25px; font-size: 0.9rem; }

    .historia-icon { width: 55px; height: 55px; } /* Icono timeline aún más pequeño */
    .logo-slide { width: 110px; padding: 0 8px; } /* Logos cliente más pequeños */
    .logo-scroll-track { width: calc(110px * 8); animation-duration: 14s; } /* AJUSTA CÁLCULO */
     @keyframes scrollLogos { /* Re-declarar por si acaso */
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-110px * 4)); } /* AJUSTA CÁLCULO */
    }

     .oficina-mapa { height: 180px; }
     .oficina-nombre { font-size: 1.1rem; }
}