/* =========================================
   VARIABLES Y RESET
   ========================================= */
:root {
    --primary: #0e4c5e;
    --accent: #A4D138;
    --light: #f4f9f9;
    --white: #ffffff;
    --text: #333333;
    --header-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--light);
    overflow-x: hidden; 
    overflow-y: auto;
}

h1, h2, h3 { font-family: 'Montserrat', sans-serif; }

p, li {
    line-height: 1.9;
    margin-bottom: 10px;
}

/* =========================================
   HEADER & NAV
   ========================================= */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5%; height: var(--header-height);
    background: var(--white); position: fixed; width: 100%; top: 0; 
    z-index: 1000; box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; display: flex; align-items: center;}
.logo span { color: var(--accent); }
.logo-img { height: 50px; margin-right: 10px; }

.navbar a { text-decoration: none; color: var(--primary); margin-left: 2rem; font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.navbar a:hover { color: var(--accent); }

.btn-header { background: var(--primary); color: var(--white) !important; padding: 0.6rem 1.5rem; border-radius: 50px; text-decoration: none; }
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--primary); }

/* Oculto por defecto en escritorio */
.menu-socials { display: none; }
/* =========================================
   ESTILOS ZIG-ZAG (MISIÓN Y VISIÓN)
   ========================================= */

.zigzag-wrapper {
    display: flex;
    flex-direction: column;
    gap: 80px; /* Separación amplia entre Misión y Visión */
    max-width: 1200px;
    margin: 0 auto;
}

.zigzag-row {
    display: flex;
    align-items: center; /* Centrado vertical */
    gap: 50px; /* Espacio entre texto y foto */
}

/* Títulos bonitos con subrayado verde */
.zigzag-title {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
}

.zigzag-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent); /* Tu verde manzana */
    margin-top: 5px;
    border-radius: 2px;
}

.zigzag-text {
    flex: 1; /* Ocupa mitad del espacio */
}

.zigzag-text p {
    margin-bottom: 15px;
    text-align: justify; /* Texto justificado para que se vea limpio */
    font-size: 1.1rem;
    color: #444;
}

.zigzag-img {
    flex: 1; /* Ocupa la otra mitad */
    position: relative;
}

.zigzag-img img {
    width: 100%;
    height: 350px; /* Altura fija para que se vean uniformes */
    object-fit: cover; /* Recorta la imagen sin deformarla */
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.zigzag-img img:hover {
    transform: translateY(-5px); /* Efecto flotante al pasar mouse */
}
/* Esto hará que todas las negritas dentro de los párrafos se vean verdes */
p strong {
    color: var(--accent); /* Tu color verde manzana */
    font-weight: 700;
}
/* --- RESPONSIVO (MÓVIL) --- */
@media (max-width: 768px) {
    .zigzag-wrapper {
        gap: 50px;
    }

    .zigzag-row {
        flex-direction: column-reverse; /* Primero la imagen, luego el texto en móvil */
        text-align: center;
        gap: 20px;
    }

    /* Excepción: Para la fila "reverse" (Visión), mantenemos el orden natural columna */
    .zigzag-row.reverse {
        flex-direction: column; 
    }

    .zigzag-title::after {
        margin: 5px auto; /* Centrar la línea verde */
    }

    .zigzag-text p {
        text-align: left; /* En móvil a veces es mejor a la izquierda o centro */
    }

    .zigzag-img img {
        height: 250px; /* Más pequeña en celular */
    }
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative; height: 100vh; width: 100%;
    display: flex; align-items: center; justify-content: center;
    text-align: center; color: var(--white); overflow: hidden;
}

.hero-video {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: -1; filter: blur(6px); transform: scale(1.1);
}
.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(14, 76, 94, 0.6); z-index: 0; }
.hero-content { position: relative; z-index: 3; padding: 0 20px; animation: fadeInSimple 1.5s ease forwards; }
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; animation: fadeInSimple 1.5s ease forwards; }
.hero h1 span { color: var(--accent);}

/* =========================================
   ESTRUCTURA GENERAL SECCIONES
   ========================================= */
.section-padding { 
    padding: 100px 5%; 
    min-height: 70vh;
}

.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.5rem; color: var(--primary); }

.nosotros-container { display: flex; flex-wrap: wrap; gap: 4rem; align-items: center; }
.video-col, .text-col { flex: 1; min-width: 300px; }

/* =========================================
   CARRUSEL / EQUIPO
   ========================================= */
.equipo-section { padding: 100px 5%; position: relative; }
.team-title { text-align: center; margin-bottom: 3rem; font-size: 2.5rem; color: var(--primary); }
.carousel-container { position: relative; max-width: 1400px; margin: 0 auto; }

.team-scroller {
    display: flex; gap: 20px; overflow-x: auto; scroll-behavior: smooth;
    padding: 20px 5px; scrollbar-width: none;
}
.team-scroller::-webkit-scrollbar { display: none; }

.team-scroller .team-card {
    flex: 0 0 calc(25% - 15px); min-width: 250px; height: 400px;
    position: relative; border-radius: 10px; overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); background: var(--white);
}
.team-scroller .team-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.team-scroller .team-card:hover img { transform: scale(1.1); }

.member-info {
    position: absolute; bottom: 20px; left: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.95); padding: 15px;
    border-left: 5px solid var(--accent); border-radius: 4px;
}
.member-info h4 { color: var(--primary); margin: 0; font-size: 1.1rem; }
.member-info p { font-size: 0.85rem; color: #666; margin: 0; }

.nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: var(--white); color: var(--primary); border: 1px solid #ddd;
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer; z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center;
}
.nav-btn.prev { left: -25px; }
.nav-btn.next { right: -25px; }

/* 
   TRATAMIENTOS
    */
.treatments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.treatment-box {
    background: transparent; padding: 0; border: none;
    box-shadow: none; border-radius: 0; cursor: pointer;
    transition: transform 0.3s ease;
}

.treatment-box:hover {
    transform: translateY(-10px);
    box-shadow: none; border-color: transparent;
}

.icon-square {
    width: 120px; height: 120px;
    background-color: #3e4a45; color: #ffffff;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3.5rem; margin: 0 auto 1.5rem;
    transition: background-color 0.3s ease;
}

.icon-square img {
    width: 60px; height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.treatment-box:hover .icon-square {
    background-color: var(--primary);
    transform: none;
    color: var(--white);
}

.treatment-box h3 {
    text-transform: uppercase;
    color: #3e4a45;
    font-weight: 800;
    margin-top: 10px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}
/* =========================================
   OPCIÓN 2: DESLIZAR DESDE ABAJO (PANTALLA COMPLETA)
   ========================================= */

/* ESTADO INICIAL (Cerrado) */
#treatment-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    z-index: 9999;
    background: #fff; /* O tu color de fondo */
    overflow-y: auto;
    
    /* LA CLAVE: No uses display:none */
    opacity: 0;
    visibility: hidden; 
    
    /* Esta línea hace la magia de la suavidad (0.5 segundos) */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* ESTADO ABIERTO (Visible) */
#treatment-modal.active {
    opacity: 1;
    visibility: visible;
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1); /* Un movimiento más "natural" */
}

/* ESTADO ACTIVO (Abierto) */
#treatment-modal.active {
    opacity: 1;
    visibility: visible;
    /* 4. Sube a su posición original (0%) cubriendo la pantalla */
    transform: translateY(0%);
}


/* =========================================
   SUCURSALES
   ========================================= */
.clinics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; }
.clinic-card { border: 1px solid #eee; border-radius: 15px; overflow: hidden; background: var(--white); }

/* =========================================
   MODALES (Overlay + Dialog Nativo)
   ========================================= */

/* Estilo Overlay (Div) */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: white; z-index: 20000; overflow-y: auto; 
    display: none; opacity: 0; transition: opacity 0.4s ease; 
}
.modal-overlay.active { display: block; opacity: 1; }

.close-modal { 
    position: fixed; top: 20px; right: 30px; font-size: 3rem; 
    background: none; border: none; color: white; cursor: pointer; 
    z-index: 20001; transition: transform 0.3s; 
}
.close-modal:hover { transform: rotate(90deg); color: var(--secondary); }

.modal-hero { 
    height: 50vh; background-size: cover; background-position: center; 
    position: relative; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; text-align: center; 
}
.modal-hero-overlay { 
    position: absolute; top:0; left:0; width:100%; height:100%; 
    background: rgba(0,0,0,0.6); 
}
.modal-hero h1 { 
    position: relative; z-index: 2; color: #ffffff !important; 
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); font-size: 3.5rem; 
}

.modal-body { 
    display: flex; flex-wrap: wrap; max-width: 1200px; 
    margin: 0 auto; padding: 5rem 5%; gap: 4rem; 
}
.modal-content-col { flex: 1; min-width: 300px; }

.modal-content-col h3 { color: var(--primary); margin-bottom: 1rem; font-size: 1.5rem; }
.modal-content-col p { font-size: 1rem; color: #555; }

.modal-side-image { 
    width: 100%; border-radius: 20px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    object-fit: cover; max-height: 400px; 
}

/* Estilo Dialog Nativo */
dialog.native-modal {
    width: 90%; max-width: 1200px; height: 85vh;
    border: none; border-radius: 20px; padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: var(--white);
    opacity: 0; transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
dialog.native-modal[open] {
    opacity: 1; transform: scale(1);
    display: flex; flex-direction: column;
}
dialog.native-modal::backdrop {
    background: rgba(14, 76, 94, 0.8);
    backdrop-filter: blur(5px);
}

/* =========================================
   FOOTER & REDES FLOTANTES
   ========================================= */
footer { background: #082d38; color: #bbd1d6; padding: 4rem 5% 1rem; }

.social-floating { 
    position: fixed; bottom: 30px; right: 30px; 
    display: flex; gap: 15px; z-index: 999; 
    background: rgba(255,255,255,0.9); padding: 10px 20px; border-radius: 50px; 
}
.social-btn { 
    width: 45px; height: 45px; background: #4a5d58; color: white; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    text-decoration: none; 
}
.social-btn:hover { background: var(--primary); }

.footer-pagos .iconos-grid {
    display: flex; flex-wrap: nowrap; gap: 15px; align-items: center; 
}
.footer-pagos .iconos-grid img {
    height: 40px; width: auto; margin: 0 5px; 
    vertical-align: middle; object-fit: contain;
}

/* =========================================
   ANIMACIONES
   ========================================= */

/* 1. Efecto Fade-In para Imágenes */
img.fade-img {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    will-change: opacity;
}
img.fade-img.loaded {
    opacity: 1;
}

/* 2. Efecto Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px); 
    transition: all 0.6s ease-out; 
    will-change: opacity, transform;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 
   RESPONSIVE (MÓVIL & TABLET) 
 */

@media (max-width: 768px) {

    /* --- 1. MENÚ Y NAVEGACIÓN --- */
    .menu-toggle { 
        display: block; 
        position: fixed; 
        top: 17.5px; 
        right: 5%; 
        z-index: 10002; 
        background: rgba(255,255,255,0.95); 
        width: 45px; height: 45px; border-radius: 50%;
        text-align: center; line-height: 45px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
        color: var(--primary);
    }

    /* --- 2. CONTENEDOR DEL MENÚ (La pantalla blanca) --- */
    .navbar { 
        display: flex; /* <--- IMPORTANTE: Esto faltaba para que el centrado funcione */
        position: fixed; 
        top: 0; 
        left: 0; 
        width: 100%; 
        height: 100vh;
        background-color: var(--white);
        display: flex; flex-direction: column; 
        justify-content: center; align-items: center;
        padding: 2rem; 
        z-index: 10001;
        opacity: 0; visibility: hidden; transition: all 0.3s ease-in-out;
    }
    
    .navbar.active { opacity: 1; visibility: visible; }
    
    .navbar a { 
        display: block; width: 100%; 
        text-align: center; font-size: 1.6rem; 
        margin: 1rem 0; font-weight: 600;
    }

    /* Botón destacado dentro del menú */
    .navbar .btn-header {
        display: inline-block; width: auto; 
        margin-top: 1.5rem; padding: 1rem 2.5rem;
        font-size: 1.2rem;
        text-decoration: none;
        
    }
    
    .nav-btn { display: none; } /* Ocultar flechas carrusel */

    /* --- 2. REDES SOCIALES (INTERNAS) --- */
    .social-floating { display: none !important; } 
    
    .menu-socials { 
        display: flex; gap: 20px; margin-top: 3rem; justify-content: center; 
    }
    
    .menu-socials .social-btn {
        width: 50px; height: 50px; border-radius: 50%;
        display: flex !important; align-items: center !important; justify-content: center !important;
        font-size: 1.4rem; box-shadow: 0 4px 10px rgba(0,0,0,0.08);
        background-color: var(--white); color: var(--primary); border: 1px solid #eee;
        position: relative; /* Reset de posición */
    }
    
    /* Colores de marca */
    .menu-socials .social-btn.fb { color: #1877F2; }
    .menu-socials .social-btn.ig { color: #E1306C; }
    .menu-socials .social-btn.wa { color: #25D366; }

    /* --- 3. AJUSTES DE CONTENIDO Y ESPACIADO --- */
    .hero h1 { font-size: 2.5rem; } 
    .section-header h2 { font-size: 2.2rem; }
    .section-padding { padding: 4rem 6%; }
    .nosotros-container, .treatments-grid { gap: 3rem; }
    .team-scroller .team-card { flex: 0 0 85%; }
    .footer-pagos .iconos-grid { justify-content: center; }

    /* Evitar que el texto toque los bordes */
    .modal-body, .section-padding {
        padding-left: 25px !important;
        padding-right: 25px !important;
    }
    .modal-body ul, .text-col ul { 
        padding-left: 20px; 
    }

    /* --- 4. MODALES Y POPUPS --- */
    dialog.native-modal { width: 95%; max-height: 90vh; }

    /* Botón cerrar visible sobre fotos */
    .close-modal {
        top: 15px; right: 15px;
        background-color: rgba(0, 0, 0, 0.6);
        width: 40px; height: 40px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        z-index: 20005;
    }
}

@keyframes fadeInSimple {
    from {
        opacity: 0;
        transform: translateY(20px); /* Un pequeño movimiento hacia arriba ayuda */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lista dentro del Modal */
.treatment-list-modal {
    list-style: none; /* Quita los puntos negros por defecto */
    padding: 0;
    margin-top: 10px;
    text-align: left; /* Alineado a la izquierda para leer mejor */
}

.treatment-list-modal li {
    padding: 8px 0;
    border-bottom: 1px solid #eee; /* Línea divisoria suave */
    color: #555;
    font-size: 1rem;
    position: relative;
    padding-left: 20px; /* Espacio para un icono personalizado */
}

/* Ponemos un check verde o puntito bonito antes de cada item */
.treatment-list-modal li::before {
    content: '✔'; /* O puedes usar '•' */
    color: var(--accent); /* Tu verde manzana */
    position: absolute;
    left: 0;
    font-weight: bold;
}
/* =========================================
   ARREGLO PARA MÓVIL: TÍTULOS LARGOS
   ========================================= */

/* Esta regla solo se activa en pantallas menores a 768px (tablets y celulares) */
@media (max-width: 768px) {
    
    #treatment-modal h1 {
        font-size: 1.8rem !important;
        overflow-wrap: break-word;
        margin-left: 10px;
        margin-right: 10px;
    }
    
}
/* =========================================
   JUSTIFICAR TEXTO DE MISIÓN Y VISIÓN
   ========================================= */

.zigzag-text p {
    /* 1. Esto fuerza que el texto llegue a ambos bordes */
    text-align: justify;
    
    hyphens: auto; 
    -webkit-hyphens: auto; /* Para que funcione en Safari) */
}