/* --- VARIABLES --- */
:root {
    --primary-color: #0d2c6c;
    --secondary-color: #1a5276;
    --accent-color: #e67e22;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --font-main: 'Segoe UI', Tahoma, sans-serif;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text-dark); background-color: var(--bg-light); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- BOTONES --- */
.btn { padding: 14px 35px; border-radius: 8px; font-weight: 700; text-transform: uppercase; cursor: pointer; display: inline-block; transition: var(--transition); border: 2px solid transparent; }
.btn-primary { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.btn-primary:hover { background: transparent; color: var(--accent-color); }
.btn-secondary { border-color: white; color: white; }
.btn-secondary:hover { background: white; color: var(--primary-color); }

/* --- HEADER --- */
.main-header { position: fixed; top: 0; width: 100%; z-index: 1000; padding: 20px 0; transition: var(--transition); background: transparent; }
.main-header.scrolled { background: white; padding: 10px 0; box-shadow: 0 5px 20px rgba(0,0,0,0.1); }

.header-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; }
.logo-brand { display: flex; align-items: center; gap: 15px; z-index: 1001; }
.logo-img { height: 55px; transition: var(--transition); }

.brand-name { font-size: 1.6rem; font-weight: 800; color: white; line-height: 1; transition: color 0.3s; }
.brand-sub { font-size: 0.8rem; text-transform: uppercase; color: #ddd; display: block; transition: color 0.3s; }
.main-header.scrolled .brand-name { color: var(--primary-color); }
.main-header.scrolled .brand-sub { color: var(--secondary-color); }

.menu-toggle { display: none; font-size: 1.8rem; background: none; border: none; color: white; cursor: pointer; z-index: 1001; }
.main-header.scrolled .menu-toggle { color: var(--primary-color); }

.nav-list { display: flex; align-items: center; gap: 25px; }
.nav-link { font-weight: 700; color: white; transition: 0.3s; font-size: 0.9rem; letter-spacing: 0.5px; }
.main-header.scrolled .nav-link { color: var(--primary-color); }
.nav-link:hover { color: var(--accent-color); }
.nav-btn { background: var(--accent-color) !important; color: white !important; border-radius: 5px; padding: 10px 20px; }
.nav-btn:hover { background: #d35400 !important; }

/* --- HERO --- */
.hero-section { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; color: white; overflow: hidden; }
.hero-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(13, 44, 108, 0.75); z-index: 0; }
.hero-content { position: relative; z-index: 1; max-width: 850px; padding: 0 20px; }
.hero-title { font-size: 3.8rem; font-weight: 800; margin-bottom: 20px; }
.hero-subtitle { font-size: 1.3rem; margin-bottom: 35px; opacity: 0.9; }
.hero-buttons { display: flex; gap: 20px; justify-content: center; }

.animate-up { opacity: 0; transform: translateY(30px); animation: fadeUp 1s forwards; }
.hero-subtitle { animation-delay: 0.3s; }
.hero-buttons { animation-delay: 0.6s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* --- SECCIONES --- */
section { padding: 100px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 { font-size: 2.8rem; color: var(--primary-color); }
.section-title p { color: #666; font-size: 1.1rem; margin-top: 10px; }
.reveal { opacity: 0; transform: translateY(50px); transition: 1s all ease; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- SERVICIOS --- */
.services-wrapper { display: flex; gap: 40px; background: white; padding: 60px; border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.06); }
.services-column { flex: 1; text-align: left; }
.column-header { display: flex; align-items: center; gap: 15px; border-bottom: 2px solid var(--bg-light); margin-bottom: 30px; padding-bottom: 15px; }
.column-header i { font-size: 2.2rem; color: var(--accent-color); }
.column-header h3 { font-size: 1.4rem; color: var(--primary-color); font-weight: 800; letter-spacing: 0.5px; }

.services-list li { font-size: 1.1rem; margin-bottom: 15px; display: flex; align-items: center; gap: 12px; font-weight: 500; }
.services-list i { color: var(--accent-color); }

.studies-container { display: flex; flex-direction: column; gap: 30px; }
.study-block h4 { font-size: 1.2rem; color: var(--secondary-color); margin-bottom: 15px; font-weight: 700; border-left: 4px solid var(--accent-color); padding-left: 10px; }
.sub-list li { font-size: 1rem !important; margin-bottom: 10px !important; }
.sub-list i { color: var(--secondary-color) !important; font-size: 0.9rem; }
.grid-sub-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; }

/* --- STAFF (Ajustado para optimizar espacio de 9 médicos) --- */
.staff-section { background-color: var(--text-light); }
.staff-grid { 
    display: grid; 
    /* Bajamos el mínimo de ancho de tarjeta de 250px a 200px para que entren más columnas por fila */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 40px 20px; 
}
.staff-card { text-align: center; display: flex; flex-direction: column; align-items: center; }

/* Reducimos el contenedor de imagen de 200px a 150px para compactar */
.staff-img-container { 
    width: 150px; 
    height: 150px; 
    border-radius: 50%; 
    overflow: hidden; 
    margin-bottom: 15px; 
    border: 5px solid var(--bg-light); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); 
}
.staff-img { width: 100%; height: 100%; object-fit: cover; }
.staff-card h3 { font-size: 1.15rem; color: var(--primary-color); font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.staff-card p { font-size: 0.85rem; color: var(--secondary-color); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.floating { animation: floating 4s ease-in-out infinite; }
@keyframes floating { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } } /* Suavizamos la flotación para tarjetas más chicas */

/* --- CONTACTO --- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.info-item { display: flex; gap: 20px; margin-bottom: 35px; }
.info-item i { font-size: 2rem; color: var(--accent-color); }
.info-item h4 { font-size: 1.3rem; color: var(--primary-color); margin-bottom: 5px; }

/* --- WHATSAPP --- */
.whatsapp-float { position: fixed; bottom: 40px; right: 40px; background: #25d366; color: white; width: 65px; height: 65px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 35px; z-index: 2000; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: 0.3s; }
.whatsapp-float:hover { transform: scale(1.1) rotate(10deg); }

/* --- FOOTER --- */
.main-footer { background: #f0f3f8; padding: 80px 0 30px; text-align: center; border-top: 1px solid #ddd; }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.footer-social a { font-size: 1.3rem; font-weight: 600; color: var(--primary-color); display: flex; align-items: center; gap: 10px; }
.footer-content p { font-size: 0.9rem; opacity: 0.6; margin-top: 20px; border-top: 1px solid #ccc; width: 100%; padding-top: 20px; }

/* --- DISEÑO MÓVIL --- */
@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header-container { padding: 0 10px; justify-content: space-between; }
    .logo-brand { gap: 10px; }
    .logo-img { height: 45px; }
    .brand-name { font-size: 1.3rem; }
    .hero-title { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; width: 100%; gap: 10px; }
    
    .menu-toggle { display: block; margin-left: auto; padding-right: 5px; }
    
    .nav-list { 
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: white; flex-direction: column; padding: 20px; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
    }
    
    .main-nav.active .nav-list { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    .nav-link { color: var(--primary-color); display: block; padding: 10px 0; font-weight: 700; }
    .main-header .nav-btn { display: inline-block; margin-top: 10px; width: auto; }

    section { padding: 60px 0; }
    .services-wrapper { flex-direction: column; padding: 30px 20px; gap: 30px; }
    .section-title { margin-bottom: 40px; }
    .section-title h2 { font-size: 2rem; }
    
    /* Imagen del staff un poco más chica en móviles */
    .staff-img-container { width: 130px; height: 130px; }
    .staff-grid { gap: 30px 10px; }

    .contact-layout { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .info-item { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .info-item i { margin-top: 0; }
    
    .map-container { order: 2; width: 100%; }
    .map-container iframe { height: 300px; }
    .contact-info { order: 1; }

    .main-footer { padding: 50px 0 20px; }
    .whatsapp-float { width: 55px; height: 55px; bottom: 20px; right: 20px; font-size: 30px; }
}