/* ==========================================================================
   Estilos para la Página de Mapa (Aula)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Estilos de Navegación y Header
   -------------------------------------------------------------------------- */

/* Estilos para la navbar con transparencia y efecto borroso (Glassmorphism) */
#header-navbar {
    background-color: rgba(12, 56, 114, 0.55) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Tipografía de los enlaces de navegación */
#header-navbar .nav-link {
    font-weight: bold !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 15px !important;
}

#header-navbar .dropdown-toggle {
    font-weight: bold !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 15px !important;
}

/* Ajuste del logo en la navbar */
#header-navbar .navbar-brand img {
    height: 35px !important;
}

/* --------------------------------------------------------------------------
   2. Sección Hero (Título Principal)
   -------------------------------------------------------------------------- */

.hero-section {
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        #042962; /* Azul institucional oscuro */
    color: white;
    padding: 100px 0 80px 0;
    position: relative;
    overflow: hidden;
}

/* Efecto de superposición para profundidad */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    line-height: 1.4;
}

/* Responsive Design para Hero Section */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .hero-section {
        padding: 60px 0 40px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 50px 0 30px 0;
    }
}

/* --------------------------------------------------------------------------
   3. Navegación Flotante Móvil (Estilo Neumórfico)
   -------------------------------------------------------------------------- */

.floating-mobile-nav {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1020;
    width: 95%;
    max-width: 400px;
}

.floating-mobile-nav .nav-container {
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 50%, rgba(255, 255, 255, 0.02) 100%),
        rgba(255, 255, 255, 0.005);
    border-radius: 22px;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.12),
        0 12px 25px rgba(0, 0, 0, 0.08),
        0 6px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.1),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(50px) saturate(200%) brightness(110%);
    -webkit-backdrop-filter: blur(50px) saturate(200%) brightness(110%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo de fondo */
.floating-mobile-nav .nav-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, 
            rgba(255, 255, 255, 0.05) 0%, 
            rgba(255, 255, 255, 0.01) 30%,
            rgba(255, 255, 255, 0.005) 50%,
            rgba(255, 255, 255, 0.01) 70%,
            rgba(255, 255, 255, 0.04) 100%);
    border-radius: 28px;
    pointer-events: none;
    opacity: 0.4;
}

.floating-mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #000000;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    min-width: 56px;
    cursor: pointer;
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.floating-mobile-nav .nav-item:hover {
    color: #000000;
    transform: translateY(-3px) scale(1.02);
    text-decoration: none;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(255, 255, 255, 0.01);
    border-color: rgba(0, 0, 0, 0.20);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.12),
        0 5px 15px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.15),
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -1px 0 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px) saturate(130%);
    -webkit-backdrop-filter: blur(15px) saturate(130%);
}

.floating-mobile-nav .nav-item:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.floating-mobile-nav .nav-icon {
    color: #000000 !important;
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 3;
}

.floating-mobile-nav .nav-item:hover .nav-icon {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.floating-mobile-nav .nav-label {
    color: #000000 !important;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Efectos táctiles para móviles */
.floating-mobile-nav .nav-item:active {
    transform: translateY(-1px) scale(0.97);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.1s ease;
}

/* Mostrar solo en móvil */
@media (max-width: 768px) {
    .floating-mobile-nav {
        display: block !important;
        animation: slideInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    /* Ajustes para pantallas muy pequeñas */
    @media (max-width: 480px) {
        .floating-mobile-nav {
            width: 96%;
            max-width: 380px;
            bottom: 18px;
        }
        
        .floating-mobile-nav .nav-container {
            padding: 7px 12px;
            border-radius: 20px;
            gap: 10px;
            backdrop-filter: blur(45px) saturate(190%) brightness(105%);
            -webkit-backdrop-filter: blur(45px) saturate(190%) brightness(105%);
        }
        
        .floating-mobile-nav .nav-item {
            padding: 7px 9px;
            min-width: 48px;
            border-radius: 16px;
        }
        
        .floating-mobile-nav .nav-icon {
            font-size: 17px;
            margin-bottom: 3px;
        }
        
        .floating-mobile-nav .nav-label {
            font-size: 9.5px;
            font-weight: 600;
        }
    }

    /* Ajustes para pantallas extra pequeñas */
    @media (max-width: 375px) {
        .floating-mobile-nav {
            width: 97%;
            max-width: 360px;
            bottom: 16px;
        }
        
        .floating-mobile-nav .nav-container {
            padding: 6px 10px;
            border-radius: 18px;
            gap: 8px;
        }
        
        .floating-mobile-nav .nav-item {
            padding: 6px 7px;
            min-width: 44px;
        }
        
        .floating-mobile-nav .nav-icon {
            font-size: 15px;
        }
        
        .floating-mobile-nav .nav-label {
            font-size: 9px;
        }
    }
}

/* Animación de entrada desde abajo */
@keyframes slideInUp {
    from {
    transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
    transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   4. Estilos Generales del Cuerpo y Contenedores
   -------------------------------------------------------------------------- */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 !important;
    padding: 0 !important;
}

html {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 !important;
    padding: 0 !important;
}

.container {
    background-color: transparent !important;
}

.text-center {
    background-color: transparent !important;
}

* {
    box-sizing: border-box;
}

/* Ocultar navbar desktop en móvil */
@media (max-width: 768px) {
    #header-navbar {
        display: none !important;
    }
    
    #mapa {
        padding-top: 1rem !important;
    }
}

/* --------------------------------------------------------------------------
   5. Estilos de Búsqueda y Filtros
   -------------------------------------------------------------------------- */

.search-wrapper {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modern-search {
    width: 100%;
    max-width: 1200px;
    padding: 18px 25px 18px 55px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
}

/* Icono de lupa */
.modern-search::before {
    content: "🔍";
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    font-size: 16px;
    color: #3498db;
    pointer-events: none;
    z-index: 2;
}

.modern-search:hover {
    border-color: #3498db;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.modern-search:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.modern-search::placeholder {
    color: #6c757d;
    font-weight: 400;
}

/* Botón de búsqueda para móviles */
.search-btn {
    display: none;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Estilos modernos para el contenedor de filtros */
.filter-container {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.filter-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
    /* Animación de entrada */
    animation: slideInUp 0.6s ease-out;
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    text-align: center;
}

/* Select moderno personalizado */
.modern-select {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 50px;
}

.modern-select:hover {
    border-color: #3498db;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.modern-select:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

/* Opciones del select */
.modern-select option {
    padding: 12px 15px;
    font-size: 15px;
    font-weight: 500;
    color: #2c3e50;
    background-color: #ffffff;
    border: none;
}

.modern-select option:hover {
    background-color: #f8f9fa;
}

.modern-select option:checked {
    background-color: #3498db;
    color: white;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Efecto de pulso para indicar interactividad */
.modern-select:not(:focus):hover {
    animation: gentlePulse 2s infinite;
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }
    50% {
        box-shadow: 0 6px 20px rgba(52, 152, 219, 0.2);
    }
}

/* Responsive para controles de búsqueda y filtro */
@media (max-width: 768px) {
    .search-wrapper {
        margin: 15px 0;
        padding: 0 15px;
    }
    
    .modern-search {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .search-btn {
        display: flex;
    }
    
    .filter-container {
        margin: 20px 0;
        padding: 0 15px;
    }
    
    .filter-wrapper {
        max-width: 100%;
    }
    
    .modern-select {
        padding: 12px 15px;
        font-size: 14px;
        background-position: right 12px center;
        background-size: 18px;
        padding-right: 40px;
    }
    
    .filter-label {
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   6. Estilos del Mapa y Leyenda
   -------------------------------------------------------------------------- */

.leyenda-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.leyenda-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Ocultar leyenda inline completamente (se usa modal) */
.leyenda-marcadores, #leyendaMarcadores {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -1 !important;
}

.leyenda-marcadores h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.leyenda-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.leyenda-texto {
    color: #666;
    font-size: 11px;
}

/* Ajustes del contenedor del mapa */
#mapa {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 3rem !important; /* Mantener padding superior */
    margin: 0 !important;
}

/* Hacer que el mapa ocupe toda la altura disponible */
#map {
    height: calc(100vh - 200px) !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    position: relative;
}

@media (min-width: 769px) {
    #map {
        margin-right: 0 !important;
        position: relative;
    }
    
    /* Ocultar elementos móviles en desktop */
    .leyenda-tab {
        display: none !important;
    }
}

/* Ocultar footer */
footer {
    display: none !important;
}

/* Resetear márgenes contenedores */
#mapa .container,
#mapa .row,
#mapa .col-lg-12,
body, html {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

body {
    overflow-x: hidden !important;
}

/* --------------------------------------------------------------------------
   7. Estilos de Componentes Flotantes (Global)
   -------------------------------------------------------------------------- */

/* Botón de scroll hacia arriba */
.scroll-to-top {
    position: fixed;
    bottom: 120px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}

/* Botón de leyenda de marcadores */
.leyenda-button {
    position: fixed;
    bottom: 120px;
    left: 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.leyenda-button.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.leyenda-button:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

/* Botón de baño más cercano (encima de leyenda) */
.nearest-bathroom-button {
    position: fixed;
    bottom: 170px;
    left: 20px;
    background: #9b59b6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
    transition: all 0.3s ease;
}

.nearest-bathroom-button:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.5);
}
/* Modal de leyenda */
/* Botón de ruta a Servicio Médico (encima del de baños) */
.route-med-button {
    position: fixed;
    bottom: 220px;
    left: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    transition: all 0.3s ease;
}

.route-med-button:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}
/* Modal de leyenda */
.leyenda-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 900;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.leyenda-modal.show {
    display: flex;
}

.leyenda-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.leyenda-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.leyenda-close:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Responsive design para elementos flotantes en móviles */
@media (max-width: 768px) {
    .leyenda-marcadores {
        display: none !important;
    }
    

/* Deshabilitar interacción con la barra móvil cuando hay un modal Bootstrap */
.modal-open .floating-mobile-nav {
    pointer-events: none;
}
    
    .leyenda-tab {
        display: none !important;
    }

    /* Ajustes específicos de posición para evitar solapamientos */
    .leyenda-button {
        bottom: 130px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    .nearest-bathroom-button {
        bottom: 180px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    .route-med-button {
        bottom: 230px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .scroll-to-top {
        bottom: 130px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Ajustar el mapa para móviles */
    #map {
        height: calc(100vh - 120px);
        position: relative;
    }
}

.modal-backdrop {
    z-index: 1040 !important;
    background-color: rgba(0, 0, 0, 0.55) !important;
}

.modal {
    z-index: 1050 !important;
}

/* Correcciones visuales para modales de permiso y ruta */
#geoPermissionModal .modal-content {
    background: #ffffff !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25) !important;
    margin: 0 auto !important;
    width: auto !important;
}
#geoPermissionModal.modal {
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#geoPermissionModal .modal-dialog {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}
#geoPermissionModal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 500px;
    width: 90%;
}
#geoPermissionModal .modal-header {
    border-bottom: 1px solid #e1e5ea !important;
}
#geoPermissionModal .modal-title {
    font-weight: 700;
    color: #2c3e50;
}
#geoPermissionModal .modal-body {
    color: #2c3e50;
    line-height: 1.5;
    padding: 16px 20px !important;
}
#geoPermissionModal .modal-dialog {
    max-width: 560px !important;
    margin: 1.75rem auto !important;
}
#geoPermissionModal .btn-primary {
    background: #1e63c6;
    border: none;
    font-weight: 700;
}
#geoPermissionModal .btn-primary:hover {
    background: #1853a4;
}
#geoPermissionModal .btn-secondary {
    background: #646b73;
    border: none;
    font-weight: 700;
}
#geoPermissionModal .btn-secondary:hover {
    background: #4f565e;
}

/* Modal de Ruta a Servicio Médico */
.route-modal-header {
    background: #f5f7fa;
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid #e1e5ea;
}
.route-modal .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
}
.route-modal .modal-content {
    border-radius: 16px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25) !important;
    border: none !important;
    overflow: hidden;
    margin: 0 !important;
    width: auto !important;
}
.route-modal#routeModal {
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.route-modal .modal-dialog {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}
.route-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 1200px;
    width: 95vw;
}
.route-title {
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
}
.route-modal-footer {
    background: #fff;
    border-top: 1px solid #e1e5ea;
    padding: 16px;
}
.route-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.route-direction {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-weight: 600;
}
.route-direction-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #3498db;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}
.route-direction-btn:hover {
    background: #2980b9;
}
.route-close-btn {
    background: #646b73;
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 10px 18px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.route-close-btn:hover {
    background: #4f565e;
}

.ub-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ub-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25), 0 12px 25px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    max-width: 500px;
    width: 90%;
}
.ub-modal-header {
    padding: 24px 24px 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ub-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #042962;
}
.ub-modal-body {
    padding: 20px 24px;
    color: #333;
}
.ub-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.ub-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ub-btn-primary {
    background: linear-gradient(135deg, #0c3872 0%, #042962 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(12, 56, 114, 0.3);
}
.ub-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(12, 56, 114, 0.4);
}
.ub-btn-secondary {
    background: #e9ecef;
    color: #495057;
}
.ub-btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}
.ub-close-button {
    color: #6c757d;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.ub-close-button:hover {
    color: #042962;
    background: rgba(0, 0, 0, 0.05);
}

.ub-modal#ubRouteModal .ub-modal-content {
    max-width: 1200px;
    width: 95vw;
}
.ub-modal#ubRouteModal .ub-modal-footer {
    justify-content: center;
}

@media (max-width: 576px) {
    .ub-modal-content {
        width: 92%;
        border-radius: 16px;
    }
    .ub-modal-header {
        padding: 16px;
        text-align: center;
    }
    .ub-modal-header h2 {
        font-size: 1.1rem;
        font-weight: 700;
    }
    .ub-modal-body {
        padding: 12px 14px;
    }
    .ub-modal-footer {
        padding: 12px 14px 16px 14px;
        flex-direction: column;
        align-items: center;
    }
    .ub-btn {
        width: 90%;
        justify-content: center;
    }
    #ubRouteMap {
        height: 52vh !important;
    }
    .ub-modal#ubRouteModal .ub-modal-content {
        max-width: 380px;
        width: 92%;
        border-radius: 18px;
    }
    .ub-modal#ubGeoModal .ub-modal-content {
        max-width: 360px;
        width: 92%;
        border-radius: 18px;
    }
}
/* Ajustes finos para pantallas muy pequeñas */
@media (max-width: 480px) {
    .leyenda-button {
        bottom: 125px;
        left: 15px;
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
    .nearest-bathroom-button {
        bottom: 175px;
        left: 15px;
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
    .route-med-button {
        bottom: 225px;
        left: 15px;
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
    
    .scroll-to-top {
        bottom: 125px;
        right: 15px;
        width: 42px;
        height: 42px;
        font-size: 17px;
    }
}

@media (max-width: 375px) {
    .leyenda-button {
        bottom: 120px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    .nearest-bathroom-button {
        bottom: 170px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    .route-med-button {
        bottom: 220px;
        left: 12px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .scroll-to-top {
        bottom: 120px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}
