/* =====================================================================
   We Love Medellín · Mapa vivo v3
   Experiencia full-screen para escritorio + bottom sheet móvil.
   Se carga únicamente en /mapa y después de wlm.css/map-markers.css.
   ===================================================================== */

.map-route {
    overflow: hidden;
    overscroll-behavior: none;
}

.map-route .site-shell-map {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f5f3;
}

.map-route .topbar {
    position: relative;
    flex: 0 0 auto;
    z-index: 120;
}

.map-route .main-map-app {
    width: 100% !important;
    max-width: none !important;
    height: calc(100vh - 76px);
    height: calc(100dvh - 76px);
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
}

.map-app-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    overflow: hidden;
    background: #f4f4f2;
}

/* -------------------------- Panel explorador ------------------------- */

.map-explorer {
    position: relative;
    z-index: 45;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(22, 22, 22, 0.08);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 18px 0 46px rgba(18, 18, 18, 0.08);
    backdrop-filter: blur(22px);
}

.map-sheet-handle {
    display: none;
}

.map-explorer-top {
    flex: 0 0 auto;
    padding: 22px 22px 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
}

.map-explorer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.map-app-eyebrow {
    display: block;
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.map-explorer-heading h1 {
    margin: 6px 0 0;
    max-width: 270px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.map-filter-open {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.map-filter-open:hover {
    border-color: var(--brand);
}

.map-filter-open > span,
.map-mobile-search button > span {
    min-width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    line-height: 1;
}

.map-search,
.map-mobile-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    border: 1px solid #dedede;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.065);
}

.map-search {
    margin-top: 17px;
    padding: 0 12px 0 15px;
}

.map-search > i,
.map-mobile-search > i {
    flex: 0 0 auto;
    color: var(--brand);
    font-size: 15px;
}

.map-search input,
.map-mobile-search input {
    min-width: 0;
    flex: 1;
    height: 48px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
}

.map-search input::placeholder,
.map-mobile-search input::placeholder {
    color: #929292;
    font-weight: 550;
}

.map-search button,
.map-mobile-search button {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f4f4f4;
    color: #555;
    cursor: pointer;
}

.map-quick-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.map-quick-row::-webkit-scrollbar {
    display: none;
}

.map-quick-row button {
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: #565656;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.16s ease;
}

.map-quick-row button:hover {
    border-color: #c9c9c9;
    color: var(--ink);
}

.map-quick-row button.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.14);
}

/* ---------------------------- Filtros ---------------------------- */

.map-filter-drawer[hidden] {
    display: none !important;
}

.map-filter-drawer {
    position: absolute;
    inset: 0;
    z-index: 70;
    overflow-y: auto;
    padding: 0 20px 94px;
    background: rgba(255, 255, 255, 0.985);
    animation: map-filter-enter 0.2s ease;
}

@keyframes map-filter-enter {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.map-filter-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 -20px;
    padding: 22px 20px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
}

.map-filter-drawer-head span {
    display: block;
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.map-filter-drawer-head strong {
    display: block;
    margin-top: 4px;
    max-width: 270px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.map-filter-drawer-head button {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
}

.map-facet-section {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.map-facet-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.map-facet-title span {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.map-facet-title button {
    border: 0;
    background: transparent;
    color: var(--brand);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.map-facet-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.map-facet-chip {
    min-height: 37px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #565656;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.16s ease;
}

.map-facet-chip:hover {
    border-color: #c6c6c6;
    color: var(--ink);
    transform: translateY(-1px);
}

.map-facet-chip.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.map-facet-chip-soft {
    background: #faf8f6;
}

.map-filter-actions {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 5;
    width: 420px;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 10px;
    padding: 14px 20px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
}

.map-filter-actions button {
    min-height: 46px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.map-reset-button {
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--ink);
}

.map-apply-button {
    border: 1px solid var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 12px 26px rgba(255, 56, 92, 0.26);
}

/* --------------------------- Resultados --------------------------- */

.map-results-head {
    flex: 0 0 auto;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.map-results-head strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.map-results-head span {
    display: block;
    max-width: 250px;
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-results-head > button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: #f6f6f6;
    color: #555;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.map-results-head > button span {
    margin: 0;
    color: inherit;
}

.map-explorer .map-place-list {
    min-height: 0;
    max-height: none !important;
    flex: 1 1 auto;
    display: block;
    overflow-y: auto;
    padding: 12px 14px 30px;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.map-explorer .map-place-list::-webkit-scrollbar,
.map-filter-drawer::-webkit-scrollbar {
    width: 8px;
}

.map-explorer .map-place-list::-webkit-scrollbar-thumb,
.map-filter-drawer::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #d5d5d5;
    background-clip: padding-box;
}

.map-place-result {
    position: relative;
    width: 100%;
    min-height: 98px;
    display: grid !important;
    grid-template-columns: 76px minmax(0, 1fr) 18px;
    align-items: center !important;
    gap: 12px !important;
    margin: 0 0 9px !important;
    padding: 10px !important;
    border: 1px solid #e9e9e9 !important;
    border-radius: 20px !important;
    background: #fff !important;
    color: var(--ink);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.035);
    transition: 0.18s ease !important;
}

.map-place-result:hover,
.map-place-result.is-active {
    border-color: rgba(255, 56, 92, 0.62) !important;
    box-shadow: 0 13px 30px rgba(0, 0, 0, 0.09) !important;
    transform: translateY(-1px);
}

.map-place-result.is-active::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 20px;
    bottom: 20px;
    width: 4px;
    border-radius: 0 999px 999px 0;
    background: var(--brand);
}

.map-result-cover,
.map-result-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background: #f5f5f3;
}

.map-result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-result-icon {
    background: color-mix(in srgb, var(--result-color) 12%, white);
    color: var(--result-color);
    font-size: 24px;
}

.map-result-copy {
    min-width: 0;
    display: block;
}

.map-result-type {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.map-result-title {
    display: block !important;
    margin-top: 3px;
    overflow: hidden;
    color: var(--ink) !important;
    font-family: var(--font-display);
    font-size: 14.5px !important;
    font-weight: 800;
    line-height: 1.15 !important;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-result-subtitle {
    display: -webkit-box !important;
    margin-top: 4px !important;
    overflow: hidden;
    color: var(--muted) !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.map-result-meta {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 10.5px;
    font-weight: 700;
}

.map-result-meta i {
    color: var(--brand);
}

.map-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.map-result-badge {
    min-height: 19px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f5f5f5;
    color: #656565;
    font-size: 9.5px;
    font-weight: 800;
}

.map-result-badge.is-verified {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.map-result-arrow {
    color: #b7b7b7;
    font-size: 11px;
}

.map-empty-state {
    display: grid;
    justify-items: center;
    padding: 42px 24px;
    text-align: center;
}

.map-empty-state > span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 22px;
}

.map-empty-state strong {
    margin-top: 15px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
}

.map-empty-state p {
    max-width: 280px;
    margin: 7px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.map-empty-state button {
    min-height: 40px;
    padding: 0 15px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

/* ------------------------------ Mapa ------------------------------ */

.map-canvas {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #e9ece7;
}

.map-canvas .wlm-map {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    z-index: 1;
}

.map-mobile-search {
    display: none;
}

.map-search-area {
    position: absolute;
    top: 20px;
    left: 50%;
    z-index: 25;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid rgba(22, 22, 22, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 850;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    transform: translateX(-50%);
    backdrop-filter: blur(15px);
}

.map-search-area:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.map-live-stats {
    position: absolute;
    left: 20px;
    top: 20px;
    z-index: 20;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(22, 22, 22, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.11);
    backdrop-filter: blur(16px);
}

.map-live-stats span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 9px;
    border-radius: 999px;
    color: #686868;
    font-size: 10.5px;
    font-weight: 700;
}

.map-live-stats strong {
    color: var(--ink);
    font-size: 12px;
}

.map-floating-controls {
    position: absolute;
    right: 18px;
    bottom: 28px;
    z-index: 22;
    display: grid;
    gap: 8px;
}

.map-floating-controls button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(22, 22, 22, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font-size: 15px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    backdrop-filter: blur(14px);
}

.map-floating-controls button:hover {
    color: var(--brand);
    transform: translateY(-1px);
}

.map-mobile-results-button {
    display: none;
}

.map-loading {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: #fff8f3;
    color: var(--ink);
    transition: opacity 0.32s ease;
}

.map-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.map-loading-heart {
    color: var(--brand);
    font-size: 31px;
    animation: map-heart 1s ease-in-out infinite alternate;
}

.map-loading strong {
    font-family: var(--font-display);
    font-size: 15px;
}

@keyframes map-heart {
    to {
        transform: scale(1.13);
    }
}

/* ------------------------ Ubicación ------------------------ */

.map-canvas .location-permission-card {
    top: 78px;
    right: 20px;
    width: min(390px, calc(100% - 40px));
    z-index: 35;
    padding: 21px;
    border-radius: 25px;
}

.map-canvas .location-permission-card[hidden] {
    display: none !important;
}

.location-permission-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f4f4f4;
    color: #555;
    cursor: pointer;
}

/* ------------------------ Marcadores v4 ------------------------ */

/*
 * El elemento root es el que MapLibre mueve mediante transform inline.
 * No se le aplica NINGÚN transform desde CSS. La animación se realiza en
 * .wlm-map-marker-v4-visual para que el pin conserve sus coordenadas reales.
 */
.wlm-map-marker-v4 {
    position: absolute;
    width: 46px;
    height: 50px;
    display: grid;
    place-items: end center;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    appearance: none;
    cursor: pointer;
    touch-action: manipulation;
    overflow: visible;
}

.wlm-map-marker-v4-visual {
    --marker-color: #6b7280;
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 15px 15px 15px 5px;
    background: var(--marker-color);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    transform-origin: 50% 100%;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease;
}

.wlm-map-marker-v4:hover .wlm-map-marker-v4-visual,
.wlm-map-marker-v4.is-active .wlm-map-marker-v4-visual {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 17px 34px rgba(0, 0, 0, 0.31);
    filter: saturate(1.08);
}

.wlm-map-marker-v4.is-active {
    z-index: 10 !important;
}

.wlm-map-marker-v4:focus-visible .wlm-map-marker-v4-visual {
    outline: 3px solid rgba(255, 56, 92, 0.35);
    outline-offset: 4px;
}

.wlm-map-marker-v4.is-active .wlm-map-marker-v4-visual::after {
    content: "";
    position: absolute;
    inset: -8px;
    z-index: -1;
    border: 2px solid color-mix(in srgb, var(--marker-color) 45%, transparent);
    border-radius: 20px 20px 20px 8px;
    pointer-events: none;
    animation: marker-focus 1.35s ease-out infinite;
}

@keyframes marker-focus {
    from {
        opacity: 0.9;
        transform: scale(0.84);
    }

    to {
        opacity: 0;
        transform: scale(1.18);
    }
}

.wlm-map-marker-v4-badge {
    position: absolute;
    top: -8px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    font-size: 8px;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.24);
    pointer-events: none;
}

.wlm-map-marker-v4-badge.is-event {
    right: -8px;
    background: var(--brand);
}

.wlm-map-marker-v4-badge.is-photo {
    left: -8px;
    background: #16a34a;
}

/* ---------------------------- Popup v3 ---------------------------- */

.map-route .maplibregl-popup-content {
    padding: 0 !important;
    overflow: hidden;
    border: 0;
    border-radius: 22px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22) !important;
}

.map-route .maplibregl-popup-close-button {
    top: 8px;
    right: 8px;
    z-index: 4;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 18px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
}

.wlm-popup-v3 {
    width: 310px;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    background: #fff;
}

.wlm-popup-cover {
    display: block;
    width: 100%;
    height: 138px;
    overflow: hidden;
}

.wlm-popup-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wlm-popup-body {
    padding: 15px 16px 16px;
}

.wlm-popup-v3 h3 {
    margin: 4px 0 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 18px;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.wlm-popup-v3 h3 a {
    color: inherit;
    font: inherit;
}

.wlm-popup-v3 > .wlm-popup-body > p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.wlm-popup-location {
    color: #777 !important;
    font-size: 11px !important;
    font-weight: 750;
}

.wlm-popup-location i {
    color: var(--brand);
}

.wlm-popup-schedule {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 11px;
    padding: 10px 11px;
    border: 1px solid #f0e6e8;
    border-radius: 14px;
    background: #fff7f8;
}

.wlm-popup-schedule > i {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
}

.wlm-popup-schedule strong,
.wlm-popup-schedule small {
    display: block;
}

.wlm-popup-schedule strong {
    color: var(--ink);
    font-size: 11.5px;
    line-height: 1.2;
}

.wlm-popup-schedule small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
}

.wlm-popup-v3 .wlm-popup-link {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
}

.wlm-popup-v3 .wlm-popup-link:hover {
    background: var(--brand);
}

/* Mueve los controles nativos para que no compitan con los propios. */
.map-route .maplibregl-ctrl-top-right {
    top: 72px;
    right: 8px;
}

.map-route .maplibregl-ctrl-group {
    border-radius: 15px !important;
}

/* ------------------------------ Responsive ------------------------------ */

@media (max-width: 1100px) {
    .map-app-shell {
        grid-template-columns: 370px minmax(0, 1fr);
    }

    .map-filter-actions {
        width: 370px;
    }

    .map-live-stats span:nth-child(4) {
        display: none;
    }
}

@media (max-width: 820px) {
    .map-route .topbar-inner {
        height: 66px;
    }

    .map-route .brand-logo {
        height: 34px;
    }

    .map-route .main-map-app {
        height: calc(100vh - 66px);
        height: calc(100dvh - 66px);
    }

    .map-app-shell {
        display: block;
    }

    .map-canvas {
        position: absolute;
        inset: 0;
    }

    .map-explorer {
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 8px;
        z-index: 55;
        width: auto;
        height: 48%;
        max-height: calc(100% - 12px);
        border: 1px solid rgba(22, 22, 22, 0.08);
        border-radius: 28px;
        box-shadow: 0 -20px 55px rgba(0, 0, 0, 0.17);
        transition: height 0.27s cubic-bezier(0.2, 0.85, 0.28, 1);
    }

    .map-explorer.is-collapsed {
        height: 178px;
    }

    .map-explorer.is-expanded {
        height: calc(100% - 12px);
    }

    .map-sheet-handle {
        width: 100%;
        height: 22px;
        flex: 0 0 22px;
        display: grid;
        place-items: center;
        border: 0;
        background: transparent;
        cursor: grab;
    }

    .map-sheet-handle span {
        width: 42px;
        height: 5px;
        border-radius: 999px;
        background: #d7d7d7;
    }

    .map-explorer-top {
        padding: 5px 14px 10px;
    }

    .map-explorer-heading {
        align-items: center;
    }

    .map-app-eyebrow {
        display: none;
    }

    .map-explorer-heading h1 {
        margin: 0;
        max-width: none;
        font-size: 21px;
    }

    .map-filter-open {
        min-height: 36px;
    }

    .map-explorer-top .map-search {
        display: none;
    }

    .map-quick-row {
        margin-top: 9px;
    }

    .map-results-head {
        min-height: 56px;
        padding: 9px 14px;
    }

    .map-results-head > div {
        min-width: 0;
    }

    .map-results-head span {
        max-width: 210px;
    }

    .map-explorer.is-collapsed .map-results-head,
    .map-explorer.is-collapsed .map-place-list {
        display: none;
    }

    .map-explorer .map-place-list {
        padding: 10px 10px 24px;
    }

    .map-place-result {
        grid-template-columns: 68px minmax(0, 1fr) 15px;
        min-height: 88px;
        border-radius: 18px !important;
    }

    .map-result-cover,
    .map-result-icon {
        width: 68px;
        height: 68px;
        border-radius: 14px;
    }

    .map-mobile-search {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 12px;
        z-index: 32;
        display: flex;
        min-height: 51px;
        padding: 0 8px 0 15px;
        border-radius: 999px;
    }

    .map-mobile-search input {
        height: 48px;
        font-size: 14px;
    }

    .map-mobile-search button {
        width: auto;
        min-width: 38px;
        padding: 0 10px;
        gap: 5px;
    }

    .map-search-area {
        top: 74px;
        min-height: 39px;
        padding: 0 13px;
        font-size: 11.5px;
    }

    .map-live-stats {
        display: none;
    }

    .map-floating-controls {
        right: 12px;
        bottom: 194px;
        transition: opacity 0.18s ease;
    }

    .map-floating-controls button {
        width: 43px;
        height: 43px;
        border-radius: 15px;
    }

    .map-mobile-results-button {
        position: absolute;
        right: 64px;
        bottom: 194px;
        z-index: 31;
        min-height: 43px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0 14px;
        border: 0;
        border-radius: 999px;
        background: var(--ink);
        color: #fff;
        font-size: 11.5px;
        font-weight: 850;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
        cursor: pointer;
    }

    .map-app-shell:has(.map-explorer:not(.is-collapsed)) .map-mobile-results-button,
    .map-app-shell:has(.map-explorer.is-expanded) .map-floating-controls {
        opacity: 0;
        pointer-events: none;
    }

    .map-filter-drawer {
        border-radius: 28px;
        padding-bottom: 90px;
    }

    .map-filter-actions {
        position: absolute;
        width: 100%;
        border-radius: 0 0 28px 28px;
    }

    .map-canvas .location-permission-card {
        left: 12px;
        right: 12px;
        top: 74px;
        width: auto;
        max-height: calc(100% - 270px);
        overflow-y: auto;
    }

    .map-route .maplibregl-ctrl-top-right {
        top: 120px;
        right: 4px;
    }

    .wlm-popup-v3 {
        width: min(290px, calc(100vw - 34px));
    }

    .wlm-popup-cover {
        height: 118px;
    }
}

@media (max-width: 430px) {
    .map-explorer {
        left: 5px;
        right: 5px;
        bottom: 5px;
        border-radius: 25px;
    }

    .map-explorer.is-collapsed {
        height: 174px;
    }

    .map-explorer-heading h1 {
        font-size: 19px;
    }

    .map-filter-open {
        padding: 0 10px;
        font-size: 11.5px;
    }

    .map-quick-row button {
        min-height: 33px;
        padding: 0 10px;
        font-size: 11px;
    }

    .map-results-head span {
        max-width: 170px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-explorer,
    .map-place-result,
    .map-filter-drawer,
    .wlm-map-marker-v4-visual,
    .map-loading-heart {
        animation: none !important;
        transition: none !important;
    }
}

/* =====================================================================
   WLM · Event stacks v3.2
   Un pin por ubicación, contador visible y todos los eventos accesibles.
   ===================================================================== */

.wlm-map-marker-v4-badge.is-event.is-count {
    right: -11px;
    width: auto;
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    border-width: 2px;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.map-place-result.is-event-result {
    min-height: 104px;
}

.map-place-result.is-event-result .map-result-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

.map-result-badge.is-date {
    background: #fff2f4;
    color: var(--brand-dark);
}

.map-result-venue {
    color: #9a9a9a;
}

.wlm-popup-v3.has-event-stack {
    width: 360px;
}

.wlm-popup-event-stack-head {
    display: grid;
    gap: 2px;
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid #f0e6e8;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff7f8, #fff);
}

.wlm-popup-event-stack-head span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 900;
}

.wlm-popup-event-stack-head span i {
    margin-right: 5px;
    color: var(--brand);
}

.wlm-popup-event-stack-head small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
}

.wlm-popup-v3 .wlm-popup-events {
    display: grid;
    gap: 7px;
    margin: 10px 0 0;
}

.wlm-popup-v3 .wlm-popup-events.is-scrollable {
    max-height: 286px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
}

.wlm-popup-v3 .wlm-popup-events.is-scrollable::-webkit-scrollbar {
    width: 6px;
}

.wlm-popup-v3 .wlm-popup-events.is-scrollable::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #d8d8d8;
}

.wlm-popup-v3 .wlm-popup-event {
    min-height: 62px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 7px;
    overflow: hidden;
    border: 1px solid #ededed;
    border-radius: 15px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.wlm-popup-v3 .wlm-popup-event:hover,
.wlm-popup-v3 .wlm-popup-event.is-active {
    border-color: rgba(255, 56, 92, 0.65);
    background: #fff8f9;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.wlm-popup-event-cover,
.wlm-popup-event-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
}

.wlm-popup-event-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wlm-popup-event-copy {
    min-width: 0;
}

.wlm-popup-v3 .wlm-popup-event-copy strong,
.wlm-popup-v3 .wlm-popup-event-copy small {
    display: block;
    margin: 0;
}

.wlm-popup-v3 .wlm-popup-event-copy strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 11.5px;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wlm-popup-event-kicker {
    margin-bottom: 2px !important;
    color: var(--brand) !important;
    font-size: 8.5px !important;
    font-weight: 900 !important;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.wlm-popup-event-date,
.wlm-popup-event-venue {
    margin-top: 3px !important;
    overflow: hidden;
    color: var(--muted) !important;
    font-size: 9.5px !important;
    font-weight: 650 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wlm-popup-event-date i {
    margin-right: 3px;
    color: var(--brand);
}

.wlm-popup-event-arrow {
    color: #b8b8b8;
    font-size: 9px;
}

.wlm-popup-v3 .wlm-popup-link.is-secondary {
    border: 1px solid #dedede;
    background: #fff;
    color: var(--ink);
}

.wlm-popup-v3 .wlm-popup-link.is-secondary:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

@media (max-width: 820px) {
    .wlm-popup-v3,
    .wlm-popup-v3.has-event-stack {
        width: min(360px, calc(100vw - 48px));
    }

    .wlm-popup-v3 .wlm-popup-events.is-scrollable {
        max-height: 230px;
    }
}
