/* =====================================================
   MR MAPAS PRO — Estilos compartidos
   Usado por: MR Mapa (marcadores) + MR Ruta
===================================================== */

/* ── Variables base ─────────────────────────────── */
.mr-map-wrap {
    --mr-btn-bg:      #ffffff;
    --mr-btn-hover:   #e8f2ff;
    --mr-btn-border:  #d2d2d2;
    font-family: inherit;
}


/* ── Contenedor del mapa ────────────────────────── */
.mr-map-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.mr-mapa,
.mrr-map,
.mrmr-map {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 400px;
    box-sizing: border-box;
}
.mr-map-wrap .leaflet-container {
    font-family: inherit;
    border-radius: 6px;
}


/* ── Escala ─────────────────────────────────────── */
.mr-map-wrap .leaflet-control-scale {
    font-family: inherit;
}
.mr-map-wrap .leaflet-control-scale-line {
    font-family: inherit;
    font-size: 12px;
    background: rgba(255,255,255,0.85) !important;
    border: 1.5px solid #888 !important;
    border-top: none !important;
    padding: 2px 6px;
}


/* ── Botones de la barra (zoom, fullscreen, centrar) */
.mr-map-wrap .leaflet-bar a {
    background-color: var(--mr-btn-bg);
    border-bottom-color: var(--mr-btn-border) !important;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-color .15s ease;
    cursor: pointer;
}
.mr-map-wrap .leaflet-bar a:hover {
    background-color: var(--mr-btn-hover);
}
.mr-map-wrap .leaflet-bar {
    border-color: var(--mr-btn-border);
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}


/* ── Selector de capas (dropdown) ───────────────── */
.mr-layer-select {
    background: var(--mr-btn-bg);
    border: 1px solid var(--mr-btn-border);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.mr-layer-dropdown {
    height: 30px;
    padding: 0 8px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
}


/* ── Minimap ─────────────────────────────────────── */
.mr-map-wrap .leaflet-control-minimap {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
@media (max-width: 768px) {
    .mr-map-wrap .leaflet-control-minimap {
        width: 120px !important;
        height: 70px !important;
    }
}


/* ── Panel de coordenadas ───────────────────────── */
.mr-coords-control {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-size: 12px;
    font-family: inherit;
    background: var(--mr-btn-bg);
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
}
@media (max-width: 768px) {
    .mr-coords-control {
        bottom: auto;
        top: 10px;
        font-size: 11px;
    }
}


/* ── Botón centrar ──────────────────────────────── */
.leaflet-control-recenter {
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}


/* ── Popups (MR Mapa) ───────────────────────────── */
.mr-popup {
    --mr-popup-bg:    #ffffff;
    --mr-popup-color: #000000;
}
.mr-popup .leaflet-popup-content-wrapper {
    background: var(--mr-popup-bg) !important;
    color: var(--mr-popup-color) !important;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(0,0,0,.2);
    padding: 0;
}
.mr-popup .leaflet-popup-tip {
    background: var(--mr-popup-bg) !important;
}
.mr-popup .leaflet-popup-content {
    margin: 0;
}
.mr-popup-title {
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 6px;
}


/* ── Tooltips de marcadores (MR Ruta) ───────────── */
.leaflet-tooltip {
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    padding: 4px 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}


/* ── Perfil de elevación (MR Ruta) ──────────────── */
.mr-profile {
    position: relative;
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}
.mr-profile svg {
    display: block;
}
.mr-profile input[type="range"] {
    position: absolute;
    bottom: 6px;
}
.mr-profile-stats {
    position: absolute;
    bottom: 30px;
    right: 12px;
    font-size: 12px;
    pointer-events: none;
    display: flex;
    gap: 12px;
    align-items: center;
}
.mr-profile-stats span {
    font-weight: 600;
}


/* ── Controles heredados de Leaflet ─────────────── */
.mr-map-wrap .leaflet-control,
.mr-map-wrap .leaflet-control-layers {
    font-family: inherit;
    font-size: 13px;
}


/* ── Panel de información flotante (MR Mapa / MR Ruta) ── */
.mr-info-panel {
    font-family: inherit;
    box-sizing: border-box;
}
.mr-info-panel * {
    box-sizing: border-box;
}
.mr-info-panel img {
    max-width: 100%;
}
@media (max-width: 768px) {
    .mr-info-panel {
        width: calc(100% - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        bottom: 20px !important;
        max-height: 55% !important;
    }
    .mr-info-panel img {
        height: 120px !important;
    }
}

/* ── Animación de pines ────────────────────────────── */
@keyframes mr-pin-drop {
    0%   { transform: translateY(-140px) scaleY(0.6); opacity: 0; }
    60%  { opacity: 1; }
    80%  { transform: translateY(8px) scaleY(1.05); }
    90%  { transform: translateY(-4px) scaleY(0.98); }
    100% { transform: translateY(0) scaleY(1); }
}
.mr-pin-drop {
    animation: mr-pin-drop 0.55s cubic-bezier(0.215, 0.61, 0.355, 1) both;
    transform-origin: bottom center;
    display: inline-block;
}
