/* 1. Estilos del Cuerpo y Contenido Principal (Desktop Base) */
body {
    /* Tipografía Inter */
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex; /* Mantiene el layout principal con la sidebar */
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: auto; 
    position: relative;
}

.main-content {
    flex-grow: 1;
    min-height: 100vh; 
    box-sizing: border-box;
    /* Espacio para la barra lateral de escritorio (AJUSTE CLAVE) */
    margin-right: 100px; 
    transition: margin-right 0.3s, padding-bottom 0.3s;
    scroll-behavior: smooth; 
}

/* Estilos para el contenido que va sobre el video (Hero Section) */
.hero-content {
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff; 
    position: relative; 
    text-align: center;
    padding: 40px; 
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hero-content .call-to-action {
    background-color: rgb(0, 170, 159);
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.hero-content .call-to-action:hover {
    background-color: rgb(0, 130, 120);
}


/* Estilos para el video de fondo */
#bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%; 
    min-height: 100%;
    width: auto; 
    height: auto;
    z-index: -1; 
    background-size: cover;
    overflow: hidden;
    filter: brightness(0.7);
}

/* Overlay para mejorar la legibilidad del texto sobre el video */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); 
    z-index: -1; 
}

/* ESTILOS BASE PARA TODAS LAS SECCIONES DE LA LANDING PAGE */
.content-section {
    padding: 80px 40px; 
    margin-top: 0;
    box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.05); 
}

/* Estilos de fondo alternos */
.light-bg {
    background-color: #fff;
    color: #333;
}
.dark-bg {
    background-color: #1e1e1e; 
    color: #f4f4f4;
}

.content-section h2 {
    color: rgb(0, 170, 159);
    border-bottom: 2px solid #ccc;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 30px;
}

.dark-bg h2 {
    color: #fff;
    border-bottom-color: #444;
}

.card-grid {
    display: flex;
    gap: 20px;
    justify-content: space-around;
    flex-wrap: wrap;
}

.card {
    background-color: #e0f7fa;
    color: #000;
    padding: 20px;
    border-radius: 8px;
    width: 200px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.service-list {
    list-style: none;
    padding: 0;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}
.service-list li {
    font-size: 1.1em;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.service-list i {
    color: rgb(0, 170, 159);
    margin-right: 10px;
    width: 20px; 
}

/* ESTILOS FIJOS SUPERIORES */

/* Clase para ocultar el botón de resultados */
#results-button.hidden { 
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important; /* Deshabilita clics */
}

/* BOTÓN FIJO DE RESULTADOS (Superior Izquierda) */
#results-button {
    position: fixed;
    top: 20px; 
    left: 20px; 
    z-index: 1010; 
    
    background-color: transparent; 
    border: 2px solid #fff; 
    color: #fff;
    
    padding: 10px 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 5px;
    
    transition: background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

#results-button:hover {
    background-color: #00AA9F; 
    border-color: #00AA9F;
    color: #fff;
}


/* 2. Barra Lateral Fija (Desktop Base) */
.fixed-sidebar {
    width: 100px; 
    height: 100%;
    position: fixed;
    top: 0;
    right: 0; 
    /* AJUSTE CLAVE: Vuelve a color sólido por defecto para cubrir los huecos */
    background-color: #00AA9F; 
    z-index: 1000; 
    box-shadow: none; 
    display: flex;
    flex-direction: column; 
    align-items: center;    
    /* MODIFICACIÓN: Añadir transición para el movimiento */
    transition: background-color 0.3s ease, transform 0.3s ease-out;
    transform: translateX(0); /* Posición por defecto: visible */
}

/* NUEVO: Estado de la barra lateral al hacer scroll hacia abajo (la oculta) */
.fixed-sidebar.hidden-sidebar {
    /* Mueve la barra 100px (su propio ancho) hacia la derecha para ocultarla */
    transform: translateX(100px);
}


.sidebar-nav-items {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex-grow: 1; 
    justify-content: center; 
}

.sidebar-item {
    /* AJUSTE CLAVE: Volver a transparente (background: none) para que muestre el color sólido del padre */
    background: none;
    border: none;
    color: #fff; 
    width: 100%;
    padding: 20px 0;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s; 
}

/* EFECTO HOVER EN OPCIONES DE MENÚ DE ESCRITORIO */
.fixed-sidebar .sidebar-item:hover {
    background-color: rgba(0,0,0,0.15); /* Efecto de fondo más notorio al pasar el ratón */
}


/* Estilo de los nuevos iconos SVG en el sidebar */
.sidebar-item .sidebar-icon {
    width: 24px; /* Tamaño del icono (similar a Font Awesome) */
    height: 24px;
    margin-bottom: 5px;
    /* FILTRO PARA ÍCONOS BLANCOS: ELIMINADO */
}


/* 3. Menú Desplegable (Desktop Base) */
.full-sidebar {
    width: 500px; 
    max-width: calc(100vw - 100px);
    height: 100%;
    position: fixed;
    z-index: 1080; 
    top: 0;
    right: 100px; 
    
    opacity: 0; 
    visibility: hidden; 
    
    background-color: #00AA9F !important; 
    overflow-y: auto;
    overflow-x: hidden;
    
    transition: opacity 0.5s, visibility 0.5s; 
    
    box-shadow: none; 
    padding: 0; 
    box-sizing: border-box;
    margin-right: 0;
}

.full-sidebar.open {
    opacity: 1; 
    visibility: visible;
}

/* Contenedor del Logo en el Menú Desplegable */
.menu-logo-container {
    padding: 20px 30px; /* Espacio alrededor del logo */
    text-align: center; 
    /* LÍNEA SEPARADORA ELIMINADA */
    margin-bottom: 20px;
    /* ALTURA MÍNIMA PARA OCUPAR EL ESPACIO ANTERIOR DEL LOGO */
    min-height: 50px; 
}

.menu-list {
    list-style: none;
    padding: 10px 0; 
    margin: 0;
}

.menu-list li a {
    text-decoration: none;
    font-size: 16px; 
    color: #fff; 
    display: block;
    padding: 8px 30px;
    font-weight: 300; 
    position: relative; 
    overflow: hidden; 
    white-space: nowrap; 
    transition: background-color 0.3s; 
}

.menu-list li a:hover {
    background-color: rgba(0, 0, 0, 0.15); /* Efecto de fondo más notorio al pasar el ratón */
    color: #fff; 
}

/* ------------------------------------------- */
/* EFECTO HOVER PARA EL TEXTO DEL MENÚ */
/* ------------------------------------------- */

.menu-list li a span {
    display: inline-block; 
    transition: transform 0.3s ease-out; 
}

/* Asumiendo que la flecha es un ícono o elemento externo */
.menu-list li a .menu-arrow {
    position: absolute;
    right: 30px; 
    top: 50%;
    transform: translateY(-50%) translateX(10px); 
    opacity: 0; 
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.menu-list li a:hover .menu-arrow {
    transform: translateY(-50%) translateX(0); 
    opacity: 1; 
}

.menu-list li a:hover span {
    transform: translateX(-5px);
}
/* ------------------------------------------- */


/* 4. Overlay del menú lateral (Desktop) */
.overlay {
    position: fixed;
    height: 100%;
    /* ANCHO AL 100% para cubrir el espacio de la barra fija al abrir el menú */
    width: 100%; 
    top: 0;
    left: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 900; 
    display: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* 5. Barra de Navegación Inferior (Mobile - Oculta por defecto en Desktop) */
.bottom-nav {
    display: none; 
}

/* ============================================== */
/* ESTILOS PARA LA SECCIÓN INSTITUCIONAL (PROMOS) */
/* ============================================== */
#promociones-landing {
    padding: 60px 40px; 
    background-color: #f7f7f7; 
    color: #333;
}

.ranking-content-wrapper {
    display: flex;
    flex-wrap: wrap; 
    gap: 40px; 
    max-width: 1200px; 
    margin: 0 auto; 
    align-items: flex-start; 
}

.ranking-text-side {
    flex: 1; 
    min-width: 300px; 
    padding-right: 20px; 
}

.ranking-title {
    font-size: 2.8em; 
    line-height: 1.1;
    margin-bottom: 20px;
    color: #333; 
    border-bottom: none; 
    padding-bottom: 0;
}

.ranking-title .highlight {
    color: #C0222B; 
}

.ranking-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #555;
}

.read-more-link {
    display: inline-flex; 
    align-items: center;
    text-decoration: none;
    color: #00AA9F; 
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.read-more-link:hover {
    color: #007a73; 
}

.read-more-link i {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.read-more-link:hover i {
    transform: translateX(5px); 
}

.ranking-image-side {
    flex: 1; 
    min-width: 350px; 
    text-align: center; 
}

.hospitales-images {
    max-width: 100%; 
    height: auto;
    display: block; 
    margin: 0 auto; 
    border-radius: 8px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* ============================================== */
/* MEDIA QUERY PARA DISPOSITIVOS MÓVILES */
/* ============================================== */
@media (max-width: 768px) {
    
    /* MODIFICACIONES DE LAYOUT EN MÓVIL */
    
    .main-content {
        margin-right: 0; /* Elimina el margen de la sidebar */
    }
    .content-section {
        padding: 40px 20px; /* Reduce padding en móvil */
    }

    /* OCULTAR ELEMENTOS DE ESCRITORIO EN MÓVIL */
    #results-button {
        display: none;
    }

    /* 1. Ocultar Menú Lateral Fijo de Escritorio */
    .fixed-sidebar {
        display: none !important;
        visibility: hidden;
    }

    /* 3. Estilizar la Barra Inferior (DISEÑO MÓVIL UNIFORME) */
    .bottom-nav {
        background-color: #00AA9F; /* El color de fondo en móvil debe ser sólido */
        display: flex;
        justify-content: space-around; 
        align-items: flex-start; /* Alinea los ítems desde arriba */
        width: 100%;
        height: 70px; 
        position: fixed;
        bottom: 0;
        left: 0;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
        z-index: 1100;
        padding-top: 10px; 
        
        padding-left: 0px; 
        padding-right: 0px; 

        padding-bottom: constant(safe-area-inset-bottom); 
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: content-box;
    }
    
    .bottom-nav a.nav-item {
        /* ESTILOS DE ELEMENTOS DE NAVEGACIÓN ESTÁNDAR */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #fff;
        font-size: 10px;
        font-weight: bold; 
        
        flex: 1; 
        width: 20%; 
        
        padding: 0; 
        margin: 0; 
        
        position: relative; 
        height: 60px;
        z-index: 1; 
        
        transition: background-color 0.1s ease-out; 
    }
    
    /* EFECTO ACTIVE (TAP) EN OPCIONES DE MENÚ MÓVIL */
    .bottom-nav a.nav-item:active {
        background-color: rgba(0, 0, 0, 0.15); /* Ligero oscurecimiento al presionar */
    }
    
    /* Estilo de los iconos SVG normales en la barra móvil (Todos los ítems) */
    .bottom-nav a.nav-item .mobile-icon {
        width: 22px; /* Tamaño del icono */
        height: 22px;
        margin-bottom: 2px; 
        line-height: 1;
    }

    /* 4. Estilizar y Posicionar el Menú Desplegable (SUBMENÚ PRINCIPAL) */
    .full-sidebar {
        width: 90vw; 
        max-width: 90vw;
        height: 100%;
        top: 0;
        right: 0; 
        
        transition: opacity 0.3s ease-in-out; 

        opacity: 0; 
        visibility: hidden;
        
        z-index: 1060; 
    }

    .full-sidebar.open {
        opacity: 1; 
        visibility: visible;
    }
    
    /* 5. Estilo del Overlay para móvil */
    .overlay {
        display: block; 
        width: 100%; 
        height: 100%;
        right: 0;
        top: 0;
        z-index: 1055; 
        opacity: 0;
    }
    
    /* Regla para mostrar el overlay cuando el menú está abierto */
    .full-sidebar.open ~ .overlay {
        opacity: 1;
    }
}