/* PALETA DE COLORES */
:root {
    --primary-dark: #0f2a3a;
    --accent-mint: #00a88f;
    --accent-mint-light: #e6f6f4;
    --text-main: #374151;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    --font-family: 'Plus Jakarta Sans', sans-serif;
}

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden; /* Evita desbordamiento horizontal en móviles */
}

/* UTILITIES */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-highlight { color: var(--accent-mint); }
.text-center { text-align: center; }
.section-tag {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-mint);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* FIX CRÍTICO: Control total de imágenes dentro de placeholders */
.image-placeholder {
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fuerza a la imagen a rellenar el cuadro sin deformarse */
    object-position: center;
    display: block;
}

/* BUTTONS */
.btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-family: var(--font-family);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-primary { background-color: var(--primary-dark); color: var(--white); }
.btn-secondary { background-color: var(--primary-dark); color: var(--white); }
.btn-accent { background-color: var(--accent-mint); color: var(--white); }
.btn-link {
    background: none;
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-nav-mobile { display: none; }

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* NAVBAR */
.navbar {
    background-color: var(--white);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 2rem; }
.logo-text { display: flex; flex-direction: column; text-align: center; }
.brand-name { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.brand-sub { font-size: 0.55rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; }

.nav-menu { display: flex; gap: 30px; align-items: center; }
.nav-link { text-decoration: none; color: var(--text-main); font-weight: 500; font-size: 0.95rem; transition: color 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--accent-mint); }

/* Menú hamburguesa oculto en escritorio */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--primary-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* HERO SECTION */
.hero {
    padding: 80px 0;
    background: radial-gradient(circle at 80% 20%, var(--accent-mint-light) 0%, transparent 50%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 50px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--primary-dark);
    line-height: 1.15;
    margin-bottom: 24px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 35px;
    max-width: 500px;
}

.hero-cta { display: flex; gap: 20px; align-items: center; }

/* Máscara orgánica adaptada */
.main-hero-img {
    width: 100%;
    height: 480px;
    border-radius: 45% 55% 40% 60% / 45% 45% 55% 55%;
}

/* FEATURES - Implementando Auto-grid Inteligente */
.features {
    padding: 40px 0;
    margin-top: -40px;
    position: relative;
    z-index: 10;
}

.features-grid {
    display: grid;
    /* Auto-grid dinámico: calcula cuántas columnas entran según el espacio */
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature-card {
    background-color: var(--white);
    padding: 30px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    transition: transform 0.3s;
}

.feature-card:hover { transform: translateY(-5px); }
.feature-icon { font-size: 1.6rem; margin-bottom: 15px; }
.feature-card h3 { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 10px; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ABOUT SECTION */
.about { padding: 80px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-img { width: 100%; height: 480px; border-radius: 30px; }
.about-content h2 { font-size: 2.5rem; color: var(--primary-dark); line-height: 1.2; margin-bottom: 20px; }
.section-desc { color: var(--text-muted); margin-bottom: 35px; font-size: 1.05rem; }
.about-list { display: flex; flex-direction: column; gap: 25px; }
.about-item { display: flex; gap: 20px; align-items: flex-start; }
.item-icon { background-color: var(--accent-mint-light); color: var(--accent-mint); padding: 10px; border-radius: 50%; font-size: 1.2rem; display: flex; }
.about-item h4 { font-size: 1.1rem; color: var(--primary-dark); margin-bottom: 4px; }
.about-item p { font-size: 0.9rem; color: var(--text-muted); }

/* SERVICES - Auto-grid adaptable */
.services { padding: 80px 0; }
.section-title { font-size: 2.5rem; color: var(--primary-dark); margin-bottom: 50px; }

.services-grid {
    display: grid;
    /* Pasa de 5 columnas en desktop a reorganizarse solo en laptops y móviles */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.service-card {
    background-color: var(--white);
    padding: 35px 20px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 4px 25px rgba(0,0,0,0.01);
    transition: transform 0.3s;
}
.service-card:hover { transform: translateY(-5px); }
.service-card h3 { font-size: 1.1rem; color: var(--primary-dark); margin-top: 15px; margin-bottom: 12px; }
.service-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* CTA BANNER */
.cta-banner { margin: 40px auto; max-width: 1150px; background-color: var(--primary-dark); border-radius: 24px; padding: 45px 50px; color: var(--white); }
.cta-flex { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.cta-text-group { display: flex; align-items: center; gap: 25px; }
.cta-logo-brain { font-size: 3rem; }
.cta-text-group h2 { font-size: 1.8rem; font-weight: 600; }
.cta-text-group p { color: #94a3b8; }

/* FOOTER */
.footer { background-color: var(--primary-dark); padding: 60px 0 40px 0; color: var(--white); }
.footer-flex { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.logo-icon-white { font-size: 2rem; }
.brand-name-white { font-size: 1.4rem; font-weight: 700; color: var(--white); }
.brand-sub-white { font-size: 0.55rem; font-weight: 600; color: #94a3b8; letter-spacing: 0.5px; }
.footer-slogan { margin-top: 15px; font-size: 0.9rem; color: #94a3b8; max-width: 380px; }
.footer-socials { display: flex; flex-direction: column; align-items: flex-end; gap: 15px; }
.footer-socials span { font-size: 0.9rem; color: #94a3b8; }
.social-icons { display: flex; gap: 15px; }
.social-link { text-decoration: none; font-size: 1.2rem; filter: grayscale(1) brightness(2); }

/* ==========================================================
   RESPONSIVIDAD AVANZADA (MEDIA QUERIES)
   ========================================================== */

@media (max-width: 1024px) {
    .hero-content h1 { font-size: 2.8rem; }
    .about-grid { gap: 40px; }
}

@media (max-width: 768px) {
    /* Navbar móvil interactivo */
    .nav-actions { display: none; }
    .menu-toggle { display: flex; }
    
    .nav-menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 72px; /* Alineado al navbar */
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background-color: var(--white);
        gap: 25px;
        padding: 40px 24px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.05);
        transform: translateX(100%);
        transition: transform 0.4s ease-in-out;
    }
    
    /* Estado activo del menú desplegado */
    .nav-menu.open { transform: translateX(0); }
    .nav-link { font-size: 1.2rem; width: 100%; text-align: center; }
    .btn-nav-mobile { display: block; width: 100%; max-width: 280px; text-align: center; }

    /* Transformación animada a equis (X) del botón hamburguesa */
    .menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

    /* Reajuste Estructural a una Sola Columna */
    .hero-grid, .about-grid, .cta-flex, .footer-flex {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content h1 { font-size: 2.3rem; }
    .hero-content p { margin: 0 auto 30px auto; }
    .hero-cta { justify-content: center; flex-direction: column; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    
    /* Reordenamiento visual para móviles (Imagen arriba) */
    .hero-image { order: -1; }
    .main-hero-img { height: 340px; width: 100%; }
    .about-img { height: 340px; }
    .about-item { text-align: left; }
    
    .section-title { font-size: 2rem; margin-bottom: 35px; }

    /* Control de Banners y Footers */
    .cta-banner { padding: 35px 24px; margin: 20px 16px; }
    .cta-text-group { flex-direction: column; text-align: center; }
    .cta-flex .btn { width: 100%; }
    
    .footer-flex { flex-direction: column; align-items: center; }
    .footer-socials { align-items: center; }
}

@media (max-width: 480px) {
    .brand-name { font-size: 1.2rem; }
    .hero-content h1 { font-size: 2rem; }
    .main-hero-img, .about-img { height: 260px; }
}