:root {
    --bg-color: #0b0d17;
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --accent-color: #c8a96b;
    --glass-bg: rgba(11, 13, 23, 0.58);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* =========================================================
   IBERIA SONORA · MAPA PEÑAS
   Reset solo para el módulo del mapa
   ========================================================= */

.ib-map-page,
.ib-map-page * {
    box-sizing: border-box;
}

.ib-map-page {
    position: relative;
    width: 100%;
    height: 72vh;
    min-height: 640px;
    max-height: 760px;

    color: var(--text-primary);
    background: var(--bg-color);

    overflow: hidden;
    border-radius: 0;
}

#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.leaflet-container {
    background: var(--bg-color) !important;
    font-family: inherit;
}

/* =========================================================
   UI GENERAL
   ========================================================= */

.ui-container {
    position: absolute;
    inset: 0;
    z-index: 1000;

    display: flex;
    flex-direction: column;

    padding: clamp(1rem, 2.5vw, 2rem);
    gap: 1.25rem;

    pointer-events: none;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 1px solid var(--glass-border);
    border-radius: 16px;

    padding: 1.25rem;

    pointer-events: auto;

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}

/* =========================================================
   LISTA DE LUGARES
   ========================================================= */

.locations-list {
    align-self: flex-start;

    width: min(320px, calc(100vw - 48px));
    max-width: 320px;

    margin-top: 0;
    margin-bottom: clamp(92px, 13vh, 128px);

    max-height: min(560px, calc(100svh - 220px));
    overflow: hidden;

    background:
        linear-gradient(135deg, rgba(10, 14, 28, 0.92), rgba(14, 18, 36, 0.76)),
        radial-gradient(circle at top left, rgba(200, 169, 107, 0.1), transparent 44%);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;

    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    display: flex;
    flex-direction: column;
}

@supports (height: 100dvh) {
    .locations-list {
        max-height: min(560px, calc(100dvh - 220px));
    }
}

.locations-list h3 {
    flex: 0 0 auto;

    margin: 0 0 0.9rem;
    padding-left: 0.78rem;

    font-size: 0.82rem;
    line-height: 1.2;
    letter-spacing: 0.18em;
    text-transform: uppercase;

    color: var(--accent-color);
}

.locations-list ul {
    list-style: none;

    margin: 0;
    padding: 0 0.2rem 0.2rem 0;

    display: flex;
    flex-direction: column;
    gap: 0.38rem;

    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: rgba(200, 169, 107, 0.45) rgba(255, 255, 255, 0.035);
}

.locations-list ul::-webkit-scrollbar {
    width: 6px;
}

.locations-list ul::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
    border-radius: 999px;
}

.locations-list ul::-webkit-scrollbar-thumb {
    background: rgba(200, 169, 107, 0.45);
    border-radius: 999px;
}

.locations-list li {
    cursor: pointer;

    padding: 0.52rem 0.78rem;

    border-radius: 12px;
    border-left: 2px solid transparent;

    font-size: 0.94rem;
    line-height: 1.18;
    font-weight: 700;

    color: rgba(255, 255, 255, 0.9);

    transition:
        background 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease;
}

.locations-list li:hover {
    background: rgba(255, 255, 255, 0.07);
    border-left-color: var(--accent-color);
    color: #fff;
    transform: translateX(4px);
}

.locations-list.is-hidden {
    display: none;
}

/* =========================================================
   MARCADORES
   ========================================================= */

.custom-marker {
    background: transparent;
    border: none;
}

.pulse-dot {
    width: 18px;
    height: 18px;

    background-color: var(--accent-color);
    border-radius: 50%;

    position: relative;

    box-shadow: 0 0 14px rgba(200, 169, 107, 0.9);
}

.pulse-dot::after {
    content: "";

    position: absolute;
    top: 50%;
    left: 50%;

    width: 100%;
    height: 100%;

    border-radius: 50%;
    background-color: var(--accent-color);

    transform: translate(-50%, -50%);
    animation: ibPulse 2s infinite ease-out;

    z-index: -1;
}

@keyframes ibPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.75;
    }

    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* =========================================================
   POPUP / TARJETA PREMIUM
   ========================================================= */

.leaflet-popup-pane {
    z-index: 1200 !important;
}

.leaflet-popup {
    margin-bottom: 18px !important;
}

.leaflet-popup-content-wrapper {
    position: relative;
    overflow: hidden !important;

    max-height: min(70vh, 640px) !important;

    background:
        radial-gradient(circle at 12% 0%, rgba(200, 169, 107, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(11, 15, 29, 0.96), rgba(16, 20, 36, 0.92)) !important;

    backdrop-filter: blur(18px) saturate(1.1) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.1) !important;

    border: 1px solid rgba(200, 169, 107, 0.22) !important;
    border-radius: 20px !important;

    color: var(--text-primary) !important;

    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.035),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;

    padding: 0 !important;
}

.leaflet-popup-content-wrapper::before {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.08),
            transparent 28%,
            transparent 68%,
            rgba(200, 169, 107, 0.08)
        );

    opacity: 0.65;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 390px !important;
    min-width: 340px !important;
    max-width: min(420px, calc(100vw - 42px)) !important;
}

.leaflet-popup-tip {
    background: rgba(14, 18, 34, 0.96) !important;
    border: 1px solid rgba(200, 169, 107, 0.18) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
}

.popup-inner {
    position: relative;

    display: flex;
    flex-direction: column;

    max-height: min(68vh, 620px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    scroll-behavior: smooth;
    overscroll-behavior: contain;

    padding-bottom: 1rem;

    scrollbar-width: thin;
    scrollbar-color: rgba(200, 169, 107, 0.42) rgba(255, 255, 255, 0.035);
}

.popup-inner::-webkit-scrollbar {
    width: 6px;
}

.popup-inner::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.035);
    border-radius: 999px;
}

.popup-inner::-webkit-scrollbar-thumb {
    background: rgba(200, 169, 107, 0.45);
    border-radius: 999px;
}

.popup-img-frame {
    width: 100%;
    height: clamp(150px, 34vw, 210px) !important;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    background:
        radial-gradient(circle at 50% 35%, rgba(200, 169, 107, 0.12), transparent 54%),
        linear-gradient(145deg, rgba(6, 8, 17, 0.92), rgba(13, 16, 29, 0.96));

    border-bottom: 1px solid rgba(200, 169, 107, 0.16);
}

.popup-img {
    width: 100%;
    height: 100% !important;

    object-fit: contain;
    object-fit: cover;
    object-position: center;
    display: block;

    filter: saturate(0.94) contrast(1.04);
}

.popup-text {
    position: relative;
    padding: 1.18rem 1.22rem 1.45rem !important;
}

.popup-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;

    margin-bottom: 0.68rem;
    padding: 0.34rem 0.66rem;

    border-radius: 999px;

    font-size: 0.64rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.popup-badge::before {
    content: "";

    width: 0.42rem;
    height: 0.42rem;

    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.popup-badge-active {
    background: rgba(91, 184, 91, 0.13);
    border: 1px solid rgba(91, 184, 91, 0.32);
    color: #a9e9a9;
}

.popup-badge-inactive {
    background: rgba(180, 91, 91, 0.13);
    border: 1px solid rgba(180, 91, 91, 0.32);
    color: #f2b0a9;
}

.popup-badge-other {
    background: rgba(200, 169, 107, 0.15);
    border: 1px solid rgba(200, 169, 107, 0.36);
    color: #f0d59a;
}

.popup-text h3 {
    margin: 0 0 0.56rem;

    color: var(--accent-color);

    font-size: 1.18rem;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.popup-text .popup-subtitle {
    position: relative;

    margin: 0 0 0.32rem;
    padding-left: 0.78rem;

    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 600;

    color: rgba(255, 255, 255, 0.74);
}

.popup-text .popup-subtitle::before {
    content: "";

    position: absolute;
    left: 0;
    top: 0.55em;

    width: 0.34rem;
    height: 0.34rem;

    border-radius: 999px;
    background: rgba(200, 169, 107, 0.72);
    box-shadow: 0 0 10px rgba(200, 169, 107, 0.45);
}

.popup-text p {
    max-height: 120px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding-right: 0.45rem;
    margin: 0.72rem 0 0;

    font-size: 0.86rem;
    line-height: 1.45;

    color: rgba(255, 255, 255, 0.66);

    scrollbar-width: thin;
    scrollbar-color: rgba(200, 169, 107, 0.45) rgba(255, 255, 255, 0.04);
}

.popup-text p::-webkit-scrollbar {
    width: 5px;
}

.popup-text p::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.popup-text p::-webkit-scrollbar-thumb {
    background: rgba(200, 169, 107, 0.46);
    border-radius: 999px;
}

.popup-text p:empty {
    display: none;
}

.popup-link {
    display: none !important;
}

/* Botón cerrar */

.leaflet-popup-close-button {
    top: 10px !important;
    right: 10px !important;

    width: 24px !important;
    height: 24px !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    border-radius: 999px !important;

    background: rgba(8, 11, 22, 0.68) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;

    color: rgba(255, 255, 255, 0.68) !important;

    font-size: 18px !important;
    line-height: 1 !important;

    transition:
        color 0.18s ease,
        background 0.18s ease,
        transform 0.18s ease;
}

.leaflet-popup-close-button:hover {
    color: var(--accent-color) !important;
    background: rgba(8, 11, 22, 0.9) !important;
    transform: rotate(90deg);
}

/* =========================================================
   AUDIO / VIDEO INLINE EN POPUP
   ========================================================= */

.popup-media-zone {
    margin-top: 1rem;
    width: 100%;
}

.popup-media-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;

    width: 100%;
    margin-bottom: 0.75rem;
}

.popup-audio-block,
.popup-video-block {
    display: flex !important;
    align-items: center;
    justify-content: center;

    margin: 0 !important;
    padding: 0 !important;
}

.popup-media-link,
.popup-audio-toggle,
.popup-video-toggle {
    appearance: none;
    cursor: pointer;

    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    border: 1px solid rgba(200, 169, 107, 0.38);

    color: #151515;
    background: rgba(243, 237, 227, 0.96);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.22),
        0 0 18px rgba(200, 169, 107, 0.14);

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.popup-media-link {
    text-decoration: none !important;
}

.popup-media-link:hover,
.popup-audio-toggle:hover,
.popup-video-toggle:hover {
    transform: translateY(-1px);
    background: #fff7e7;
    border-color: rgba(200, 169, 107, 0.58);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.28),
        0 0 22px rgba(200, 169, 107, 0.18);
}

.popup-media-link:focus,
.popup-audio-toggle:focus,
.popup-video-toggle:focus {
    outline: none;
}

.popup-media-link:focus-visible,
.popup-audio-toggle:focus-visible,
.popup-video-toggle:focus-visible {
    outline: 2px solid rgba(200, 169, 107, 0.72);
    outline-offset: 3px;
}

.popup-media-link span,
.popup-audio-icon,
.popup-video-icon {
    width: 1.35rem;
    height: 1.35rem;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    color: #f3ede3;
    background: #151515;

    font-size: 0.68rem;
    line-height: 1;

    transform: translateX(1px);
}

.popup-media-link span {
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    transform: none;
}

.popup-media-link-facebook span,
.popup-media-link-instagram span {
    font-size: 0.68rem;
}

.popup-audio-toggle.is-playing .popup-audio-icon {
    font-size: 0;
    transform: none;
}

.popup-audio-toggle.is-playing .popup-audio-icon::before {
    content: "♪";
    font-size: 0.84rem;
    line-height: 1;
}

.popup-spotify-toggle .popup-audio-icon {
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
    transform: none;
}

.popup-spotify-toggle.is-playing .popup-audio-icon::before {
    content: "×";
    font-size: 0.95rem;
}

.popup-video-toggle.is-playing .popup-video-icon {
    font-size: 0;
    transform: none;
}

.popup-video-toggle.is-playing .popup-video-icon::before {
    content: "×";
    font-size: 0.95rem;
    line-height: 1;
}

.popup-audio-player,
.popup-spotify-player,
.popup-video-player {
    width: 100% !important;
    max-width: 100% !important;

    margin-top: 0.9rem !important;
    margin-bottom: 0.9rem !important;

    clear: both;
}

.popup-audio-player[hidden],
.popup-spotify-player[hidden],
.popup-video-player[hidden] {
    display: none !important;
}

/* Audio */

.popup-audio-player {
    padding: 0.62rem;

    border-radius: 14px;
    border: 1px solid rgba(200, 169, 107, 0.16);

    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
        rgba(8, 11, 22, 0.5);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 10px 22px rgba(0, 0, 0, 0.18);
}

.popup-audio-player audio {
    width: 100%;
    display: block;
    border-radius: 12px;
    filter: invert(1) hue-rotate(180deg);
}

/* Spotify */

.popup-spotify-player {
    height: 80px !important;

    display: block;
    overflow: hidden;

    border-radius: 14px;
    border: 1px solid rgba(200, 169, 107, 0.18);

    background: rgba(8, 11, 22, 0.85);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 12px 26px rgba(0, 0, 0, 0.28);
}

.popup-spotify-player iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border: 0;
}

/* Vídeo YouTube */

.popup-video-player {
    aspect-ratio: 16 / 9 !important;

    display: block;
    overflow: hidden;

    border-radius: 14px;
    border: 1px solid rgba(200, 169, 107, 0.18);

    background: rgba(8, 11, 22, 0.85);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 12px 26px rgba(0, 0, 0, 0.28);
}

.popup-video-player iframe {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border: 0;
}

/* =========================================================
   ZOOM LEAFLET
   ========================================================= */

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.leaflet-control-zoom a,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    width: 30px !important;
    height: 30px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: 0 !important;
    margin: 0 !important;

    font-size: 22px !important;
    line-height: 1 !important;
    font-weight: 700 !important;

    text-indent: 0 !important;
    text-decoration: none !important;

    color: #f3ede3 !important;
    background: rgba(10, 12, 20, 0.82) !important;

    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
}

.leaflet-control-zoom-in {
    border-radius: 8px 8px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 8px 8px !important;
}

.leaflet-control-zoom a:hover {
    color: #c8a96b !important;
    background: rgba(20, 24, 38, 0.94) !important;
}

/* =========================================================
   PANEL CONTROL
   ========================================================= */

.map-controls.ib-status-controls {
    position: absolute;
    left: clamp(1rem, 2.5vw, 2rem);
    bottom: clamp(14px, 3vh, 28px);

    z-index: 1002 !important;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    justify-content: stretch;
    gap: 0.55rem;

    width: min(320px, calc(100vw - 48px));
    min-width: 0;
    max-width: 320px;

    padding: 0.65rem;

    border-radius: 16px;

    background: rgba(12, 15, 24, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);

    pointer-events: auto;
}

.ib-status-filter {
    position: relative;

    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;

    min-width: 0;
    padding: 0.72rem 1rem;

    border-radius: 999px;

    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-align: center;

    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.045);

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

#toggle-locations-list {
    grid-column: 1 / -1;
}

.ib-status-filter::before,
.ib-status-filter.is-active::before,
.ib-status-filter:hover::before,
.ib-status-filter:focus::before,
.ib-status-filter.is-active:hover::before,
.ib-status-filter.is-active:focus::before {
    display: none;
    content: none;
}

.ib-status-filter:hover {
    color: rgba(255, 255, 255, 0.94);
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.ib-status-filter:focus {
    outline: none;
}

.ib-status-filter:focus:not(.is-active) {
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.ib-status-filter:focus-visible {
    outline: 2px solid rgba(200, 169, 107, 0.7);
    outline-offset: 3px;
}

.ib-status-filter:active {
    transform: translateY(0);
}

.ib-status-filter.is-active {
    color: #151515;
    background: #f3ede3;
    border-color: rgba(243, 237, 227, 0.75);

    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 10px 28px rgba(243, 237, 227, 0.16);
}

.ib-status-filter.is-active:hover,
.ib-status-filter.is-active:focus {
    color: #151515;
    background: #f3ede3;
    border-color: rgba(243, 237, 227, 0.75);
}

/* =========================================================
   LEAFLET ATTRIBUTION
   ========================================================= */

.leaflet-control-attribution {
    opacity: 0.12;

    font-size: 8px;
    line-height: 1.1;

    background: rgba(5, 8, 16, 0.35) !important;
    color: rgba(243, 237, 227, 0.35) !important;

    border-radius: 8px 0 0 0;
    padding: 2px 6px !important;

    transition: opacity 0.2s ease;
}

.leaflet-control-attribution:hover {
    opacity: 0.85;
}

.leaflet-control-attribution a {
    color: rgba(243, 237, 227, 0.58) !important;
    text-decoration: none;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {
    .ib-map-page {
        height: 72vh;
        min-height: 560px;
        max-height: 720px;
    }

    .ui-container {
        padding: 1.25rem;
    }

    .locations-list {
        width: min(300px, calc(100vw - 40px));
        max-width: 300px;
        max-height: min(480px, calc(100svh - 210px));
        margin-bottom: 112px;
    }

    @supports (height: 100dvh) {
        .locations-list {
            max-height: min(480px, calc(100dvh - 210px));
        }
    }

    .map-controls.ib-status-controls {
        width: min(300px, calc(100vw - 40px));
        max-width: 300px;
    }

    .ib-status-filter {
        min-width: 0;
        padding: 0.68rem 0.85rem;
        font-size: 0.84rem;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {
    body.page-template-page-mapa {
        overflow: hidden;
    }

    body.page-template-page-mapa #content,
    body.page-template-page-mapa .site-content,
    body.page-template-page-mapa .content-area,
    body.page-template-page-mapa .site-main {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .ib-map-page {
        height: calc(100svh - 86px);
        min-height: calc(100svh - 86px);
        max-height: none;
        margin-top: 0;
        overflow: hidden;
    }

    @supports (height: 100dvh) {
        .ib-map-page {
            height: calc(100dvh - 86px);
            min-height: calc(100dvh - 86px);
        }
    }

    .ui-container {
        position: absolute;
        inset: 0;
        padding: 0;
        pointer-events: none;
    }

    .locations-list {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom));

        width: auto;
        max-width: none;

        max-height: 22svh;
        margin: 0;
        padding: 0.78rem 0.82rem;

        border-radius: 16px;

        background:
            linear-gradient(135deg, rgba(10, 14, 28, 0.94), rgba(14, 18, 36, 0.78)),
            radial-gradient(circle at top left, rgba(200, 169, 107, 0.08), transparent 42%);

        box-shadow:
            0 16px 38px rgba(0, 0, 0, 0.36),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);

        pointer-events: auto;
        z-index: 1003;
    }

    @supports (height: 100dvh) {
        .locations-list {
            max-height: 22dvh;
        }
    }

    .locations-list h3 {
        margin: 0 0 0.62rem;
        padding-left: 0.56rem;

        font-size: 0.68rem;
        line-height: 1.16;
        letter-spacing: 0.16em;
    }

    .locations-list ul {
        max-height: calc(22svh - 38px);

        overflow-y: auto;
        overflow-x: hidden;

        display: flex;
        flex-direction: column;
        gap: 0.22rem;

        padding: 0 0.12rem 0 0;
    }

    @supports (height: 100dvh) {
        .locations-list ul {
            max-height: calc(22dvh - 38px);
        }
    }

    .locations-list li {
        white-space: normal;

        padding: 0.4rem 0.56rem;

        font-size: 0.76rem;
        line-height: 1.14;
        font-weight: 700;

        border-radius: 9px;
    }

    .locations-list li:hover {
        transform: none;
    }

    .map-controls.ib-status-controls {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        transform: none;

        width: auto;
        max-width: none;

        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 0.3rem;

        overflow-x: auto;
        overflow-y: hidden;

        padding: 0.42rem;

        border-radius: 18px;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;

        z-index: 1004;
    }

    .map-controls.ib-status-controls::-webkit-scrollbar {
        display: none;
    }

    .ib-status-filter {
        flex: 0 0 auto;

        min-width: auto;
        width: auto;

        padding: 0.58rem 0.68rem;

        font-size: 0.68rem;
        line-height: 1;
        white-space: nowrap;
    }

    .ib-mobile-location-card[hidden] {
        display: none;
    }

    .ib-mobile-location-card {
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 3000;

        width: min(400px, calc(100% - 28px));
        max-height: calc(100% - 28px);
        transform: translate(-50%, -50%);

        overflow: hidden;
        pointer-events: auto;

        border: 1px solid rgba(200, 169, 107, 0.22);
        border-radius: 18px;
        background: rgba(14, 18, 34, 0.98);
        box-shadow: 0 22px 54px rgba(0, 0, 0, 0.58);
    }

    .ib-mobile-location-card-content {
        max-height: calc(100svh - 120px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .ib-mobile-location-card .popup-inner {
        max-height: none !important;
    }

    .ib-mobile-location-card-close {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 3;

        width: 34px;
        height: 34px;
        padding: 0;

        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 50%;
        color: #fff;
        background: rgba(8, 11, 22, 0.88);

        font-size: 24px;
        line-height: 30px;
        text-align: center;
        cursor: pointer;
    }

    .leaflet-popup-content {
        width: 300px !important;
        min-width: 270px !important;
        max-width: calc(100vw - 38px) !important;
    }

    .leaflet-popup-content-wrapper {
        max-height: 68vh !important;
    }

    .popup-inner {
        max-height: 66vh !important;
    }

    .popup-img-frame {
        height: clamp(118px, 40vw, 155px) !important;
    }

    .popup-text {
        padding: 0.95rem !important;
    }

    .popup-badge {
        font-size: 0.56rem;
        padding: 0.28rem 0.56rem;
        margin-bottom: 0.56rem;
    }

    .popup-text h3 {
        font-size: 1rem;
        line-height: 1.14;
    }

    .popup-text .popup-subtitle {
        font-size: 0.74rem;
    }

    .popup-text p {
        max-height: 95px !important;
        margin-top: 0.58rem;
        font-size: 0.76rem;
        line-height: 1.4;
    }

    .popup-media-zone {
        margin-top: 0.75rem;
    }

    .popup-media-actions {
        gap: 0.38rem;
    }

    .popup-media-link,
    .popup-audio-toggle,
    .popup-video-toggle {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }

    .popup-media-link span,
    .popup-audio-icon,
    .popup-video-icon {
        width: 1.18rem;
        height: 1.18rem;
        font-size: 0.6rem;
    }

    .popup-audio-toggle.is-playing .popup-audio-icon::before {
        font-size: 0.74rem;
    }

    .popup-video-toggle.is-playing .popup-video-icon::before {
        font-size: 0.82rem;
    }

    .popup-audio-player,
    .popup-spotify-player,
    .popup-video-player {
        margin-top: 0.58rem !important;
    }

    .popup-audio-player {
        padding: 0.5rem;
    }

    .leaflet-control-zoom {
        margin-top: 10px !important;
        margin-right: 8px !important;
    }

    .leaflet-bottom.leaflet-right {
        bottom: 66px;
    }
}

/* móviles altos pero estrechos */

@media (max-width: 430px) and (min-height: 850px) {
    .ib-map-page {
        height: calc(100svh - 92px);
        min-height: calc(100svh - 92px);
    }

    @supports (height: 100dvh) {
        .ib-map-page {
            height: calc(100dvh - 92px);
            min-height: calc(100dvh - 92px);
        }
    }

    .locations-list {
        max-height: 24svh;
    }

    @supports (height: 100dvh) {
        .locations-list {
            max-height: 24dvh;
        }
    }

    .locations-list ul {
        max-height: calc(24svh - 38px);
    }

    @supports (height: 100dvh) {
        .locations-list ul {
            max-height: calc(24dvh - 38px);
        }
    }
}

/* móviles muy pequeños */

@media (max-width: 390px) {
    .ib-map-page {
        height: calc(100svh - 82px);
        min-height: calc(100svh - 82px);
    }

    @supports (height: 100dvh) {
        .ib-map-page {
            height: calc(100dvh - 82px);
            min-height: calc(100dvh - 82px);
        }
    }

    .locations-list {
        left: 10px;
        right: 10px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        max-height: 20svh;
        padding: 0.85rem;
    }

    @supports (height: 100dvh) {
        .locations-list {
            max-height: 20dvh;
        }
    }

    .locations-list ul {
        max-height: calc(20svh - 36px);
    }

    @supports (height: 100dvh) {
        .locations-list ul {
            max-height: calc(20dvh - 36px);
        }
    }

    .locations-list li {
        font-size: 0.8rem;
        padding: 0.44rem 0.58rem;
    }

    .ib-status-filter {
        padding: 0.56rem 0.55rem;
        font-size: 0.64rem;
    }
}

/* pantallas bajas desktop */

@media (max-height: 700px) and (min-width: 769px) {
    .ib-map-page {
        height: 70vh;
        min-height: 560px;
    }

    .locations-list {
        max-height: calc(100vh - 190px);
        margin-bottom: 96px;
    }

    .locations-list li {
        padding: 0.48rem 0.7rem;
        font-size: 0.9rem;
    }

    .map-controls.ib-status-controls {
        bottom: 16px;
    }
}
