/* ==========================================================================
   1. VARIABLES Y ESTILOS GLOBALES
   ========================================================================== */

:root {
    --primary-color: #00a896;      /* Verde del logo */
    --secondary-color: #f0c808;    /* Amarillo del logo */
    --dark-bg: #0d1117;           /* Fondo principal oscuro (casi negro) */
    --light-bg: #161b22;          /* Fondo oscuro para secciones alternas */
    --glass-bg: rgba(22, 27, 34, 0.6); /* Fondo para el efecto vidrio */
    --glass-border: rgba(255, 255, 255, 0.1);
    --light-text: #f0f6fc;         /* Texto principal claro */
    --grey-text: #b0b8c4;          /* Texto secundario/subtítulos */
    --font-family: 'Poppins', sans-serif;
    --border-radius: 15px;
    --container-width: 1200px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--dark-bg);
    color: var(--light-text);
    background-image: url('../images/background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ==========================================================================
   2. CLASES DE UTILIDAD Y REUTILIZABLES
   ========================================================================== */

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--grey-text);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-header {
    margin-bottom: 4rem;
}

.bg-dark {
    background-color: var(--light-bg);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   3. LAYOUT (ESTRUCTURA)
   ========================================================================== */

.two-columns-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-layout .column:first-child {
    flex: 2;
}
.contact-layout .column:last-child {
    flex: 1;
}

/* ==========================================================================
   4. COMPONENTES
   ========================================================================== */

/* --- Header y Navegación --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: rgba(13, 17, 23, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--light-text);
    font-weight: 600;
    font-size: 1.5rem;
}

.logo {
    height: 40px;
    margin-right: 10px;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--light-text);
    text-decoration: none;
    font-weight: 400;
  /* ---  padding: 5px 0; --- */
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active-link {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

.cta-button-nav {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 8px 40px; /* <-- AJUSTE CLAVE: Menos alto, un poco más ancho */
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button-nav:hover {
    background-color: #007a76;
    transform: translateY(-2px);
    color: var(--light-text); /* Override para mantener el texto blanco al pasar el cursor */
}

/* --- Menú Hamburguesa (Móvil) --- */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 100%;
    height: 3px;
    background-color: var(--light-text);
    position: absolute;
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.hamburger-inner {
    top: 50%;
    transform: translateY(-50%);
}
.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
}
.hamburger-inner::before { top: -10px; }
.hamburger-inner::after { bottom: -10px; }

/* Animación de la hamburguesa a X */
.hamburger.is-active .hamburger-inner {
    transform: rotate(45deg);
}
.hamburger.is-active .hamburger-inner::before {
    transform: rotate(0);
    top: 0;
}
.hamburger.is-active .hamburger-inner::after {
    transform: rotate(-90deg);
    bottom: 0;
}

/* --- Secciones Hero --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--header-height);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.service-hero-section {
    padding: 120px 0;
    padding-top: calc(var(--header-height) + 60px);
    background: linear-gradient(rgba(13, 17, 23, 0.8), rgba(13, 17, 23, 0.8));
}
.service-title { font-size: 3.2rem; }

/* --- Botón CTA Principal --- */
.cta-button {
    background: var(--primary-color);
    color: var(--light-text);
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-block;
    margin-top: 1rem;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    background-color: #007a76;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 168, 150, 0.2);
}

/* --- Tarjeta de Vidrio (Glassmorphism) --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
}

/* --- Tarjetas de Servicio --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 4rem;
}

.service-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.service-card .icon { font-size: 3rem; margin-bottom: 1rem; color: var(--primary-color); }
.service-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.service-card .learn-more-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
    display: inline-block;
}

/* --- Diagrama de Sinergia --- */
.synergy-diagram {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 3rem;
    flex-wrap: wrap;
}
.synergy-item { flex: 1; min-width: 200px; }
.synergy-item h3 { color: var(--primary-color); margin-top: 0.5rem; }
.synergy-icon { font-size: 3rem; }
.synergy-arrow { font-size: 3rem; color: var(--grey-text); }


/* --- Logos de Tecnologías --- */
.tech-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 3rem;
    filter: grayscale(100%) brightness(1.5);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.tech-logos:hover {
    filter: grayscale(0) brightness(1);
    opacity: 1;
}
.tech-logos img {
    height: 40px;
}

/* --- Tarjeta CTA Final --- */
.final-cta-card {
    padding: 50px;
}

/* --- Footer --- */
.main-footer {
    padding: 40px 0;
    background: var(--dark-bg);
    border-top: 1px solid var(--glass-border);
}
.footer-logo { height: 50px; margin-bottom: 1rem; }
.footer-tagline { color: var(--grey-text); margin-top: 0.5rem; }

/* --- Estilos de Páginas de Servicio --- */
.benefit-card ul {
    list-style: none;
    padding: 0;
}
.benefit-card li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 1rem;
}
.benefit-card li::before {
    content: '✔';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.process-steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}
.process-step { padding: 2rem; }
.process-step .step-number {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 1.5rem auto;
}
.step-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}
.use-case-card { text-align: left; }

/* --- Página de Contacto --- */
.contact-form-card { padding: 40px; }
.form-title { margin-bottom: 2rem; }
#contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
#contact-form input, #contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--light-text);
    font-family: var(--font-family);
    font-size: 1rem;
}
#contact-form input::placeholder, #contact-form textarea::placeholder { color: var(--grey-text); }
#contact-form button { width: 100%; }

.contact-info-card { padding: 2rem; }
.contact-info-card h3 { margin-bottom: 1.5rem; }
.info-item { margin-bottom: 2rem; }
.info-item h4 { color: var(--primary-color); }
.info-item p { color: var(--grey-text); font-size: 0.9rem; }
.info-item a { color: var(--light-text); text-decoration: none; }

/* ==========================================================================
   5. ANIMACIONES
   ========================================================================== */
.anim-fade-in {
    animation: fadeIn 1s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.anim-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   6. DISEÑO RESPONSIVO (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 992px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    .two-columns-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section-title, .service-title { font-size: 2.2rem; }
    .hero-content h1 { font-size: 2.5rem; }

    /* Navegación móvil */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--dark-bg);
        flex-direction: column;
        justify-content: center;
        align-items: baseline;
        gap: 40px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-links a { font-size: 1.5rem; }
    .hamburger { display: block; }

    .synergy-diagram { flex-direction: column; gap: 1rem; }
    .synergy-arrow { transform: rotate(90deg); }
}

.main-header.scrolled {
     background-color: rgba(13, 17, 23, 0.85); /* Un poco más opaco */
     box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
 }