/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    /* Paleta de Colores "Medical Luxury" */
    --primary: #0F2C59;       /* Azul Profundo (Autoridad Médica) */
    --secondary: #3E6D9C;     /* Azul Claro (Calma/Salud) */
    --gold: #D4AF37;          /* Dorado (Esperanza/Calidad) */
    --red-christmas: #C92C2C; /* Rojo Navidad (Detalles sutiles) */
    
    /* Neutrales */
    --text: #333333;
    --text-light: #666666;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    
    /* Tipografía */
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Lato', sans-serif;
    
    /* Efectos */
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --radius: 12px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.6;
    background-color: var(--white);
    position: relative; /* Para la nieve */
}

/* Tipografía Global */
h1, h2, h3, h4, h5 {
    font-family: var(--font-head);
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* Clases Utilitarias */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light); }
.highlight { color: var(--gold); }
.w-100 { width: 100%; }
.mt-5 { margin-top: 3rem; }
.shadow-lg { box-shadow: var(--shadow); }

/* =========================================
   2. BOTONES
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-gold {
    background: var(--gold);
    color: var(--white);
}
.btn-gold:hover {
    background: #b5952f;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid var(--white);
    color: var(--white);
}
.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-outline-dark {
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline-dark:hover {
    background: var(--primary);
    color: var(--white);
}

/* Animación de Pulso (Llamada a la acción) */
.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* =========================================
   3. HEADER & NAVEGACIÓN
   ========================================= */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 3px solid var(--gold); /* Toque Navideño/Premium */
    backdrop-filter: blur(10px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo-img { height: 60px; }

.main-nav ul {
    display: flex;
    gap: 25px;
    align-items: center;
}

.main-nav a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
}

.main-nav a:hover { color: var(--gold); }

/* Botón destacado en menú */
.nav-cta {
    background: var(--primary);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: 20px;
}
.nav-cta:hover { background: var(--gold); }

.hamburger-menu {
    display: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* =========================================
   4. HERO SECTION (PORTADA)
   ========================================= */
.hero-section {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 80px; /* Compensar header fijo */
    color: var(--white);
    text-align: center;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 44, 89, 0.85), rgba(15, 44, 89, 0.7));
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    z-index: 1;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Badge Navideño */
.badge-christmas {
    display: inline-block;
    background: var(--red-christmas);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    margin-bottom: 25px;
    box-shadow: 0 0 15px rgba(201, 44, 44, 0.6);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* =========================================
   5. SECCIONES: IDENTIDAD & PADECIMIENTOS
   ========================================= */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.section-subtitle {
    display: block;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.section-title { font-size: 2.5rem; }

.lead-text {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 20px;
    font-weight: 400;
}

.features-list { margin-top: 30px; }
.feature-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}
.feature-item i {
    font-size: 2rem;
    color: var(--secondary);
    background: rgba(62, 109, 156, 0.1);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Imágenes apiladas (Efecto moderno) */
.stacked-images {
    position: relative;
    height: 450px;
}
.img-main {
    width: 80%;
    border-radius: var(--radius);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    border: 5px solid var(--white);
}
.img-secondary {
    width: 80%;
    border-radius: var(--radius);
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 1;
    opacity: 0.9;
    box-shadow: var(--shadow);
}

/* Grid de Tarjetas (Padecimientos) */
.grid-3-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.card-img { height: 220px; overflow: hidden; }
.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}
.service-card:hover .card-img img { transform: scale(1.1); }

.card-content { padding: 30px; }
.card-content h3 { font-size: 1.4rem; margin-bottom: 10px; }

/* =========================================
   6. MÉTODO (DISEÑO ZIG-ZAG)
   ========================================= */
.method-section {
    background: var(--primary);
    color: var(--white);
    position: relative;
}
.method-section h2 { color: var(--white); }

.method-row {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 80px;
}
.method-row:last-child { margin-bottom: 0; }
.method-row.reverse { flex-direction: row-reverse; }

.method-content { flex: 1; }
.method-content h3 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 20px;
}
.method-content p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.check-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}
.check-list i { color: var(--gold); }

.method-visual {
    flex: 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}
.method-visual img { width: 100%; height: auto; display: block; }

/* Video Container */
.video-container video {
    width: 100%;
    border-radius: var(--radius);
    display: block;
}
.video-caption {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    padding-top: 10px;
    opacity: 0.7;
    font-style: italic;
}

/* =========================================
   7. INSTALACIONES (GALERÍA CORREGIDA)
   ========================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Fila con altura fija para uniformidad */
    grid-auto-rows: 250px; 
    gap: 15px;
    margin-top: 50px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

/* SOLUCIÓN CLAVE PARA IMÁGENES NO DEFORMADAS */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el contenedor perfectamente */
    object-position: center;
    transition: transform 0.6s ease;
}

.gallery-item:hover img { transform: scale(1.1); }

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 44, 89, 0.9), transparent 60%);
    color: var(--white);
    padding: 20px;
    opacity: 0;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.gallery-item:hover .overlay { opacity: 1; }
.overlay h4 { color: var(--gold); margin: 0; font-size: 1.2rem; }

/* =========================================
   8. EQUIPO DE TRABAJO (STAFF)
   ========================================= */
.staff-category { margin-bottom: 60px; }

/* Título de Categoría (Ej: Dirección, Espiritual...) */
.staff-category h3 {
    border-bottom: 3px solid var(--gold);
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 40px;
    font-size: 1.8rem;
    color: var(--secondary);
}

/* Grid Principal (Directores, Clínicos) */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 40px; /* Espacio generoso para no amontonar */
}

/* Grid Secundario (Administrativos - Más compacto) */
.small-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* Tarjeta Estándar */
.staff-card {
    background: var(--white);
    padding: 30px 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: 0.3s;
    border: 1px solid #eee;
}
.staff-card:hover {
    transform: translateY(-8px);
    border-bottom: 4px solid var(--gold);
}

.staff-photo {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--bg-light);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-card h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary);
}
.role {
    display: block;
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
}

/* Tarjeta Mini (Para Coordinadores/Admin) */
.staff-card.mini {
    padding: 20px 15px;
}
.staff-card.mini .staff-photo {
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    border-width: 3px;
}
.staff-card.mini h4 { font-size: 1rem; }
.staff-card.mini .role { font-size: 0.85rem; }

/* =========================================
   9. TESTIMONIOS & DONACIONES
   ========================================= */
.testimonials-section {
    background: linear-gradient(rgba(15, 44, 89, 0.92), rgba(15, 44, 89, 0.92)), url('assets/img/hero/fachada_principal.jpeg');
    background-size: cover;
    background-attachment: fixed;
    color: var(--white);
    padding: 100px 0;
}

.testimonials-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    padding: 40px 30px;
    border-radius: var(--radius);
    max-width: 350px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: 0.3s;
}
.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.user-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--gold);
}
.testimonio-text {
    font-style: italic;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}
.stars { color: var(--gold); margin-bottom: 15px; letter-spacing: 3px; }

cite {
    font-weight: 700;
    display: block;
    font-size: 1.1rem;
}
.rehab-time {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

/* Caja de Donaciones */
.donation-card {
    background: var(--white);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px dashed var(--gold);
    display: inline-block;
    max-width: 800px;
    margin-top: 20px;
}
.icon-gold { color: var(--gold); margin-bottom: 20px; }

/* =========================================
   10. CONTACTO & FORMULARIO
   ========================================= */
.contact-layout { align-items: flex-start; }
.contact-info-box { padding-right: 30px; }
.contact-info-box h2 { margin-bottom: 25px; }

.info-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}
.info-item i {
    font-size: 1.5rem;
    color: var(--gold);
    background: var(--bg-light);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}
.info-item h5 { margin-bottom: 5px; color: var(--primary); font-size: 1.1rem; }
.info-item p { margin: 0; color: var(--text-light); }

.social-box { margin-top: 40px; }
.social-btn {
    display: inline-flex;
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-right: 15px;
    font-size: 1.4rem;
    transition: 0.3s;
}
.social-btn:hover { background: var(--primary); color: var(--white); }
.social-btn.whatsapp:hover { background: #25d366; }
.social-btn.facebook:hover { background: #3b5998; }

.contact-form-container {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    border-top: 6px solid var(--gold);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.contact-form-container h3 { text-align: center; margin-bottom: 30px; }

.input-group { margin-bottom: 25px; }
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}
.input-group input, .input-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: #fcfcfc;
    transition: 0.3s;
}
.input-group input:focus, .input-group textarea:focus {
    border-color: var(--secondary);
    background: var(--white);
    outline: none;
    box-shadow: 0 0 8px rgba(62, 109, 156, 0.15);
}

/* Mensaje de Estado Formulario */
.status-msg {
    margin-top: 20px;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
    padding: 10px;
    border-radius: 6px;
}
.status-msg.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-msg.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =========================================
   11. FOOTER & EXTRAS
   ========================================= */
.main-footer {
    background: #051021;
    color: #b0b0b0;
    padding: 60px 0 30px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-logo h4 {
    color: var(--white);
    margin-bottom: 10px;
    font-size: 1.5rem;
}
.footer-links { margin: 30px 0; }
.footer-links a {
    color: #b0b0b0;
    margin: 0 15px;
    font-size: 0.95rem;
}
.footer-links a:hover { color: var(--gold); }
.copyright { font-size: 0.85rem; opacity: 0.6; }

/* Botón Flotante WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 999;
    transition: transform 0.3s;
}
.whatsapp-float:hover { transform: scale(1.1); }

/* =========================================
   12. MEDIA QUERIES (RESPONSIVE)
   ========================================= */
@media (max-width: 992px) {
    .grid-2-col, .method-row, .method-row.reverse, .contact-layout {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    
    .hero-content h1 { font-size: 2.8rem; }
    
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-item.large { grid-column: span 1; grid-row: span 1; }
    
    .stacked-images { height: 350px; margin-top: 40px; }
    .img-main, .img-secondary { position: relative; width: 100%; margin-bottom: 20px; }
    
    .contact-info-box { padding-right: 0; margin-bottom: 50px; }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 80px; left: 0; width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 30px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    .main-nav.active { display: flex; }
    .main-nav ul { flex-direction: column; width: 100%; gap: 20px; }
    
    .hamburger-menu { display: block; }
    
    .hero-buttons { flex-direction: column; }
    .section-title { font-size: 2rem; }
    
    .gallery-grid { grid-template-columns: 1fr; }
}

/* =========================================
   13. EFECTO NIEVE (NAVIDAD)
   ========================================= */
.snowflake {
    position: fixed;
    top: -10px;
    color: #fff;
    font-size: 1em;
    pointer-events: none;
    z-index: 9999;
    animation: fall linear infinite;
    text-shadow: 0 0 2px rgba(0,0,0,0.3);
}

@keyframes fall {
    to { transform: translateY(105vh); }
}