:root {
    --bg-color: #ffffff;
    --text-color: #111827;
    --text-light: #4b5563;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --light-gray: #f9fafb;
    --border-color: #e5e7eb;
    --font-main: 'Inter', sans-serif;
}

/* --- SOLUCIÓN AL REFLOW (Redistribución forzada) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}
/* --------------------------------------------------- */

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navegación y Logo */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%; 
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.logo-img {
    width: 180px; 
    height: auto;
    aspect-ratio: 300 / 97; 
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Teléfono Móvil y Hamburguesa */
.mobile-phone {
    display: none;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* Botones */
.btn-primary {
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    background-color: var(--accent-color);
    color: white !important;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Secciones Generales */
.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--light-gray);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.15rem;
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    /* 1. Imagen optimizada para móviles (800px) */
    background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?fm=webp&fit=crop&w=800&q=40');
    background-size: cover;
    background-position: center;
    /* 2. Quitamos el fixed en móviles porque bloquea el procesador */
    color: white;
}

/* 3. Devolvemos la imagen gigante y el efecto fixed SOLO para pantallas grandes */
@media (min-width: 768px) {
    .hero {
        background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?fm=webp&fit=crop&w=1920&q=60');
        background-attachment: fixed;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    color: #e5e7eb;
    margin-bottom: 2.5rem;
}

/* Grid Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    padding-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1; 
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img {
    transform: scale(1.05);
}

.card h3 {
    margin: 1.5rem 1.5rem 0.5rem;
    font-size: 1.2rem;
}

.card p {
    margin: 0 1.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Diferenciales (Cards simples) */
.card-simple {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.card-simple h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.card-simple p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Pestañas Interactivas (Método) */
.interactive-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-gray);
}

.tab-btn {
    flex: 1 1 15%;
    min-width: 120px;
    padding: 1rem;
    border: none;
    background: transparent;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: #e5e7eb;
}

.tab-btn.active {
    background: white;
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.tab-content {
    padding: 3rem;
}

.tab-pane {
    display: none;
    animation: fadeInTab 0.4s ease;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    margin-bottom: 1rem;
    color: var(--accent-color);
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sección Nosotros */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.profile-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.profile-img {
    width: 200px;
    height: 200px; 
    aspect-ratio: 1 / 1;
    object-fit: cover; 
    border-radius: 12px;
    margin-bottom: 2rem;
    display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.profile-card h3 {
    color: var(--text-color);
    margin-bottom: 0.3rem;
    font-size: 1.5rem;
}

.profile-card h4 {
    color: var(--accent-color);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.profile-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Sección Resultados */
.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.stat-number {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 500;
    text-align: center;
}

/* Enlaces del Blog */
.blog-link {
    display: inline-block;
    margin: 1rem 1.5rem 0;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.blog-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Footer Profesional */
.footer-pro {
    background-color: #111827;
    color: #e5e7eb;
    padding: 4rem 0 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-col h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col a {
    color: #e5e7eb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--accent-color);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-bottom {
    background-color: #030712;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Redes Sociales Footer */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-icons a {
    color: #9ca3af;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.social-icons a svg {
    width: 1.5rem;
    height: 1.5rem;
    transition: color 0.3s;
}

.social-icons a:hover svg {
    color: white;
}

/* Animaciones Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE & MOBILE MENU */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; 
	@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    
    /* ... (aquí está el código de tu menú móvil que ya tienes) ... */

    .nav-links li {
        margin: 1.5rem 0;
    }

    /* 👇 AÑADE ESTO: Centrar el formulario de chat en móviles 👇 */
    .chat-popup {
        right: 50%;
        transform: translateX(50%);
        bottom: 20px;
        width: 92%; /* Lo hacemos un pelín más ancho para aprovechar la pantalla */
    }
}
	}
    
    .menu-toggle {
        display: flex;
    }
    
    .mobile-phone {
        display: block;
        margin-left: auto;
        margin-right: 1.5rem;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: -100%; 
        width: 100%;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        text-align: center;
        padding: 2rem 0;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }
}

/* --- Estilos para el Formulario Flotante --- */
.open-chat-btn {
    background-color: #2196f3;
    color: white;
    padding: 16px;
    border: none;
    cursor: pointer;
    opacity: 0.9;
    position: fixed;
    bottom: 23px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.open-chat-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.chat-popup {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 28px;
    border: none;
    z-index: 1002;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 10px;
    max-width: 350px;
    width: 90%; 
    background-color: white;
    max-height: 85vh; 
    overflow-y: auto; 
}

.form-header {
    background-color: #1a237e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h4 {
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.form-container {
    padding: 20px;
    background-color: white;
}

.form-container input[type=text],
.form-container input[type=email],
.form-container textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: inherit;
}

.form-container textarea {
    resize: vertical;
    height: 100px;
}

.form-container input:focus,
.form-container textarea:focus {
    background-color: #f9f9f9;
    outline: none;
    border-color: #2196f3;
}

.form-container .submit-btn {
    background-color: #2196f3;
    color: white;
    padding: 14px 20px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    opacity: 0.9;
    border-radius: 5px;
    font-weight: bold;
    font-size: 16px;
    transition: opacity 0.3s ease;
}

.form-container .submit-btn:hover {
    opacity: 1;
}

/* --- Mostrar solo una sección a la vez --- */
header.hero, section.section {
    display: none !important; /* Oculta todas las secciones */
}

/* Muestra solo la sección activa */
header.hero.active-page {
    display: flex !important; /* El inicio usa flex para centrarse */
}

section.section.active-page {
    display: block !important; 
}