/* ================================
   CONTENEDOR DEL MAPA
================================ */
#iriartec-mapa {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.iriartec-mapa-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    position: relative;
}

/* ================================
   POPUP
================================ */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.iriartec-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: center;
}

.btn-como-llegar,
.btn-ver-detalle {
    white-space: nowrap;
    flex: 1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none !important;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: all 0.2s ease;
    color: #fff !important;
}

.btn-como-llegar {
    background: #0d6efd;
}
.btn-como-llegar:hover {
    background: #084298;
}

.btn-ver-detalle {
    background: #198754;
}
.btn-ver-detalle:hover {
    background: #0f5132;
}

/* ================================
   BOTÓN RESTABLECER RUTAS
================================ */
.iriartec-reset-mapa {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 9999;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.iriartec-reset-mapa:hover {
    background: #842029;
}

/* ================================
   ICONOS DE LOS PINS — ESCALADO SUAVE
================================ */
.leaflet-marker-icon {
    transition: transform 0.25s ease-in-out !important;
    image-rendering: auto !important; /* Previene pixelación del ícono */
    transform-origin: center bottom;
}

/* Previene que los íconos se pixelen en zoom muy alto */
.leaflet-zoom-animated img.leaflet-marker-icon {
    image-rendering: optimizeQuality !important;
}

/* ================================
   PANEL DE RUTAS
================================ */
.leaflet-routing-container {
    max-height: 42vh !important;
    overflow-y: auto !important;
    font-size: 14px;
    border-radius: 12px;
    padding-bottom: 10px;
}

.leaflet-routing-alt {
    max-height: 30vh !important;
    overflow-y: auto !important;
}

.leaflet-routing-collapse-btn {
    display: block !important;
    background: #0d6efd;
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 12px;
    text-align: center;
}

/* FULLSCREEN: aumentar un poco la altura del panel */
.leaflet-fullscreen-on .leaflet-routing-container {
    max-height: 45vh !important;
}

/* ================================
   MÓVIL — PANEL DE RUTAS
================================ */
@media (max-width: 768px) {

    .leaflet-routing-container {
        max-height: 40vh !important;
        font-size: 13px;
    }

    .leaflet-routing-alt {
        max-height: 26vh !important;
    }

    .leaflet-fullscreen-on .leaflet-routing-container {
        max-height: 50vh !important;
    }
}

/* ================================
   BOTÓN PANTALLA COMPLETA NATIVO
================================ */
.leaflet-control-fullscreen {
    margin-bottom: 50px !important;
}

/* Ajustar estilo del botón fullscreen */
.leaflet-control-fullscreen a {
    background: rgba(0,0,0,0.6) !important;
    color: #fff !important;
    border-radius: 6px !important;
}

.leaflet-control-fullscreen a:hover {
    background: rgba(0,0,0,0.85) !important;
}
/* CONTROL NATIVO — Cerrar indicaciones */
.leaflet-control.iriartec-close-route-btn {
    width: 34px;
    height: 34px;
    line-height: 34px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #bbb;
    color: #333;
    display: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.leaflet-control.iriartec-close-route-btn:hover {
    background: #f0f0f0;
    transform: scale(1.07);
}
/* CONTROL NATIVO — Reiniciar mapa */
.leaflet-control.iriartec-reset-map-btn {
    width: 34px;
    height: 34px;
    line-height: 32px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #bbb;
    color: #333;
    margin-top: 6px; /* separarlo del botón de cerrar */
    transition: background 0.2s ease, transform 0.2s ease;
}

.leaflet-control.iriartec-reset-map-btn:hover {
    background: #f0f0f0;
    transform: scale(1.07);
}
/* Cuando el mapa está en modo simple, reducir tamaño de pines */
body.iriartec-mapa-simple .leaflet-marker-icon {
    transform: scale(0.85) !important;
}
/* Ocultar el botón azul de Leaflet Routing Machine */
.leaflet-routing-collapse-btn {
    display: none !important;
}
/* Aumentar altura del mapa SOLO en móviles */
@media (max-width: 768px) {
    #map {
        height: 70vh !important; /* Ajusta 70vh, puedes subirlo a 80vh si quieres aún más alto */
        max-height: 70vh !important;
    }
}