/* =========================================
   VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
html {
    scroll-behavior: smooth;
}

:root {
    --primary: #0c2340;
    --secondary: #003366; 
    --accent: #c5a059; 
    --bg-light: #f4f7f6;
    --text: #333;
    --white: #ffffff;
}

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

body { 
    font-family: 'Inter', sans-serif; 
    color: var(--text); 
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.section-padding { padding: 80px 0; scroll-margin-top: 75px; }
.bg-light { background-color: var(--bg-light); }
.text-white { color: var(--white); }
.mt-2 { margin-top: 2rem; }

/* =========================================
   MENÚ DE NAVEGACIÓN Y HAMBURGUESA
   ========================================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 10px 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: flex-end; 
}

.navbar {
    width: 100%; 
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6); 
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes efectoTimbraje {
    0%, 45% { filter: brightness(1) drop-shadow(0px 0px 0px transparent); transform: scale(1); }
    50% { filter: brightness(0) drop-shadow(0px 4px 15px rgba(197, 160, 89, 0.8)); transform: scale(0.92); }
    55%, 100% { filter: brightness(1) drop-shadow(0px 0px 0px transparent); transform: scale(1); }
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px; 
    text-decoration: none;
}

.logo-img {
    height: 80px; 
    width: auto;
    transform-origin: center left; 
    transition: all 0.4s ease;
    animation: efectoTimbraje 3s infinite ease-in-out;
}

.logo-text-header {
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.15;
    border-left: 2px solid var(--accent);
    padding-left: 15px; 
    transition: all 0.4s ease;
}

/* --- ESTADO SCROLLED (MENÚ CÁPSULA) --- */
.main-header.scrolled .navbar {
    width: calc(100% - 100px); 
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px 30px; 
}

.main-header.scrolled .logo-img {
    height: 55px; 
}

.main-header.scrolled .logo-text-header {
    font-size: 0.85rem;
}

/* --- ENLACES NAV --- */
.nav-links { display: flex; list-style: none; gap: 25px; align-items: center; }
.mobile-only { display: none; }

.nav-links a { 
    color: var(--primary); 
    font-weight: 700; 
    text-decoration: none; 
    font-size: 0.85rem; 
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease; 
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

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

/* =========================================
   ESTILOS DE BOTONES Y CTAs
   ========================================= */
.btn-primary { 
    background: var(--secondary); 
    color: var(--white); 
    padding: 12px 25px; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: 700; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.btn-primary:hover { 
    background: var(--white); 
    color: var(--secondary); 
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 51, 102, 0.2);
}

.btn-secondary { 
    background: var(--white); 
    color: var(--primary); 
    padding: 15px 30px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: 700; 
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-secondary:hover { 
    background: var(--accent); 
    color: var(--white);
    transform: scale(1.05);
}

.btn-outline { 
    border: 2px solid var(--white); 
    color: var(--white); 
    padding: 13px 30px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: 700; 
    margin-left: 10px; 
    transition: all 0.3s ease;
}

.btn-outline:hover { 
    background: rgba(255, 255, 255, 0.1); 
    border-color: var(--accent);
    color: var(--accent);
}

/* =========================================
   HERO SECTION 
   ========================================= */
.hero { 
    position: sticky;
    top: 0; 
    z-index: 1; 
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center; 
    color: var(--white);
    overflow: hidden; 
}

.hero-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(12, 35, 64, 0.7); z-index: 1; }

.hero-content { 
    position: relative; 
    z-index: 50; 
    max-width: 900px; 
    padding: 0 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 25px; 
    margin-top: 80px; 
}

/* CONTENEDOR REESTRUCTURADO EN 2 LÍNEAS */
.hero-badges-wrapper { 
    display: flex; 
    flex-direction: column;
    gap: 15px; 
    align-items: center;
    margin-top: 30px;
}

.hero-badges-row {
    display: flex; 
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap;
    width: 100%;
}

.hero-schedule-badge {
    background: rgba(0, 51, 102, 0.85); 
    border: 1px solid var(--accent);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    gap: 8px; /* CORRECCIÓN: Separación visual entre el ícono y el texto */
    transition: all 0.3s ease;
}

.hero-schedule-badge:hover {
    background: var(--white); 
    color: var(--primary);
    transform: translateY(-3px);
}

.hero-content h2 { font-size: 3.5rem; text-shadow: 0px 2px 5px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.2rem; font-weight: 300; }

.slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; opacity: 0;
    animation: fadeSlider 20s infinite;
}
.slide:nth-child(1) { animation-delay: 0s; }
.slide:nth-child(2) { animation-delay: 5s; }
.slide:nth-child(3) { animation-delay: 10s; }
.slide:nth-child(4) { animation-delay: 15s; }
@keyframes fadeSlider {
    0% { opacity: 0; } 10% { opacity: 1; } 25% { opacity: 1; } 35% { opacity: 0; } 100% { opacity: 0; }
}

/* =========================================
   CONTENIDO Y SECCIONES
   ========================================= */
.content-wrapper { 
    position: relative; 
    z-index: 10; 
    background-color: var(--white); 
    box-shadow: 0 -10px 30px rgba(0,0,0,0.2); 
}

.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 10px; color: var(--primary); }
.section-subtitle { text-align: center; margin-bottom: 50px; color: #666; }

.staff {
    background: linear-gradient(135deg, #ffffff 0%, #eef2f5 100%);
}

.grid-staff { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.staff-card { 
    background: var(--white); 
    padding: 25px; 
    border-radius: 10px; 
    border-left: 5px solid var(--secondary);
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}
.staff-card:hover {
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
}
.staff-header { background: var(--primary); color: var(--white); padding: 10px; margin-bottom: 15px; border-radius: 3px; font-weight: 700; display: flex; align-items: center;}

.staff-header i { 
    margin-right: 12px; 
    color: var(--white); 
    background-color: var(--accent);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.staff-card ul { list-style: none; }
.staff-card li { 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 10px;
}
.staff-card li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.staff-details { display: flex; flex-direction: column; }
.staff-name { font-size: 0.95rem; color: var(--primary); }
.staff-role { font-size: 0.8rem; color: #666; margin-top: 2px; }
.staff-card a {
    color: var(--secondary);
    text-decoration: none;
    display: inline-flex;
    font-size: 1.2rem;
    transition: transform 0.3s ease, color 0.3s ease;
}
.staff-card a:hover { color: var(--accent); transform: scale(1.15); }
.email-area { font-size: 0.85rem; color: #555; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.email-area a { color: var(--secondary); display: inline-flex; font-size: 1.2rem; transition: transform 0.3s ease, color 0.3s ease; }
.email-area a:hover { color: var(--accent); transform: scale(1.15); }

.grid-turnos { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; }
.card { background: var(--white); padding: 30px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.card-destacada { background: var(--secondary); color: var(--white); border-top: 4px solid var(--accent); }

.list-turnos { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    list-style: none; 
    gap: 12px; 
    margin-top: 20px;
}
.list-turnos li { 
    background: rgba(255,255,255,0.1); 
    padding: 15px 10px; 
    border-radius: 8px; 
    font-weight: 600; 
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.list-turnos li:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.2);
}

.mes-activo {
    background: var(--accent) !important;
    color: var(--primary) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    border: 2px solid var(--white) !important;
    z-index: 2;
}
.mes-activo::after {
    content: "TURNO ACTUAL";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.grid-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.grid-links a { background: var(--white); padding: 15px; border-radius: 5px; text-align: center; text-decoration: none; color: var(--primary); font-weight: 600; border: 1px solid #ddd; transition: all 0.3s ease;}
.grid-links a:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* CONTACTO */
.contacto { background: var(--bg-light); }
.grid-contacto { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.form-container { padding: 25px; background: var(--white); border-radius: 8px; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; }
.btn-submit { width: 100%; border: none; cursor: pointer; background: var(--secondary); color: white; padding: 15px; font-weight: 700; border-radius: 5px; transition: 0.3s; }
.btn-submit:hover { background: var(--primary); transform: translateY(-2px); }

/* FOOTER */
.main-footer { background: var(--primary); color: var(--white); padding: 60px 0 20px; }
.grid-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.footer-copyright { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 20px; text-align: center; font-size: 0.8rem; }

/* MODALES */
.modal-overlay {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(12, 35, 64, 0.8); backdrop-filter: blur(5px);
    align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease;
}
.modal-overlay.show { display: flex; opacity: 1; }
.modal-content {
    background-color: var(--white); padding: 30px; border-radius: 12px; max-width: 500px; width: 90%;
    position: relative; transform: translateY(-30px); transition: 0.3s;
}
.modal-overlay.show .modal-content { transform: translateY(0); }
.close-modal { position: absolute; top: 15px; right: 20px; font-size: 2rem; cursor: pointer; color: #999; }

/* =========================================
   RESPONSIVE DESIGN (BLINDADO Y CORREGIDO)
   ========================================= */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        position: absolute; top: 100%; left: 0; width: 100%;
        background: white; flex-direction: column; padding: 20px;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); transition: 0.4s;
    }
    .nav-links.active { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
    .grid-turnos, .grid-footer, .grid-contacto { grid-template-columns: 1fr; }
    .hero-content h2 { font-size: 2.2rem; margin-top: 15px; }

    .navbar { padding: 10px 15px; }
    
    .logo-img { height: 60px; }
    .logo-text-header { font-size: 0.8rem; }
    .navbar > .btn-primary { display: none; }

    .hero-actions { 
        display: flex;
        flex-direction: column; 
        width: 100%; 
        max-width: 260px; 
        gap: 15px; 
        margin: 0 auto;
    }
    .hero-actions .btn-secondary, 
    .hero-actions .btn-outline { 
        margin-left: 0; 
        width: 100%; 
        padding: 12px;
        font-size: 0.9rem;
    }

    .hero-badges-wrapper {
        width: 100%;
        max-width: 280px;
        margin: 20px auto 30px auto;
        gap: 10px;
    }
    
    .hero-badges-row {
        flex-direction: column;
        gap: 10px;
    }

    .hero-schedule-badge { 
        width: 100%; 
        justify-content: center; 
        font-size: 0.75rem; 
        padding: 6px 15px; 
    }
}