:root {
    --verde-militar: #892217;
    --verde-oscuro: #7d2020;
    --dorado: #b8945f;
    --blanco: #ffffff;
    --gris-claro: #f5f5f5;
    --gris-medio: #7a7a7a;
    --negro: #1a1a1a;
    --bordo: #3b1f1f;
    --bg: #ffffff;
    --surface: #f5f5f5;
    --surface-strong: #ffffff;
    --surface-muted: rgba(255,255,255,0.85);
    --text: #1a1a1a;
    --text-muted: #7a7a7a;
    --shadow: 0 20px 50px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Enlace para saltar al contenido - sólo visible al enfocarlo */
.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus,
.skip-link:active {
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.5rem 0.75rem;
    background: var(--dorado);
    color: var(--blanco);
    z-index: 9999;
    border-radius: 4px;
    text-decoration: none;
}

/* Enfoque visible accesible para teclado */
:focus-visible {
    outline: 3px solid var(--dorado);
    outline-offset: 3px;
}

/* Asegurar foco claro en elementos interactivos */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 3px solid var(--dorado);
    outline-offset: 3px;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    background: var(--verde-oscuro);
    color: var(--blanco);
    padding: 0.7rem 0;
    font-size: 0.95rem;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-button {
    margin-right: auto;
    margin-left: 1rem;
}

.top-bar-button a {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    color: var(--blanco);
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.3s ease, background 0.25s ease, box-shadow 0.25s ease;
    animation: topBarButtonPulse 6s ease-in-out infinite alternate;
}

.top-bar-button a:hover {
    background: rgba(255,255,255,0.32);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 12px 26px rgba(255,255,255,0.18);
}

@keyframes topBarButtonPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255,255,255,0);
    }
    100% {
        transform: scale(1.015);
        box-shadow: 0 0 18px rgba(255,255,255,0.18);
    }
}

/* Header */
header {
    background: var(--blanco);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}


.escudo-img {
    width: auto;      
    height: 80px;     
    object-fit: contain; 
    display: block;
}


@media (max-width: 768px) {
    .escudo-img {
        height: 60px;
    }
}

.hospital-name h1 {
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
    color: var(--verde-oscuro);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--negro);
    font-weight: 600;
    transition: 0.3s;
}

nav a:hover {
    color: var(--verde-militar);
}

/* ── Menu Toggle (Hamburger) ── */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
}

.menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--verde-oscuro);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.92);
    color: var(--verde-oscuro);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background: rgba(255,255,255,1);
    transform: translateY(-1px);
}

/* Animación transformando a X */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ── Dropdown Institucional ── */
.menunav > ul {
    position: relative;
}

/* Ítem padre con submenu */
.menunav li.has-dropdown {
    position: relative;
}

/* Flecha indicadora */
.menunav li.has-dropdown > a::after {
    content: ' ▾';
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
    display: inline-block;
}

.menunav li.has-dropdown.open > a::after {
    transform: rotate(180deg);
}

/* Submenú oculto por defecto */
.menunav li.has-dropdown > ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blanco);
    min-width: 280px;
    width: max-content;
    max-width: 320px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-top: 3px solid var(--dorado);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    list-style: none;
    padding: 1rem 0;
    z-index: 2000;
}

/* Submenú visible */
.menunav li.has-dropdown.open > ul {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Ítems del submenú */
.menunav li.has-dropdown > ul li {
    width: 100%;
}

.menunav li.has-dropdown > ul li a {
    display: block;
    padding: 0.65rem 1.2rem;
    color: var(--negro);
    font-weight: 400;
    font-size: 0.92rem;
    white-space: nowrap;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.menunav li.has-dropdown > ul li a:hover {
    background: var(--gris-claro);
    border-left-color: var(--dorado);
    color: var(--verde-oscuro);
}

/* Responsive móvil */
@media (max-width: 768px) {
    .menunav li.has-dropdown > ul {
        position: static;
        transform: none;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid var(--dorado);
        border-radius: 0;
        min-width: unset;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        pointer-events: none;
        transition: max-height 0.3s ease;
    }

    .menunav li.has-dropdown.open > ul {
        max-height: 300px;
        pointer-events: auto;
    }
}

/* Hero */
/* Hero Subpages (Standard) */
.hero {
    background: var(--verde-militar);
    color: var(--blanco);
    padding: 6rem 2rem;
    text-align: center;
}

.hero h2 {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    color: var(--blanco);
}

/* Hero Integrated Section (Home only) */
.hero-home {
    position: relative;
    background: url('../img/hospital_frente.jpg') no-repeat center center/cover;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    overflow: hidden;
}

.hero-home .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.hero-home .hero-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
}

/* Tarjeta Principal (Maroon) */
.hero-main-card {
    flex: 1;
    background: rgba(137, 34, 23, 0.95);
    padding: 2rem;
    border-radius: 15px;
    color: var(--blanco);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

.hero-unit {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    opacity: 0.9;
}

.hero-title-main {
    font-family: 'Merriweather', serif;
    font-size: 2.3rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle-quote {
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    opacity: 0.85;
}

.btn-history {
    background: rgba(255, 255, 255, 0.2);
    color: var(--blanco);
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-history:hover {
    background: var(--blanco);
    color: var(--verde-militar);
    transform: translateY(-3px);
}

.btn-history .arrow {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-block;
    transform: translateY(-3px);
    margin-left: 5px;
}

/* Grid de Accesos Rápidos (Glassmorphism) */
.hero-quick-grid {
    flex: 1.5;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.hero-quick-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem 1rem;
    border-radius: 15px;
    text-decoration: none;
    color: var(--negro);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.5);
}

/* Soporte para botones en el hero */
button.hero-quick-card {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

.hero-quick-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.quick-card-icon {
    width: 45px;
    height: 45px;
    background: rgba(137, 34, 23, 0.1);
    color: var(--verde-militar);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.quick-card-icon img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.hero-quick-card:hover .quick-card-icon {
    transform: rotate(10deg) scale(1.1);
    background: var(--verde-militar);
}

.hero-quick-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--negro);
}

.hero-quick-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gris-medio);
}

/* Responsividad Hero */
@media (max-width: 1100px) {
    .hero-home .hero-container {
        flex-direction: column;
    }
    
    .hero-home .hero-quick-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-home {
        padding: 3rem 1rem;
        min-height: auto;
    }
    
    .hero-home .hero-title-main {
        font-size: 2rem;
    }
    
    .hero-home .hero-main-card {
        padding: 2rem 1.5rem;
    }
    
    .hero-home .hero-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    display: inline-block;
    transition: 0.3s;
    margin: 0.5rem;
}

.btn-primary { background: var(--dorado); color: var(--negro); }
.btn-secondary { border: 2px solid var(--blanco); color: var(--blanco); }

.btn-primary:hover { transform: translateY(-3px); opacity: 0.9; }

/* ── Hospital en Números (Estadísticas) ── */
.stats-section {
    background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-militar));
    padding: 5rem 2rem;
    color: var(--blanco);
    text-align: center;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
}

.stat-number-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: var(--dorado);
}

.stat-number {
    font-family: 'Merriweather', serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-plus {
    font-family: 'Merriweather', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-right: 5px;
}

.stat-label-small {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 5px;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}


.location {
    padding: 60px 20px;
    background-color: #f4f4f4;
}

/* ── Sección Revista (próxima publicación) ── */
.revista-section {
    padding: 3.5rem 2rem;
    background: var(--blanco);
    color: var(--negro);
}

.revista-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.revista-card {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    width: 100%;
}

.revista-thumbnail {
    flex: 0 0 220px;
    max-width: 220px;
}

.revista-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}

.revista-content h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
    color: var(--verde-oscuro);
    margin-bottom: 0.5rem;
}

.revista-content p {
    color: var(--gris-medio);
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .revista-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .revista-thumbnail {
        width: 100%;
        max-width: none;
    }
}

.map-container {
    max-width: 850px;
    margin: 0 auto 50px; /* Added 50px bottom margin */
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--dorado);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Estilos para la tarjeta de dirección */

/* Centrar el contenedor del encabezado */
.section-header {
    text-align: center;
    margin-bottom: 20px; /* Espacio entre el título y el mapa */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Estilo bonito para el título Ubicación */
.section-title {
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    color: var(--verde-oscuro);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    position: relative;
}

/* Línea decorativa dorada debajo del título */
.title-underline {
    width: 80px;
    height: 4px;
    background-color: var(--dorado);
    border-radius: 2px;
}



.address-card {
    background: #892217;
    color: #ffffff;
    padding: 25px;
    text-align: center;
}

.address-card p {
    margin: 8px 0;
    font-size: 1.15rem;
}

.btn-maps {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background-color: var(--dorado);
    color: var(--verde-militar);
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-maps:hover {
    background-color: #e5c07b; /* Un dorado más brillante */
    transform: translateY(-2px);
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .map-container iframe {
        height: 300px;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

/* Footer Professional */
.footer-professional {
    background: var(--verde-oscuro);
    color: var(--blanco);
    padding: 4rem 2rem 0;
    font-family: 'Open Sans', sans-serif;
    border-top: 5px solid var(--dorado);
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-logo {
    max-width: 150px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.footer-title h4 {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    color: var(--dorado);
    margin-bottom: 0.5rem;
}

.footer-title p {
    font-size: 0.9rem;
    color: var(--gris-claro);
    opacity: 0.8;
}

.footer-links-section h4,
.footer-info-section h4 {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    color: var(--dorado);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-links-section h4::after,
.footer-info-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: var(--dorado);
}

.footer-links-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links-section a {
    color: var(--gris-claro);
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
    font-size: 1rem;
}

.footer-links-section a:hover {
    color: var(--dorado);
    padding-left: 5px;
}

.footer-info-section p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--gris-claro);
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.visit-counter {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--dorado);
    font-weight: 600;
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo-section {
        align-items: center;
    }
    
    .footer-links-section h4::after,
    .footer-info-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-info-section p {
        justify-content: center;
    }
}

/* Responsive */



/* ── quick-card como <button> ── */
button.quick-card {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    border: 2px solid var(--verde-oscuro);
}

/* ── Modal WhatsApp ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
    backdrop-filter: blur(3px);
    animation: fadeInOverlay 0.2s ease;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--blanco);
    border-radius: 12px;
    border-top: 5px solid var(--dorado);
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
    max-width: 520px;
    width: 100%;
    position: relative;
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Botón cerrar */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--gris-medio);
    line-height: 1;
    transition: color 0.2s;
    z-index: 1;
}
.modal-close:hover { color: var(--negro); }

/* Encabezado del modal */
.modal-header {
    background: var(--verde-oscuro);
    padding: 1.8rem 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.modal-header h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.25rem;
    color: var(--dorado);
    margin: 0;
}

/* Cuerpo del modal */
.modal-body {
    padding: 1.8rem 2rem 2rem;
    max-height: 65vh;
    overflow-y: auto;
}

.modal-intro {
    font-size: 0.95rem;
    color: var(--gris-medio);
    margin-bottom: 1.4rem;
    line-height: 1.6;
}

/* Lista de servicios */
.modal-lista {
    list-style: none;
    padding: 0;
    margin: 0 0 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--dorado);
    background: var(--gris-claro);
    font-size: 0.92rem;
    gap: 1rem;
}

.modal-lista-label {
    font-weight: 700;
    color: var(--verde-oscuro);
}

.modal-lista-valor {
    color: var(--negro);
}

/* Horario */
.modal-horario {
    font-size: 0.88rem;
    color: var(--gris-medio);
    border-top: 1px solid #eee;
    padding-top: 1rem;
    margin: 0;
}

@media (max-width: 480px) {
    .modal-lista li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}

/* ── FAQ Modal Accordion Styles ── */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.faq-item {
    background: var(--gris-claro);
    border-radius: 6px;
    border-left: 3px solid var(--dorado);
    overflow: hidden;
}

.faq-item summary {
    font-weight: 700;
    color: var(--verde-oscuro);
    padding: 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    list-style: none; /* Eliminar flecha por defecto en varios navegadores */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-item summary::-webkit-details-marker {
    display: none; /* Safari */
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--dorado);
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg); /* Cambia '+' por 'x' visualmente */
}

.faq-item[open] summary {
    background: #ebebeb;
}

.faq-content {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.9rem;
    color: var(--negro);
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.faq-content p {
    margin-bottom: 0.5rem;
}

.faq-content p:last-child {
    margin-bottom: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── MEDIA QUERY PRINCIPAL (MOVIL) ── */

/* ── Copy Feedback Tooltip ── */
.card-body, .contact-info, .udh-card {
    position: relative;
}

.copy-feedback {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--verde-oscuro);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    animation: slideInUp 0.3s ease;
    z-index: 100;
}

.copy-feedback.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.5rem 1rem;
    }

    .top-bar-item {
        font-size: 0.75rem;
    }

    .header-main { 
        padding: 0.8rem 1rem; /* Reducido para dar más espacio */
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem; /* Espacio mínimo entre logo y nombre */
        max-width: 100vw;
        overflow: hidden;
    }
    
    .logo-section {
        gap: 0.4rem; /* Minimizado */
    }

    .escudo-img {
        height: 50px !important; /* Logo más pequeño en móvil */
    }

    .hospital-name {
        flex: 1;
        min-width: 0;
    }

    .hospital-name h1 {
        font-size: 0.8rem; /* Tamaño reducido para que entre todo */
        white-space: nowrap;
        overflow: visible; /* Quitado el recorte */
        text-overflow: clip;
        max-width: none;
    }

    .hospital-name p {
        font-size: 0.6rem;
        white-space: nowrap;
        overflow: visible;
        text-overflow: clip;
        max-width: none;
    }

    .menu-toggle {
        display: flex;
        transition: transform 0.3s ease;
    }

    .menu-toggle.is-active {
        position: fixed;
        top: 30px;
        right: 25px;
        z-index: 2001;
    }

    .menunav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        height: 100vh;
        background: var(--blanco) !important;
        z-index: 2000;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        padding-top: 100px; /* Aumentado de 80px */
        overflow-y: auto;
    }

    .menunav.active {
        right: 0;
    }

    .menunav ul {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    .menunav ul li {
        width: 100% !important;
        border-bottom: 1px solid var(--gris-claro);
    }

    .menunav ul li a {
        display: block !important;
        padding: 1.2rem 2rem !important;
        font-size: 1.1rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .menunav li.has-dropdown > ul {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        transform: none !important;
        box-shadow: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        border-top: none !important;
        border-left: 4px solid var(--dorado) !important;
        background: #fdfdfd !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        z-index: 10 !important;
    }



    
    .menunav li.has-dropdown > ul li a {
        padding: 1rem 1.5rem 1rem 2.5rem !important;
        font-size: 1rem !important;
        line-height: 1.4 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }

    .menunav li.has-dropdown > ul li:last-child a {
        border-bottom: none !important;
        padding-bottom: 1.5rem !important;
    }

    .hero h2 { font-size: 2rem !important; }
    
    .featured-image-container {
        border-width: 3px !important;
    }
    
    .featured-img {
        height: 300px !important;
    }
}


/* ── Pantalla de Carga (Loader) ── */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--blanco);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.4s ease;
}

body.dark-theme .page-loader {
    background-color: #0b1220;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 150px;
}

.loader-logo {
    position: absolute;
    width: 95px;
    height: auto;
    z-index: 2;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 6px solid rgba(137, 34, 23, 0.1);
    border-top: 6px solid var(--verde-militar);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* ── Botón Flotante Turnos ── */
.floating-btn-turnos {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--dorado); /* Solamente dorado */
    color: var(--bordo); /* Texto oscuro para contrastar */
    padding: 10px 18px;
    border-radius: 45px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    z-index: 1000;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.floating-btn-turnos:hover {
    transform: translateY(-3px);
    background-color: var(--bordo);
    color: var(--blanco);
    text-decoration: none;
    opacity: 1;
    box-shadow: 0 6px 16px rgba(0,0,0,0.32);
}

.floating-btn-icon {
    font-size: 1.2rem;
}

/* ── Modo oscuro global ── */
body.dark-theme {
    background: #0d121c;
    color: #e6eef8;
}

body.dark-theme header,
body.dark-theme .top-bar,
body.dark-theme .footer-professional,
body.dark-theme .menunav,
body.dark-theme .modal-box,
body.dark-theme .hero-quick-card,
body.dark-theme .revista-section,
body.dark-theme .address-card,
body.dark-theme .location,
body.dark-theme .faq-item,
body.dark-theme .stat-item {
    background: #111827;
}

body.dark-theme header {
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

body.dark-theme .top-bar {
    background: #141b24;
    color: #dde6f0;
}

body.dark-theme nav a,
body.dark-theme .footer-links-section a,
body.dark-theme .faq-item summary,
body.dark-theme .revista-content h3,
body.dark-theme .revista-content p,
body.dark-theme .address-card p,
body.dark-theme .modal-intro,
body.dark-theme .modal-lista-label,
body.dark-theme .modal-lista-valor,
body.dark-theme .faq-content,
body.dark-theme .copy-feedback {
    color: #d9e4f2;
}

body.dark-theme nav a:hover,
body.dark-theme .footer-links-section a:hover {
    color: #c6ad65;
}

body.dark-theme .menunav {
    background: #111827 !important;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
}

body.dark-theme .menunav ul li {
    border-bottom-color: rgba(255,255,255,0.08);
}

body.dark-theme .menunav ul li a {
    color: #e5ebf8;
}

body.dark-theme .menunav li.has-dropdown > ul {
    background: #111827 !important;
    border-left-color: #c6ad65 !important;
    box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

body.dark-theme .menunav li.has-dropdown > ul li a {
    color: #dce5f7;
    border-bottom-color: rgba(255,255,255,0.08) !important;
}

body.dark-theme .menunav ul li a:hover {
    background: rgba(255,255,255,0.05);
    color: #c6ad65;
    border-left-color: #c6ad65;
}

body.dark-theme .hero-main-card {
    background: rgba(10, 14, 22, 0.92);
    border-color: rgba(255,255,255,0.1);
}

body.dark-theme .btn-history {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
    color: #ffffff;
}

body.dark-theme .btn-history:hover {
    background: rgba(255,255,255,0.95);
    color: #892217;
}

body.dark-theme .hero-quick-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 22px 55px rgba(0,0,0,0.3);
}

body.dark-theme .hero-quick-card:hover {
    background: rgba(255,255,255,0.08);
}

body.dark-theme .hero-quick-card h3 {
    color: #f4f7fb;
}

body.dark-theme .hero-quick-card p {
    color: #b8c5d8;
}

body.dark-theme .hero-quick-card .quick-card-icon {
    background: rgba(137,34,23,0.18);
}

body.dark-theme .stats-section {
    background: linear-gradient(135deg, #0d1118, #262a30);
}

body.dark-theme .stat-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}

body.dark-theme .location,
body.dark-theme .map-container,
body.dark-theme .revista-card {
    background: #111827;
}

body.dark-theme .revista-card {
    border-color: rgba(255,255,255,0.07);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

body.dark-theme .revista-content p {
    color: #a9b8d2;
}

body.dark-theme .address-card {
    background: #16202b;
    color: #f3f7fb;
}

body.dark-theme .btn-maps {
    background-color: #b8945f;
    color: #111111;
}

body.dark-theme .btn-maps:hover {
    background-color: #dcc387;
}

body.dark-theme .modal-box {
    background: #111827;
    border-top-color: #b8945f;
}

body.dark-theme .modal-header {
    background: #141f2d;
}

body.dark-theme .modal-body {
    background: #111827;
    color: #dce5f3;
}

body.dark-theme .modal-lista li,
body.dark-theme .faq-item,
body.dark-theme .faq-item[open] summary {
    background: rgba(255,255,255,0.04);
}

body.dark-theme .faq-item summary {
    color: #e8eef8;
}

body.dark-theme .faq-item[open] summary {
    background: rgba(255,255,255,0.08);
}

body.dark-theme .faq-content {
    color: #dce5f3;
}

body.dark-theme .footer-professional {
    background: #10151d;
    border-top-color: #b8945f;
}

body.dark-theme .footer-links-section a {
    color: #aec1db;
}

body.dark-theme .footer-info-section p,
body.dark-theme .footer-links-section a {
    color: #b6c4d9;
}

body.dark-theme .copy-feedback {
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #f3f9ff;
}

body.dark-theme .floating-btn-turnos {
    background-color: #b8945f;
    color: #111;
}

body.dark-theme .floating-btn-turnos:hover {
    background-color: #e8c478;
    color: #111;
}

body.dark-theme .theme-toggle {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.18);
    color: #f7f8fb;
}

body.dark-theme .hero-title-main,
body.dark-theme .hero-unit,
body.dark-theme .hero-subtitle-quote,
body.dark-theme .btn-history {
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

.isolated-white {
    display: inline-block;
    background: rgba(0,0,0,0.25);
    padding: 0.08em 0.18em;
    border-radius: 0.25rem;
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

@media (max-width: 768px) {
    .theme-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .floating-btn-turnos {
        bottom: 20px;
        right: 20px;
        padding: 9px 16px;
        font-size: 0.95rem;
    }
    .floating-btn-icon {
        font-size: 1.1rem;
    }
}
