:root {
    --primary: #00b0eb; /* Celeste Vitalis */
    --secondary: #b3d6fe;
    --dark-blue: #01579B;
    --bg-color: #f4faff;
    --white: #ffffff;
    --text-gray: #455A64;
    --success: #66BB6A;
    --error: #EF5350;
}

body { 
    font-family: 'Segoe UI', Roboto, sans-serif; 
    margin: 0; 
    background-color: var(--bg-color); 
    color: var(--text-gray); 
    overflow-x: hidden; 
}

/* =========================================
   1. NAVEGACIÓN (HEADER & NAV)
========================================= */
nav { 
    background: var(--white); 
    padding: 15px 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.logo-container { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 50px; width: auto; }

.nav-links a { 
    text-decoration: none; 
    color: var(--text-gray); 
    margin-left: 20px; 
    font-weight: 600; 
    font-size: 0.9rem; 
    transition: 0.3s; 
}

.nav-links a:hover { color: var(--primary); }

/* Separadores de menú verticales (Solo Escritorio) */
@media (min-width: 769px) {
    .nav-links a {
        position: relative;
        padding-left: 15px !important; 
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .nav-links a:not(:last-child)::after {
        content: "";
        position: absolute;
        right: 0; 
        top: 50%; 
        transform: translateY(-50%); 
        height: 16px; 
        width: 2px; 
        background-color: #ccc; 
    }
}

/* Menú Hamburguesa */
.hamburger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--primary);
}

/* =========================================
   2. CABECERA PRINCIPAL (HERO SECTION)
========================================= */
.hero {
    background-image: linear-gradient(rgba(0, 51, 102, 0.75), rgba(0, 51, 102, 0.75)), url('img/fondo-clinica.jpg');
    background-size: cover; 
    background-position: center; 
    background-attachment: fixed; /* Efecto Parallax */
    color: white;
    text-align: center;
    min-height: 75vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem; 
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.7); 
    max-width: 900px;
    line-height: 1.1;
    font-weight: 800;
}

.hero p {
    font-size: 1.5rem; 
    margin-bottom: 30px;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
    font-weight: 500;
}

.hero .btn-whatsapp {
    display: inline-block;
    background-color: #00b0eb; 
    color: white;
    padding: 15px 40px; 
    font-size: 1.2rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 176, 235, 0.5);
    transition: all 0.3s ease;
    border: 2px solid transparent; 
}

.hero .btn-whatsapp:hover {
    background-color: white;
    color: #00b0eb; 
    border-color: #00b0eb;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 176, 235, 0.7);
}

/* =========================================
   3. ESTRUCTURA GENERAL DE SECCIONES
========================================= */
section { padding: 60px 5%; }
.section-title { text-align: center; color: var(--dark-blue); margin-bottom: 40px; font-size: 2rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }

/* =========================================
   4. TARJETAS DE ESPECIALIDADES & CARRUSELES
========================================= */
.service-card { 
    background: var(--white); 
    padding: 30px 30px 20px 30px; /* Ajuste inferior */
    border-radius: 15px; 
    border-bottom: 4px solid var(--primary); 
    transition: transform 0.3s; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
}

.service-card:hover { transform: translateY(-5px); }
.service-card h3 { color: var(--primary); margin-top: 20px; padding: 0 20px; }
.service-card ul { padding-left: 20px; line-height: 1.6; font-size: 0.95rem; padding: 0 20px; }

/* Mini Carrusel */
.mini-carousel {
    position: relative;
    width: 100%;
    height: 400px; 
    overflow: hidden;
    margin-bottom: -10px; /* Acorta distancia con el título */
}

.mini-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.mini-carousel-track img, .mini-carousel-track video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: top center; 
    flex-shrink: 0; 
    background-color: #f4faff;
}

/* Botones del Carrusel */
.mini-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;  
    height: 45px; 
    border-radius: 50%; 
    background: rgba(255, 255, 255, 0.85); 
    border: none;
    color: var(--dark-blue); 
    font-size: 1.4rem; 
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 2;
    padding: 0; 
}

/* --- MAGIA PARA OCULTAR FLECHAS (Solo en PC) --- */
@media (hover: hover) {
    /* Ocultamos los botones por defecto si el dispositivo usa mouse */
    .mini-btn {
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    /* Al pasar el mouse sobre el carrusel, aparecen suavemente */
    .mini-carousel:hover .mini-btn {
        opacity: 1;
        visibility: visible;
    }
}

.mini-btn:hover {
    background: white; 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25); 
    transform: translateY(-50%) scale(1.05); 
}

.mini-btn.prev { left: 15px; } 
.mini-btn.next { right: 15px; }

/* =========================================
   5. TARJETAS DEL EQUIPO MÉDICO
========================================= */
.team-card {
    background: white;
    border-radius: 20px;
    overflow: hidden; 
    box-shadow: 0 10px 25px rgba(0, 51, 102, 0.08); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    border: 1px solid #eef4fb; 
}

.team-card:hover {
    transform: translateY(-8px); 
    box-shadow: 0 15px 35px rgba(0, 51, 102, 0.15);
}

.team-photo {
    width: 100%;
    height: 250px; /* Volvemos a tu altura original */
    object-fit: contain; /* Vuelve a mostrar la foto completa sin recortar */
    background-color: #f4faff; /* El fondo suave para rellenar los lados */
    border-bottom: 4px solid var(--primary); 
}

.team-info { padding: 25px 20px; }

.team-name {
    font-size: 1.3rem;
    color: var(--dark-blue);
    font-weight: 800;
    margin-bottom: 5px;
}

.team-role {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.team-info p { font-size: 0.9rem; color: #666; line-height: 1.5; margin: 0; }

/* =========================================
   6. PÁGINA DE EDUCACIÓN & QUIZ (JUEGO)
========================================= */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.video-card { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: transform 0.3s; }
.video-card:hover { transform: translateY(-5px); }

.video-wrapper { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; background: #000; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-wrapper.vertical { padding-bottom: 177.77%; } /* Reels/TikTok */
.instagram-media { min-width: 100% !important; margin: 0 !important; }

.video-info { padding: 20px; }
.video-info h4 { color: var(--dark-blue); margin: 0 0 10px 0; }

/* --- NOTICIAS VITALIS (RESTAURADO) --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f4faff;
}

.news-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-tag {
    background-color: var(--secondary);
    color: var(--dark-blue);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    align-self: flex-start;
    margin-bottom: 10px;
}

.news-content h4 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--dark-blue);
}

.read-more {
    margin-top: auto; 
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Quiz */
#quiz-section { background: #e1f5fe; }
.game-container { max-width: 500px; margin: 0 auto; background: var(--white); padding: 20px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,176,235, 0.15); }
.option-btn { width: 100%; padding: 15px; margin-bottom: 10px; border-radius: 10px; border: 2px solid #b3e5fc; background: #f8fdff; cursor: pointer; text-align: left; transition: 0.2s; }
.option-btn.correct { background: #e8f5e9; border-color: var(--success); color: #2e7d32; }
.option-btn.wrong { background: #ffebee; border-color: var(--error); color: #c62828; }
.hidden { display: none !important; }
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 25px; border-radius: 50px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 10px; font-size: 1rem; }
input { width: 100%; padding: 12px; margin-bottom: 10px; border: 2px solid #b3e5fc; border-radius: 8px; box-sizing: border-box; }

/* =========================================
   7. PIE DE PÁGINA (FOOTER)
========================================= */
.site-footer { background-color: var(--dark-blue); color: #ffffff; padding: 50px 5% 20px; margin-top: 40px; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; max-width: 1100px; margin: 0 auto; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.footer-section h3 { color: var(--secondary); margin-bottom: 20px; font-size: 1.2rem; }
.footer-section p { font-size: 0.95rem; line-height: 1.6; color: #d1e5ff; margin-bottom: 10px; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section ul li { margin-bottom: 12px; }
.footer-section ul li a { color: #d1e5ff; text-decoration: none; transition: color 0.3s ease; }
.footer-section ul li a:hover { color: #ffffff; text-decoration: underline; }

.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a { color: white; background: rgba(255, 255, 255, 0.1); width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center; transition: all 0.3s ease; }
.social-icons a:hover { background: var(--secondary); color: var(--dark-blue); transform: translateY(-3px); }
.footer-bottom { text-align: center; padding-top: 20px; font-size: 0.85rem; color: #8bbaf0; }

/* =========================================
   8. BOTÓN FLOTANTE WHATSAPP "PRO" (Con Latido)
========================================= */
@keyframes pulso-wsp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.btn-flotante-wsp {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 120px;
    right: 20px;
    background: linear-gradient(45deg, #25d366, #128c7e);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    animation: pulso-wsp 2s infinite;
}

.btn-flotante-wsp:hover {
    transform: scale(1.1) translateY(-5px);
    background: linear-gradient(45deg, #128c7e, #25d366);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
    animation: none;
}

.btn-flotante-wsp svg { width: 32px; height: 32px; fill: white; }

/* =========================================
   9. MEDIA QUERIES (AJUSTES PARA CELULARES)
========================================= */
@media (max-width: 768px) {
    /* Menú Móvil */
    .nav-links {
        display: none; 
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; 
        left: 0;
        background-color: var(--white);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        padding: 20px 0;
        text-align: center;
    }
    .nav-links.active { display: flex; }
    .nav-links a { margin: 15px 0; display: block; font-size: 1.2rem; }
    .hamburger { display: block; }
    
    /* Hero Móvil */
    .hero { min-height: 60vh; background-attachment: scroll; }
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1.2rem; }
    .hero .btn-whatsapp { padding: 12px 30px; font-size: 1rem; }
    
    /* WhatsApp Móvil */
    .btn-flotante-wsp { width: 55px; height: 55px; bottom: 90px; right: 20px; }
    .btn-flotante-wsp svg { width: 28px; height: 28px; }
}

/* Esto marcará de celeste y negrita la página en la que estamos */
.nav-links a.active { 
    color: var(--primary); 
    font-weight: bold; 
}
