/* ── Variables del tema Jaén Paraíso Interior ─────────────── */
.bc-esri-wrapper {
    --sans: Inter, sans-serif;
    --primary: Montserrat, sans-serif;
    --dark: #1d1e1c;
    --grey-text: #6b6b6b;
    --grey-line: #d9d9d9;
    --grey: #f2f2f2;
    --grey-background: #f9f9f9;
    --white: #ffffff;
    --black: #000000;
    --brand: yellow;
    --radius: 10px;
    --radius-pill: 20px;

    --color-restaurante: #c19041;
    --color-alojamiento: #1a56db;
}

/* ── Reset local ──────────────────────────────────────────── */
.bc-esri-wrapper *,
.bc-esri-wrapper *::before,
.bc-esri-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Wrapper — contenedor principal ───────────────────────── */
.bc-esri-wrapper {
    width: 100%;
    height: 820px;
    position: relative;
    overflow: hidden;
    font-family: var(--sans);
    background: var(--grey-background);
    isolation: isolate;
}

/* ── Mapa: fondo a pantalla completa ──────────────────────── */
.bc-esri-map-outer {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bc-esri-map-container {
    width: 100%;
    height: 100%;
}

/* ── Loader ───────────────────────────────────────────────── */
.bc-esri-loader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--grey);
    transition: opacity 0.3s ease;
}

.bc-esri-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.bc-esri-loader__spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--grey-line);
    border-top-color: var(--black);
    border-radius: 50%;
    animation: bc-esri-spin 0.8s linear infinite;
}

@keyframes bc-esri-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Botón toggle — fuera del panel, se desplaza con él ───── */
.bc-esri-map-actions {
    position: absolute;
    top: 15px;
    left: calc(460px + 15px);
    z-index: 10;
    display: flex;
    align-items: center;
    transition: left 0.5s ease;
}

.bc-esri-wrapper.results-closed .bc-esri-map-actions {
    left: 15px;
}

.bc-esri-results-toggle {
    background-color: var(--black);
    font-family: var(--sans);
    color: var(--white);
    text-transform: uppercase;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    transition: all .2s;
    white-space: nowrap;
}

.bc-esri-results-toggle:hover {
    background: var(--brand);
    color: var(--dark);
}

/* ── Panel lateral: filtros + resultados ─────────────────── */
.bc-esri-results-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 460px;
    z-index: 1;
    background: var(--white);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(0);
    transition: transform 0.5s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bc-esri-wrapper.results-closed .bc-esri-results-panel {
    transform: translateX(-100%);
}

/* ── Sidebar de filtros ────────────────────────────────────── */
.bc-esri-filters-sidebar {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: var(--white);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 65%;
}

.bc-esri-filters-sidebar.is-open {
    transform: translateX(0);
}

.bc-esri-filters-sidebar__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.bc-esri-filters-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 20px 16px;
    flex-shrink: 0;
}

.bc-esri-filters-sidebar__close {
    background: none;
}

.bc-esri-filters-sidebar__close:hover {
    opacity: 0.6;
}

.bc-esri-wrapper .filters-close {
    margin: 0;
    position: relative;
    display: block;
    top: 0;
    left: 0;
}

.bc-esri-filters-sidebar__title {
    font-family: var(--primary);
    color: var(--black);
    text-transform: uppercase;
    border-bottom-style: none;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    font-weight: 400;
    line-height: 34px;
    font-size: 20px;
    line-height: 24px;
}

.bc-esri-filters-sidebar__sections {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-line) transparent;
}

.bc-esri-filters-sidebar__sections::-webkit-scrollbar {
    width: 4px;
}

.bc-esri-filters-sidebar__sections::-webkit-scrollbar-thumb {
    background: var(--grey-line);
    border-radius: 4px;
}

.bc-esri-filters-sidebar__footer {
    flex-shrink: 0;
    padding: 16px 20px;
}

/* ── Sync toggle — mismo estilo que los ítems de faceta ───── */
.bc-esri-filter-sync {
    padding: 0 20px;
}

.bc-esri-filter-sync .bc-esri-faceta-item {
    border-bottom: 1px solid var(--grey-line);
}

.bc-esri-filter-sync .bc-esri-faceta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--sans);
}

/* ── Acordeón de sección ──────────────────────────────────── */
.bc-esri-filter-accordion {
    padding: 0 20px;
    margin-top: 20px;
}

.bc-esri-filter-accordion+.bc-esri-filter-accordion {
    margin-top: 40px;
}

.bc-esri-filter-accordion__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--dark);
    text-align: left;
    text-transform: uppercase;
    gap: 8px;
}

.bc-esri-filter-accordion__icon {
    color: var(--dark);
    flex-shrink: 0;
    transition: transform 0.2s;
    display: inline-flex;
    align-items: center;
    opacity: 0.6;
}

.bc-esri-filter-accordion:not(.is-open) .bc-esri-filter-accordion__icon {
    transform: rotate(180deg);
}

.bc-esri-filter-accordion__body {
    display: none;
}

.bc-esri-filter-accordion.is-open .bc-esri-filter-accordion__body {
    display: block;
}

/* ── Lista de facetas ─────────────────────────────────────── */
.bc-esri-faceta-list {
    list-style: none;
}

.bc-esri-faceta-list .bc-esri-faceta-item:nth-last-child(1) {
    border-bottom: none;
}

.bc-esri-faceta-item {
    display: block;
    border-bottom: 1px solid var(--grey-line);
}

.bc-esri-faceta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--sans);
}

.bc-esri-faceta-radio {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--grey-line);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.bc-esri-faceta-radio::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transition: opacity 0.15s;
}

.bc-esri-faceta-btn.is-active .bc-esri-faceta-radio {
    border-color: var(--dark);
    background: var(--dark);
}

.bc-esri-faceta-btn.is-active .bc-esri-faceta-radio::after {
    opacity: 1;
}

.bc-esri-faceta-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bc-esri-faceta-label {
    flex: 1;
    font-size: 13px;
    color: var(--dark);
    line-height: 1.3;
}

.bc-esri-faceta-count {
    display: none;
}

/* "Ver todo" / "Ver más" link */
.bc-esri-faceta-vermás {
    background: transparent;
    border-bottom: 1px solid var(--brand-color);
    font-family: var(--sans);
    color: var(--grey-text);
    text-transform: uppercase;
    padding-bottom: 3px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    transition: all .1s;
    display: inline-block;
    margin-top: 20px;
}

.bc-esri-faceta-vermás:hover {
    opacity: 0.7;
}

/* ── Date facet ──────────────────────────────────────────── */
.bc-esri-faceta-item--date {
    list-style: none;
    padding: 4px 0;
    border: none !important;
}

.bc-esri-date-input {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--dark);
    background: var(--white);
    border: 1px solid var(--grey-line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.2s;
}

.bc-esri-date-input:focus {
    outline: none;
    border-color: var(--dark);
}

/* ── Botón limpiar filtros ────────────────────────────────── */
.bc-esri-clear-filters {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    background-color: var(--grey-text);
    border: none;
    border-radius: var(--radius);
    padding: 14px 20px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.15s, color 0.15s;
    font-family: var(--primary);
    color: var(--white);
    text-transform: uppercase;
    font-weight: 700;
    line-height: 22px;
}

.bc-esri-clear-filters:hover {
    background-color: var(--brand);
    color: var(--dark);
}

/* ── Barra de filtros (reemplaza el antiguo bc-esri-filters) ── */
.bc-esri-filters-bar {
    flex-shrink: 0;
    background: var(--white);
}

/* Fila de pills activos */
.bc-esri-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px 0;
    min-height: 0;
}

.bc-esri-active-filters:empty {
    padding-top: 0;
}

/* Pill de filtro activo */
.bc-esri-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--grey);
    color: var(--dark);
    font-family: var(--sans);
    overflow: hidden;
    cursor: pointer;
    transition: background-color 0.15s;
}

.bc-esri-active-filter:not(.bc-esri-active-filter--clear-all):hover {
    background: var(--black);
    color: var(--grey);
}

.bc-esri-active-filter:hover .bc-esri-active-filter__label {
    color: var(--grey);
}

.bc-esri-active-filter__label {
    line-height: 1;
    white-space: nowrap;
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--sans);
    color: var(--black);
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
}

.bc-esri-active-filter__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--grey-text);
    transition: color 0.15s;
}

.bc-esri-active-filter:hover .bc-esri-active-filter__remove {
    color: var(--grey);
}

.bc-esri-active-filter__remove svg {
    display: block;
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

/* Pill "eliminar todos" — hereda estilos de .bc-esri-active-filter */
.bc-esri-active-filter--clear-all {
    background: var(--grey);
    color: var(--dark);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.bc-esri-active-filter--clear-all:hover {
    background: var(--black);
    color: var(--grey);
}

.bc-esri-active-filter__trash {
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Fila de acciones: botón filtros + conteo */
.bc-esri-filters-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    justify-content: space-between;
}

/* Botón redondo abrir filtros */
.bc-esri-open-filters-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.bc-esri-open-filters-btn:hover {
    opacity: 0.75;
}

.bc-esri-open-filters-btn.is-active {
    opacity: 0.85;
}

/* Conteo de resultados */
.bc-esri-results-count {
    font-family: var(--sans);
    color: var(--grey-text);
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 15px;
    text-transform: uppercase;
}

@media screen and (min-width: 1280px) {
    .bc-esri-results-count {
        font-size: 14px;
        line-height: 18px;
    }
}

/* ── Mosaico de resultados ────────────────────────────────── */
.bc-esri-mosaic {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-line) transparent;
}

.bc-esri-mosaic::-webkit-scrollbar {
    width: 4px;
}

.bc-esri-mosaic::-webkit-scrollbar-thumb {
    background: var(--grey-line);
    border-radius: 4px;
}

.bc-esri-mosaic__empty {
    width: 100%;
    text-align: center;
    color: var(--grey-text);
    font-size: 14px;
    padding: 24px 0;
}

/* ── Overlay (móvil: cierra el panel al tocar fuera) ──────── */
.bc-esri-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.35);
}

/* ── Selector de mapa base ────────────────────────────────── */
.bc-esri-basemap-bar {
    display: flex;
    gap: 5px;
}

.bc-esri-basemap-btn {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: var(--white);
    background: var(--dark);
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 14px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.bc-esri-basemap-btn:hover,
.bc-esri-basemap-btn.active {
    background: var(--brand);
    color: var(--dark);
}

/* ── Tarjeta — mosaico 3 columnas ─────────────────────────── */
.bc-esri-card {
    width: calc(33.33% - 9px);
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.bc-esri-card.is-highlighted .bc-esri-card__image-container {
    outline: 2px solid var(--dark);
    outline-offset: 2px;
}

.bc-esri-card__image-container {
    border-radius: var(--radius);
    width: 100%;
    padding-bottom: 125%;
    position: relative;
    overflow: hidden;
    background: var(--grey);
}

.bc-esri-card__image {
    object-fit: cover;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    transition: transform 0.2s ease;
}

.bc-esri-card:hover .bc-esri-card__image {
    transform: scale(1.05);
}

.bc-esri-card__image-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e8e4dc, #d6d0c4);
}

.bc-esri-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px;
}

.bc-esri-card__title {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    color: var(--dark);
    text-transform: uppercase;
}

.bc-esri-wrapper .bc-esri-card__category {
    font-size: 11px;
    font-weight: 500;
    color: var(--dark, #1d1e1c) !important;
}

.bc-esri-card__city {
    font-size: 11px;
    color: var(--grey-text);
    text-align: center;
}

/* ── ArcGIS popup — elimina chrome nativo, redondea ──────── */
.esri-popup__main-container {
    width: 240px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18) !important;
    max-height: 420px !important;
}

.esri-features__container:not(:empty) {
    padding: 0 !important;
}

.esri-popup *:focus,
.esri-popup *:focus-visible,
.esri-view-surface:focus,
.esri-view-surface:focus-visible,
.esri-view *:focus,
.esri-view *:focus-visible,
.esri-ui *:focus,
.esri-ui *:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Elimina el highlight azul nativo al hacer clic en el mapa */
.esri-view-surface--inset-outline:focus::after {
    outline: none !important;
}

.esri-view canvas {
    outline: none !important;
}

.esri-popup__header,
.esri-popup__navigation,
.esri-popup__footer {
    display: none !important;
}

calcite-action[id="close"],
calcite-action-menu {
    display: none !important;
}

.esri-popup__content-container {
    padding: 0 !important;
}

.esri-popup__content {
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Popup del mapa ───────────────────────────────────────── */
.bc-esri-popup {
    font-family: var(--sans);
    width: 100%;
}

.bc-esri-popup__image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 0;
    display: block;
    margin-bottom: 10px;
}

.bc-esri-popup__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 14px;
}

.bc-esri-popup__type {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--brand);
    color: var(--dark);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.bc-esri-popup__title {
    font-family: var(--primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark);
    text-decoration: none;
}

a.bc-esri-popup__title:hover {
    text-decoration: underline;
    color: var(--dark);
}

.bc-esri-map-error {
    max-width: 320px;
    text-align: center;
    color: var(--grey-text);
    font-size: 14px;
    font-family: var(--sans);
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--grey-line);
    border-radius: var(--radius);
}

/* ── Modo filtrado (solo mapa, sin panel ni controles) ────── */
.bc-esri-wrapper--filtered {
    height: 500px;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 1300px;
    margin: 0 auto;
    margin-block: 100px;
}

.bc-esri-wrapper--filtered .bc-esri-map-actions {
    display: none;
}

/* ── Responsive — Tablet ──────────────────────────────────── */
@media (max-width: 899px) {
    .bc-esri-wrapper {
        height: 700px;
    }

    .bc-esri-results-panel {
        width: 85%;
        max-width: 420px;
        transform: translateX(-100%);
    }

    .bc-esri-wrapper:not(.results-closed) .bc-esri-results-panel {
        transform: translateX(0);
    }

    .bc-esri-map-actions {
        left: 15px;
    }

    .bc-esri-wrapper:not(.results-closed) .bc-esri-map-actions {
        left: calc(min(85%, 420px) + 15px);
    }

    .bc-esri-card {
        width: calc(50% - 7px);
    }
}

/* ── Responsive — Móvil ───────────────────────────────────── */
@media (max-width: 599px) {
    .bc-esri-wrapper {
        height: 100svh;
    }

    .bc-esri-results-panel {
        width: 92%;
    }

    .bc-esri-card {
        width: calc(50% - 7px);
    }

    .bc-esri-map-actions,
    .bc-esri-wrapper:not(.results-closed) .bc-esri-map-actions {
        left: auto;
        right: 10px;
        top: 10px;
    }

    .bc-esri-wrapper--filtered {
        height: 400px;
    }
}

/* ── Cluster Popup styling ── */
.esri-popup__main-container:has(.bc-esri-popup--cluster) {
    width: 280px !important;
}

.bc-esri-popup--cluster {
    display: flex;
    flex-direction: column;
    max-height: 380px;
    background: var(--white, #ffffff);
}

.bc-esri-popup__cluster-header {
    font-family: var(--primary, Montserrat, sans-serif);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dark, #1d1e1c);
    padding: 10px 12px;
    border-bottom: 1px solid var(--grey-line, #d9d9d9);
    background: var(--grey-background, #f9f9f9);
    letter-spacing: 0.05em;
}

.bc-esri-popup__cluster-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--grey-line, #d9d9d9) transparent;
}

.bc-esri-popup__cluster-list::-webkit-scrollbar {
    width: 4px;
}

.bc-esri-popup__cluster-list::-webkit-scrollbar-thumb {
    background: var(--grey-line, #d9d9d9);
    border-radius: 4px;
}

.bc-esri-popup__cluster-item {
    border-bottom: 1px solid var(--grey, #f2f2f2);
    padding: 10px 12px;
    transition: background-color 0.2s ease;
}

.bc-esri-popup__cluster-item:last-child {
    border-bottom: none;
}

.bc-esri-popup__cluster-item:hover {
    background-color: var(--grey-background, #f9f9f9);
}

.bc-esri-popup__cluster-item-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.bc-esri-popup__cluster-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.bc-esri-popup__cluster-item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.bc-esri-popup__cluster-item-type {
    display: inline-block;
    align-self: flex-start;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--white, #ffffff);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1.1;
}

.bc-esri-popup__cluster-item-city {
    font-size: 10px;
    color: var(--grey-text, #6b6b6b);
}

.bc-esri-popup__cluster-item-title {
    font-family: var(--primary, Montserrat, sans-serif);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark, #1d1e1c);
    margin: 0;
}

.bc-esri-popup__cluster-item-title a,
a.bc-esri-popup__cluster-item-title {
    color: var(--dark, #1d1e1c) !important;
    text-decoration: none;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.bc-esri-popup__cluster-item-title a:hover,
a.bc-esri-popup__cluster-item-title:hover {
    text-decoration: underline;
}