/* ============================================================
   Cicerone Map Standalone — layout sidebar derecha
   Estilos alineados con el plugin single (AND-17)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700&family=Sora:wght@600;700&display=swap');

.cic-map-wrap {
    display: flex;
    width: 100%;
    height: calc(100vh - 80px);
    min-height: 500px;
    font-family: Roboto, inherit;
    position: relative;
}

/* ── Mapa ────────────────────────────────────────────────── */

.cic-map-el {
    flex: 1;
    height: 100% !important;
    min-height: 0;
    position: relative; /* necesario para que overlayPane se posicione correctamente */
    margin-right: -20px;
}

/* ── Sidebar filtros ─────────────────────────────────────── */

.cic-map-sidebar {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
    background: #fff;
    padding: 28px 20px 24px;
    overflow-y: auto;
    box-shadow: -3px 0 10px rgba(0,0,0,.08);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    border-radius: 16px 0 0 16px;
}

.cic-map-sidebar__title {
    font-size: 36px;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    color: #111827;
    margin: 0 0 24px;
    line-height: 1.1;
}

.cic-map-sidebar__section-title {
    font-size: 20px;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    color: var(--main-color, #08515D);
    margin: 0 0 10px;
    line-height: 1.2;
}

/* Chips de categoría — color propio por categoría vía --chip-bg/--chip-tx,
   igual que el plugin single (cicerone-chip) */
.cic-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cic-map-filter-chip {
    padding: 6px 14px;
    border-radius: 8px!important;
    border-width: 2px !important;
    border-style: solid !important;
    border-color: var(--chip-bg, var(--main-color, #08515D)) !important;
    background-color: #fff !important;
    color: #353534;
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    width: auto;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.cic-map-filter-chip:hover {
    background-color: color-mix(in srgb, var(--chip-bg, var(--main-color, #08515D)) 10%, #fff) !important;
	color: #0D1F0E!important;
}

.cic-map-filter-chip.is-active {
    background-color: var(--chip-bg, var(--main-color, #08515D)) !important;
    border-color: var(--chip-bg, var(--main-color, #08515D)) !important;
    color: var(--chip-tx, #fff) !important;
}

/* ── Cluster (guía §7) ───────────────────────────────────── */

.cic-map-cluster {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-family: Sora, sans-serif;
    font-weight: 700;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    border: 3px solid rgba(255,255,255,.6);
}

/* ── Popup (guía §10) ────────────────────────────────────── */

.cic-popup-clean .leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.25) !important;
    padding: 0 !important;
    overflow: hidden;
}

.cic-popup-clean .leaflet-popup-content {
    margin: 0 !important;
}

.cic-popup-clean .leaflet-popup-tip-container {
    display: none;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.25) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content { margin: 0 !important; }
.leaflet-popup-tip-container { display: none; }

.cic-map-popup {
    width: 200px;
    font-family: Roboto, sans-serif;
    overflow: hidden;
    border-radius: 12px;
}

.cic-map-popup__imgwrap {
    width: 100%;
    height: 140px;
    overflow: hidden;
}

.cic-map-popup__img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

/* Cuerpo con borde de color de marca (guía §10) */
.cic-map-popup__body {
    padding: 10px 12px;
    border-top: 1px solid #E0E0E0;
    background: #fff;
    border-radius: 0 0 12px 12px;
    /* El borde de 4px de color se aplica inline desde JS */
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.cic-map-popup__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.cic-map-popup__cat {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--main-color, #08515D);
    background: color-mix(in srgb, var(--main-color, #08515D) 10%, transparent);
    padding: 2px 7px;
    border-radius: 999px;
}

/* Título (guía §10) */
.cic-map-popup__name {
    margin: 0 0 8px;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #1A1A1A;
    text-align: center;
}

.cic-map-popup__btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 7px 14px;
    border-radius: 7px;
    color: #fff !important;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    transition: opacity .15s;
    margin-top: 8px;
    box-sizing: border-box;
}

.cic-map-popup__btn:hover { opacity: .88; }

/* ── Descripción expandible ──────────────────────────────── */

.cic-map-popup__desc {
    margin: 0 0 8px;
    font-size: .84rem;
    color: #4b5563;
    line-height: 1.5;
}

.cic-desc-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: .82rem;
    font-weight: 600;
    color: var(--main-color, #08515D);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-bottom: 4px;
}

.cic-desc-toggle:hover { opacity: .75; }

/* ── Pin inicio/fin etiqueta (guía §8) ───────────────────── */

.cic-map-pin-label {
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    background: #232C2C;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4.14px;
    -webkit-text-stroke: 3.75px #FFFFFF;
    paint-order: stroke fill;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .cic-map-wrap {
        flex-direction: column;
        height: auto;
    }
    .cic-map-el {
        height: 60vw !important;
        min-height: 300px;
    }
    .cic-map-sidebar {
        width: 100%;
        box-shadow: none;
        border-top: 1px solid #e5e7eb;
    }
    .cic-map-filters {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cic-map-filter-chip {
        width: auto;
    }
}