.ar-map-layout {
            display: grid;
            grid-template-columns: 430px minmax(0, 1fr);
            gap: 0;
            min-height: calc(100vh - 190px);
            background: #fff;
            border: 1px solid var(--ar-line);
            border-radius: 10px;
            overflow: hidden;
        }

        .ar-map-list {
            max-height: calc(100vh - 190px);
            overflow: auto;
            border-right: 1px solid var(--ar-line);
            background: #f7f9fb;
            padding: 14px;
        }

        .ar-map-card {
            display: grid;
            grid-template-columns: 124px 1fr;
            gap: 12px;
            align-items: center;
            background: #fff;
            border: 1px solid var(--ar-line);
            border-radius: 14px;
            padding: 8px;
            margin-bottom: 10px;
            color: var(--ar-ink, #25313d);
            text-decoration: none;
            box-shadow: 0 1px 2px rgba(20, 30, 40, .05);
            transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
        }

        .ar-map-card:hover {
            border-color: transparent;
            box-shadow: 0 12px 28px rgba(20, 30, 40, .16);
            transform: translateY(-2px);
        }

        .ar-map-card img {
            width: 124px;
            height: 98px;
            object-fit: cover;
            object-position: center;
            border-radius: 10px;
            background: #e9eef3;
        }

        .ar-map-card strong {
            display: block;
            font-size: 15px;
            font-weight: 750;
            line-height: 1.22;
            margin-bottom: 4px;
            color: var(--ar-ink, #25313d);
        }

        .ar-map-card span {
            display: block;
            color: var(--ar-muted);
            font-size: 13px;
            line-height: 1.3;
        }

        .ar-map-card__price {
            margin-top: 6px !important;
            color: var(--ar-muted);
            font-size: 12.5px !important;
        }

        .ar-map-card__price strong {
            display: inline;
            font-size: 17px;
            font-weight: 850;
            color: var(--ar-brand-dark, #5c8413);
        }

        #ar-map {
            width: 100%;
            height: calc(100vh - 190px);
            min-height: 620px;
        }

        .ar-map-price {
            background: #fff;
            border: 1px solid #2f6f36;
            color: #173d1c;
            border-radius: 999px;
            padding: 5px 9px;
            font-weight: 800;
            box-shadow: 0 3px 12px rgba(0,0,0,.22);
        }

        .ar-map-popup {
            width: 230px;
        }

        .ar-map-popup img {
            width: 100%;
            height: 120px;
            object-fit: cover;
            border-radius: 6px;
            margin-bottom: 8px;
        }

        .ar-map-popup strong {
            display: block;
            margin-bottom: 5px;
        }

        @media(max-width: 900px) {
            .ar-map-layout {
                grid-template-columns: 1fr;
            }

            .ar-map-list {
                max-height: none;
                border-right: 0;
                border-bottom: 1px solid var(--ar-line);
            }

            #ar-map {
                height: 520px;
                min-height: 520px;
            }
        }

/* MAP_CLUSTERING_OPTIMIZATION_START */

.ar-map-cluster-icon {
    background: transparent;
    border: 0;
}

.ar-map-cluster {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--ar-brand-dark);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 8px 26px rgba(0,0,0,.30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 15px;
}

.ar-map-price {
    white-space: nowrap;
    min-width: 54px;
    text-align: center;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.leaflet-popup-content {
    margin: 12px;
}

@media(max-width: 900px) {
    .ar-map-layout {
        display: flex;
        flex-direction: column;
    }

    #ar-map {
        order: 1;
        height: 62vh;
        min-height: 460px;
    }

    .ar-map-list {
        order: 2;
        max-height: none;
    }

    .ar-map-card {
        grid-template-columns: 105px 1fr;
    }

    .ar-map-card img {
        width: 105px;
        height: 82px;
    }
}

/* MAP_CLUSTERING_OPTIMIZATION_END */

/* MAP_AJAX_VISIBLE_CARDS_START */

.ar-map-list__status {
    background: #fff;
    border: 1px solid var(--ar-line);
    border-radius: 10px;
    padding: 14px;
    color: var(--ar-muted);
    font-weight: 700;
    line-height: 1.35;
}

.ar-map-list__hint {
    margin: 0 2px 12px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #eef8df;
    border: 1px solid #cfe3ac;
    color: #3e6416;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
}

.ar-map-popup--lite {
    width: 210px;
}

.ar-map-popup--lite strong {
    font-size: 15px;
}

/* MAP_AJAX_VISIBLE_CARDS_END */

/* MAP_UX_DESKTOP_MOBILE_START */

.ar-map-marker-highlight {
    z-index: 9999 !important;
}

.ar-map-marker-highlight .ar-map-price {
    background: #eef8df;
    border-color: var(--ar-brand-darker);
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(0,0,0,.30);
}

.ar-map-mobile-list-toggle {
    display: none;
}

@media(max-width: 900px) {
    .ar-map-layout {
        position: relative;
        display: block;
        min-height: 68vh;
        overflow: hidden;
    }

    #ar-map {
        height: 68vh;
        min-height: 520px;
        order: initial;
    }

    .ar-map-list {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 650;
        max-height: 46vh;
        overflow: auto;
        border: 1px solid var(--ar-line);
        border-radius: 18px;
        background: #f7f9fb;
        box-shadow: 0 18px 46px rgba(0,0,0,.26);
        padding: 12px 12px 82px;
        transform: translateY(calc(100% + 18px));
        opacity: 0;
        pointer-events: none;
        transition: transform .22s ease, opacity .22s ease;
    }

    .ar-map-layout.is-list-open .ar-map-list {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .ar-map-mobile-list-toggle {
        position: absolute;
        left: 50%;
        bottom: 18px;
        transform: translateX(-50%);
        z-index: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: calc(100% - 36px);
        max-width: 420px;
        min-height: 54px;
        border: 1px solid var(--ar-line);
        border-radius: 999px;
        background: #ffffff;
        color: #18381d;
        font-size: 15px;
        font-weight: 900;
        box-shadow: 0 12px 34px rgba(0,0,0,.24);
    }

    .ar-map-mobile-list-toggle strong {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 26px;
        height: 26px;
        padding: 0 8px;
        border-radius: 999px;
        background: var(--ar-brand-dark);
        color: #fff;
        font-size: 13px;
        line-height: 1;
    }

    .ar-map-card {
        grid-template-columns: 96px 1fr;
        margin-bottom: 9px;
    }

    .ar-map-card img {
        width: 96px;
        height: 74px;
    }

    .ar-map-card strong {
        font-size: 14px;
    }

    .ar-map-card span {
        font-size: 12px;
    }
}

/* MAP_UX_DESKTOP_MOBILE_END */

/* MAP_CLUSTER_CARD_HOVER_START */

.ar-map-cluster-highlight {
    z-index: 9999 !important;
}

.ar-map-cluster-highlight .ar-map-cluster {
    background: var(--ar-brand-darker);
    transform: scale(1.16);
    box-shadow: 0 12px 34px rgba(0,0,0,.38);
}

.ar-map-hover-popup .leaflet-popup-content-wrapper {
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0,0,0,.28);
}

.ar-map-hover-popup .leaflet-popup-content {
    margin: 10px 12px;
}

.ar-map-hover-popup__inner {
    min-width: 190px;
}

.ar-map-hover-popup__inner strong {
    display: block;
    color: #173d1c;
    font-size: 14px;
    line-height: 1.25;
    margin-bottom: 4px;
}

.ar-map-hover-popup__inner span {
    display: block;
    color: var(--ar-muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.ar-map-hover-popup__inner em {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-style: normal;
    line-height: 1.3;
}

/* MAP_CLUSTER_CARD_HOVER_END */


/* === Fusionado desde ar-map-fullscreen.css (refactor CSS) === */
/*
 * AlojamientosRurales - Mapa fullscreen
 * Ajustes exclusivos de /casas-rurales/mapa para usar el mapa como herramienta principal.
 */

html.ar-map-page main#contenido-principal {
    padding: 0 !important;
}

/* El mapa va a ancho completo (100vw con break-out). Si hubiera barra de scroll vertical, 100vw la
   incluiría y reaparecería scroll horizontal; lo impedimos clipando el overflow horizontal de la
   página del mapa (no afecta al scroll vertical, que sigue siendo auto). */
html.ar-map-page,
html.ar-map-page body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

html.ar-map-page main#contenido-principal > .wrap,
html.ar-map-page .ar-public-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

html.ar-map-page .site-footer,
html.ar-map-page .ar-results-head {
    display: none !important;
}

html.ar-map-page .ar-top-search--unified,
html.ar-map-page .ar-top-search {
    margin-bottom: 0 !important;
}

html.ar-map-page .ar-map-layout {
    position: relative !important;
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100vh - 146px) !important;
    height: calc(100dvh - 146px) !important;
    min-height: 520px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #edf2f4 !important;
    overflow: hidden !important;
}

html.ar-map-page #ar-map {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

html.ar-map-page .ar-map-list {
    position: absolute !important;
    left: 24px !important;
    right: 24px !important;
    bottom: 24px !important;
    z-index: 650 !important;
    width: auto !important;
    max-width: 760px !important;
    max-height: min(52vh, 520px) !important;
    margin: 0 auto !important;
    overflow: auto !important;
    border: 1px solid var(--ar-line) !important;
    border-radius: 20px !important;
    background: #f7f9fb !important;
    box-shadow: 0 22px 56px rgba(0, 0, 0, .28) !important;
    padding: 14px 14px 88px !important;
    transform: translateY(calc(100% + 32px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform .22s ease, opacity .22s ease !important;
}

html.ar-map-page .ar-map-layout.is-list-open .ar-map-list {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

html.ar-map-page .ar-map-mobile-list-toggle {
    position: absolute !important;
    left: 50% !important;
    bottom: 24px !important;
    transform: translateX(-50%) !important;
    z-index: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: calc(100% - 48px) !important;
    max-width: 430px !important;
    min-height: 54px !important;
    border: 1px solid var(--ar-line) !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #18381d !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .24) !important;
}

html.ar-map-page .ar-map-mobile-list-toggle strong {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 26px !important;
    height: 26px !important;
    padding: 0 8px !important;
    border-radius: 999px !important;
    background: var(--ar-brand-dark) !important;
    color: #fff !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

@media (max-width: 900px) {
    html.ar-map-page .ar-map-layout {
        height: calc(100vh - 150px) !important;
        height: calc(100dvh - 150px) !important;
        min-height: 520px !important;
        /* Romper el padding lateral del .site-main para que el mapa quede a ancho
           completo de pantalla (si no, queda un margen blanco a la izquierda). */
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        border-radius: 0 !important;
    }

    html.ar-map-page .ar-map-list {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        max-width: none !important;
        max-height: 38vh !important;
        padding: 12px 12px 76px !important;
        border-radius: 18px !important;
    }

    html.ar-map-page .ar-map-mobile-list-toggle {
        bottom: 18px !important;
        width: calc(100% - 36px) !important;
    }
}

/* ===== Mapa v2: marcadores de pago destacados + popup con imagen + zoom web ===== */
html.ar-map-page .ar-map-price {
    background: #fff;
    border: 1px solid var(--ar-line, #d9ddd2);
    color: #1f2937;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(16, 24, 32, .18);
}
html.ar-map-page .ar-map-price.is-paid {
    background: var(--ar-brand, #79ad1a);
    border-color: var(--ar-brand-dark, #5c8413);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 5px 16px rgba(92, 132, 19, .5);
}
html.ar-map-page .ar-map-price__star { margin-right: 3px; color: #ffe07a; }
html.ar-map-page .ar-map-marker-highlight .ar-map-price { outline: 3px solid var(--ar-brand-dark, #5c8413); }

/* Popup con imagen (carga perezosa) */
html.ar-map-page .leaflet-popup-content { margin: 0; }
html.ar-map-page .leaflet-popup-content-wrapper { border-radius: 14px; overflow: hidden; padding: 0; }
html.ar-map-page .ar-map-popup--lite { display: block; position: relative; width: 220px; padding: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: inherit; text-decoration: none; cursor: pointer; }
html.ar-map-page .ar-map-popup__media { height: 120px; background: #eef2e6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
html.ar-map-page .ar-map-popup__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
html.ar-map-page .ar-map-popup__media-ph { width: 22px; height: 22px; border: 3px solid #cdd6c0; border-top-color: var(--ar-brand, #79ad1a); border-radius: 50%; animation: ar-map-spin .8s linear infinite; }
@keyframes ar-map-spin { to { transform: rotate(360deg); } }
html.ar-map-page .ar-map-popup__body { padding: 10px 12px 12px; }
html.ar-map-page .ar-map-popup__badge { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; background: var(--ar-brand-dark, #5c8413); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 9px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
html.ar-map-page .ar-map-popup--lite strong { display: block; font-size: 14px; color: #1f2937; margin: 0 0 4px; line-height: 1.3; }
html.ar-map-page .ar-map-popup__price { font-size: 13px; color: #5b6356; margin-bottom: 10px; }
html.ar-map-page .ar-map-popup--lite .button { display: block; text-align: center; background: var(--ar-brand-dark, #5c8413); color: #fff; padding: 8px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 13.5px; }
html.ar-map-page .ar-map-popup--lite .button:hover { background: #4a6b0f; }

/* Controles de zoom al estilo de la web */
html.ar-map-page .leaflet-control-zoom { border: 0 !important; border-radius: 12px !important; overflow: hidden; box-shadow: 0 6px 20px rgba(16, 24, 32, .18) !important; }
html.ar-map-page .leaflet-control-zoom a { width: 38px; height: 38px; line-height: 38px; background: #fff; color: #2f3a2a; font-size: 20px; font-weight: 700; border: 0; border-bottom: 1px solid var(--ar-line, #e4e7e1); }
html.ar-map-page .leaflet-control-zoom a:last-child { border-bottom: 0; }
html.ar-map-page .leaflet-control-zoom a:hover { background: var(--ar-brand-soft, #f1f8e3); color: var(--ar-brand-dark, #5c8413); }

/* ===== Split view en ESCRITORIO: lista lateral persistente + mapa (estilo Airbnb) ===== */
@media (min-width: 901px) {
    html.ar-map-page .ar-map-layout {
        display: grid !important;
        grid-template-columns: 420px minmax(0, 1fr) !important;
        /* Romper el contenedor con max-width para que el mapa ocupe TODO el ancho de la pantalla
           (sin márgenes laterales) también en escritorio/tablet. */
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        height: calc(100vh - 180px) !important;
        min-height: 520px !important;
        overflow: hidden !important;
    }
    html.ar-map-page .ar-map-list {
        position: static !important;
        left: auto !important; right: auto !important; bottom: auto !important;
        width: auto !important; max-width: none !important;
        height: 100% !important; max-height: none !important;
        margin: 0 !important;
        transform: none !important; opacity: 1 !important; pointer-events: auto !important;
        border: 0 !important; border-right: 1px solid var(--ar-line) !important; border-radius: 0 !important;
        box-shadow: none !important; background: #fff !important;
        padding: 12px !important; overflow: auto !important; z-index: auto !important;
    }
    html.ar-map-page #ar-map { width: 100% !important; height: 100% !important; min-height: 0 !important; }
    html.ar-map-page .ar-map-mobile-list-toggle { display: none !important; }
}

/* ===== Popup de hover (desde la tarjeta) enriquecido: mini-card con foto ===== */
html.ar-map-page .ar-map-hover-popup .leaflet-popup-content-wrapper { padding: 0 !important; border-radius: 12px !important; overflow: hidden; box-shadow: 0 12px 32px rgba(16, 24, 32, .3) !important; }
html.ar-map-page .ar-map-hover-popup .leaflet-popup-content { margin: 0 !important; width: 212px !important; }
html.ar-map-page .ar-map-hover-popup__img { width: 100%; height: 112px; object-fit: cover; display: block; background: #eef2e6; }
html.ar-map-page .ar-map-hover-popup__text { padding: 9px 12px 11px; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
html.ar-map-page .ar-map-hover-popup__text strong { display: block; font-size: 13.5px; color: #1f2937; line-height: 1.3; }
html.ar-map-page .ar-map-hover-popup__text > span { display: block; font-size: 12px; color: #6b7280; margin-top: 2px; }
html.ar-map-page .ar-map-hover-popup__price { color: var(--ar-brand-dark, #5c8413) !important; font-weight: 700; margin-top: 3px !important; }
html.ar-map-page .ar-map-hover-popup__text em { display: block; font-size: 11px; color: #9aa295; margin-top: 6px; font-style: normal; }

/* El pill de precio se CENTRA en su caja (iconSize 72x32) para quedar exactamente sobre el punto. */
html.ar-map-page .ar-map-price-icon { display: flex !important; align-items: center; justify-content: center; }

/* ===== Mapa MÓVIL: ocultar la cabecera del sitio para maximizar el mapa ===== */
@media (max-width: 900px) {
    html.ar-map-page .site-header { display: none !important; }
    /* El buscador queda arriba del todo, ocupando el sitio de la cabecera. */
    html.ar-map-page .ar-top-search,
    html.ar-map-page .ar-top-search--unified { position: sticky; top: 0; z-index: 1200; }
    /* Ocultar el titulo "X alojamientos en el mapa" en movil (gana espacio el mapa). */
    html.ar-map-page .ar-results-head { display: none !important; }
    /* El mapa ocupa casi toda la altura (solo descuenta el buscador). */
    html.ar-map-page .ar-map-layout {
        height: calc(100vh - 88px) !important;
        height: calc(100dvh - 88px) !important;
        min-height: 480px !important;
    }
}

/* ===== Selección persistente del listado/mapa (independiente del hover) ===== */
/* Tarjeta seleccionada en el listado (resaltado persistente; el hover usa otra clase de marcador). */
html.ar-map-page .ar-map-card.is-selected {
    border-color: var(--ar-brand-dark, #5c8413) !important;
    box-shadow: 0 0 0 2px var(--ar-brand-dark, #5c8413), 0 8px 22px rgba(20, 30, 40, .16) !important;
    background: var(--ar-brand-soft, #f1f8e3) !important;
}
/* Tarjeta FIJADA arriba (seleccionado fuera de los alojamientos visibles de la zona). */
html.ar-map-page .ar-map-card.is-pinned { position: relative; }
html.ar-map-page .ar-map-card__pin {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--ar-brand-dark, #5c8413);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .02em;
    padding: 2px 8px;
    border-radius: 999px;
}
/* Marcador seleccionado en el mapa: más fuerte y distinto del hover. */
html.ar-map-page .ar-map-marker-selected { z-index: 10000 !important; }
html.ar-map-page .ar-map-marker-selected .ar-map-price {
    background: var(--ar-brand-dark, #5c8413) !important;
    border-color: #fff !important;
    color: #fff !important;
    transform: scale(1.18);
    box-shadow: 0 0 0 3px rgba(92, 132, 19, .35), 0 8px 22px rgba(0, 0, 0, .3) !important;
}
html.ar-map-page .ar-map-cluster-selected .ar-map-cluster {
    box-shadow: 0 0 0 4px rgba(92, 132, 19, .45), 0 8px 26px rgba(0, 0, 0, .3) !important;
}
