:root {
    --primary-blue: #2A4B8D;
    --primary-green: #3B8B55;
    --dark-text: #333333;
    --light-text: #f8f9fa;
    --light-bg: #FFFFFF;
    --alternate-bg: #f4f7f6;
    --font-header: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
}

/* --- Reseteo y Globales --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--dark-text);
    background-color: var(--light-bg);
}
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}
img { max-width: 100%; display: block; }

/* --- Header y Navegación --- */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}
.header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { height: 40px; }
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}
/* Estilo para links normales del navbar */
.nav-links a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: color 0.3s ease, background-color 0.3s ease;
}
.nav-links a:not(.cta-button):hover {
    color: var(--primary-blue);
    background-color: #f0f0f0;
}
/* Estilo específico para el botón CTA en el navbar */
.nav-links .cta-button {
    color: var(--light-text);
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-green));
    padding: 0.75rem 1.5rem;
}
.nav-links .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Botón CTA General --- */
.cta-button {
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-green));
    color: var(--light-text);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    color: white;
    background: url('https://images.pexels.com/photos/196644/pexels-photo-196644.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2') no-repeat center center/cover;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 75, 141, 0.7);
    background-image: linear-gradient(45deg, rgba(59, 139, 85, 0.4) 0%, rgba(42, 75, 141, 0.8) 100%);
}
.hero-content { position: relative; z-index: 2; }
.main-headline {
    font-family: var(--font-header);
    font-size: 3.5rem;
    color: var(--light-text);
    text-shadow: 1px 1px 5px rgba(0,0,0,0.3);
}
.sub-headline { font-size: 1.25rem; margin: 1rem 0 2rem; max-width: 650px; margin-left: auto; margin-right: auto; }

/* --- Secciones de Contenido --- */
.content-section { padding: 5rem 0; overflow-x: hidden; }
.alternate-bg { background-color: var(--alternate-bg); }
.section-title {
    font-family: var(--font-header);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-blue);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}
.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-green);
}
.service-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-top: 5px solid var(--primary-green);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.service-card h3 {
    font-family: var(--font-header);
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

/* --- About Us Section --- */
.about-container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem; }
.about-text .section-title { text-align: left; }
.about-image img { border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* --- Portfolio Section (Swiper) --- */
.portfolio-slider {
    width: 100%;
    padding: 1rem 0 3.5rem; /* Espacio para la paginación */
}
.swiper-slide {
    padding: 0 10px;
    transition: transform 0.3s ease;
}
.swiper-slide:not(.swiper-slide-active) {
    transform: none;
    opacity: 1;
}
.portfolio-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    position: relative;
    cursor: grab;
    aspect-ratio: 16 / 9;
    border: 1px solid #eee;
}
.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.portfolio-card:hover img { transform: scale(1.1); }
.portfolio-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem;
}
.portfolio-info h3 { font-family: var(--font-header); }
.swiper-pagination-bullet-active { background-color: var(--primary-blue); }
.swiper-button-next, .swiper-button-prev {
    color: var(--primary-blue);
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: white;
    transform: scale(1.1);
}
.swiper-button-next::after, .swiper-button-prev::after { font-size: 1.5rem; }

/* --- Contact Section --- */
.contact-subtitle { text-align: center; max-width: 500px; margin: -2rem auto 3rem; }
.contact-form { max-width: 700px; margin: 0 auto; }
.contact-form .form-group { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-family: var(--font-body);
    font-size: 1rem;
}
.contact-form textarea { margin-bottom: 1.5rem; }
.contact-form button { width: 100%; font-size: 1.1rem; }

/* --- Footer --- */
.footer { background-color: var(--dark-text); color: var(--light-text); text-align: center; padding: 2rem 0; }

/* --- Estado Inicial para Animaciones --- */
.anim-on-load, .anim-scroll { opacity: 0; transform: translateY(30px); }

/* --- Responsividad y Menú Móvil --- */
.menu-icon { display: none; }

@media (max-width: 768px) {
    .main-headline { font-size: 2.5rem; }
    .about-container { grid-template-columns: 1fr; }
    .about-text { order: 2; }
    .about-image { order: 1; }
    .about-text .section-title { text-align: center; }

    /* Menú Móvil */
    .menu-icon { display: flex; flex-direction: column; justify-content: space-around; width: 25px; height: 20px; cursor: pointer; z-index: 1001; }
    .menu-icon__line { width: 100%; height: 2px; background-color: var(--dark-text); transition: all 0.3s ease; }
    .nav-links { position: fixed; top: 0; right: -100%; width: 70%; height: 100vh; background-color: var(--light-bg); flex-direction: column; justify-content: center; align-items: center; gap: 2rem; transition: right 0.4s ease-in-out; box-shadow: -5px 0 15px rgba(0,0,0,0.1); }
    .nav-links.active { right: 0; }
    .nav-links a { font-size: 1.2rem; }
    .nav-links .cta-button { padding: 0.75rem 1.5rem; }
    .contact-form .form-group { grid-template-columns: 1fr; }
}

/* --- Estilos para la Sección de Logos --- */
.logos-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    margin-top: 4rem;
}

.logo-item img {
    height: 60px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease-in-out;
}

.logo-item:hover img {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.1);
}

/* --- Estilos para el Footer Mejorado --- */
.footer-enhanced {
    background-color: #2c3e50; /* Un azul oscuro, más sobrio */
    color: #bdc3c7; /* Un gris claro para el texto */
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-column .footer-logo {
    height: 40px;
    margin-bottom: 1rem;
}

.footer-column h3 {
    font-family: var(--font-header);
    color: var(--light-text);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-column a:hover {
    color: white;
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #bdc3c7;
    color: #bdc3c7;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid #34495e;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: #bdc3c7;
    text-decoration: underline;
}

.footer-column ul li a.direccion-footer {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-column ul li a.direccion-footer:hover {
    color: white;
    padding-left: 10px;
}

.tech-stack-container {
    margin-top: 5rem; /* Espacio para separar del contenido de arriba */
}

.subsection-title {
    font-family: var(--font-header);
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary-blue);
    margin-bottom: 3rem;
    font-weight: 700;
}

/* Ajuste para que los logos no necesiten tanto margen superior */
.tech-stack-container .logos-container {
    margin-top: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Columna de imagen más pequeña */
    align-items: center;
    gap: 4rem;
}

.about-image-column img {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.about-content-column .section-title {
    text-align: left;
    margin-bottom: 2rem;
}

/* Estilos para las pestañas (Tabs) */
.tabs-container {
    width: 100%;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1.5rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-family: var(--font-header);
    font-size: 1rem;
    font-weight: 700;
    color: #888;
    position: relative;
    transition: color 0.3s ease;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-button.active {
    color: var(--primary-blue);
}

.tab-button.active::after {
    transform: scaleX(1);
}

.tab-content {
    display: grid;
    position: relative;
    transition: height 0.3s ease-in-out;
}

.tab-content .tab-pane {
    grid-area: 1 / 1 / 2 / 2;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
    line-height: 1.6;
}

.tab-content .tab-pane.active {
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajustes para móvil */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
    }
    .about-content-column .section-title {
        text-align: center;
    }
}

/* --- Estilos para la sección de servicios interactiva --- */
.section-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -2rem auto 3rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.services-grid-interactive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.flip-card {
    background-color: transparent;
    height: 300px;
    perspective: 1000px; /* Efecto 3D */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.7s;
    transform-style: preserve-3d;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-radius: 12px;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Para Safari */
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.flip-card-front {
    background-color: var(--light-bg);
    color: var(--dark-text);
}

.flip-card-front .service-icon {
    font-size: 3rem;
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.flip-card-front h3 {
    font-family: var(--font-header);
    font-size: 1.3rem;
    color: var(--primary-blue);
}

.flip-card-back {
    background: linear-gradient(45deg, var(--primary-blue), var(--primary-green));
    color: white;
    transform: rotateY(180deg);
}

.flip-card-back h4 {
    font-family: var(--font-header);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.flip-card-back p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f4f7f6; /* Mismo color que alternate-bg */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo img {
    height: 60px;
    animation: pulse 1.5s infinite ease-in-out;
}

.preloader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 2rem;
}

/* Animaciones del preloader */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}


/* --- Optimización Clave: Evitar scroll durante la carga --- */
body.is-loading {
    overflow: hidden;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}