/* ============================================================
   CERCA — MAP.CSS
   MAPA V6.3 LIMPIO
   Leaflet + Skyline + Comunidad + Filtros + Ruta CERCA
   ============================================================ */


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

.spinning {
    animation: spin .7s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}


/* ============================================================
   CONTENEDOR PRINCIPAL DEL MAPA
   ============================================================ */

.map-wrapper {
    position: relative !important;
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    overflow: hidden;
    background: #0b1329;
}

#mapContainer {
    position: absolute !important;
    inset: 0 !important;

    width: 100%;
    height: 100%;

    background: #0b1329;

    border-radius: 0 !important;

    z-index: 1 !important;
}


/* ============================================================
   LIMPIEZA DE CONTROLES ANTIGUOS
   ============================================================ */

/* Barra vieja de chips */
.map-filter-floating {
    display: none !important;
}

/* Leyenda permanente vieja */
.aj-map-legend {
    display: none !important;
}

/* Tráfico en vivo viejo */
#cercaTrafficMap14,
.cerca-traffic-toggle14,
.cerca-traffic-mode14 {
    display: none !important;
}

/* Botón viejo de filtros */
.aj-map-filters-button {
    display: none !important;
}

/* Ruta CERCA antigua dentro del mapa principal */
#view-mapa #ajOpenSafeRoute,
#view-mapa #ajMapSafeFab {
    display: none !important;
}


/* ============================================================
   BOTÓN PRINCIPAL "FILTROS"
   ============================================================ */

.cerca-map-clean-controls {
    position: absolute;

    top: 14px;
    left: 14px;

    z-index: 1200;

    pointer-events: auto;
}

.cerca-map-filter-main {
    min-height: 46px;

    padding: 0 16px;

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

    background: rgba(15,23,42,.94);

    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font: inherit;
    font-size: .82rem;
    font-weight: 900;

    cursor: pointer;

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    box-shadow:
        0 10px 28px rgba(0,0,0,.38),
        inset 0 1px 0 rgba(255,255,255,.05);

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

.cerca-map-filter-main:active {
    transform: scale(.96);
}

.cerca-map-filter-main .material-icons-round {
    color: #f59e0b;
    font-size: 21px;
}

body.light-theme .cerca-map-filter-main {
    background: rgba(255,255,255,.96);
    color: #0f172a;
    border-color: rgba(15,23,42,.12);
}


/* ============================================================
   PANEL INFERIOR DE FILTROS
   ============================================================ */

.cerca-map-filter-sheet {
    position: fixed;

    inset: 0;

    z-index: 9000;

    visibility: hidden;
    pointer-events: none;
}

.cerca-map-filter-sheet.show {
    visibility: visible;
    pointer-events: auto;
}


/* Fondo oscuro */

.cerca-map-filter-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(2,6,23,.68);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    opacity: 0;

    transition: opacity .22s ease;
}

.cerca-map-filter-sheet.show .cerca-map-filter-backdrop {
    opacity: 1;
}


/* Panel */

.cerca-map-filter-panel {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;

    max-height: min(82vh, 720px);

    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    padding:
        10px
        16px
        calc(20px + env(safe-area-inset-bottom));

    background:
        linear-gradient(
            180deg,
            rgba(15,23,42,.99),
            rgba(8,15,28,.99)
        );

    color: #fff;

    border-top: 1px solid rgba(148,163,184,.18);

    border-radius: 26px 26px 0 0;

    box-shadow: 0 -20px 50px rgba(0,0,0,.55);

    transform: translateY(105%);

    transition: transform .28s cubic-bezier(.2,.8,.2,1);
}

.cerca-map-filter-sheet.show .cerca-map-filter-panel {
    transform: translateY(0);
}

body.light-theme .cerca-map-filter-panel {
    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.99),
            rgba(248,250,252,.99)
        );

    color: #0f172a;

    border-color: rgba(15,23,42,.10);
}


/* ============================================================
   MANIJA DEL PANEL
   ============================================================ */

.cerca-map-filter-handle {
    width: 46px;
    height: 5px;

    margin: 1px auto 13px;

    border-radius: 999px;

    background: rgba(148,163,184,.46);
}


/* ============================================================
   ENCABEZADO DEL PANEL
   ============================================================ */

.cerca-map-filter-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 18px;
}

.cerca-map-filter-header > div {
    min-width: 0;
}

.cerca-map-filter-header small {
    display: block;

    color: #f59e0b;

    font-size: .61rem;
    font-weight: 950;

    letter-spacing: .12em;
}

.cerca-map-filter-header strong {
    display: block;

    margin-top: 3px;

    color: inherit;

    font-size: 1.12rem;
    font-weight: 900;

    line-height: 1.15;
}

.cerca-map-filter-close {
    flex: none;

    width: 42px;
    height: 42px;

    border: 1px solid rgba(148,163,184,.15);
    border-radius: 13px;

    background: rgba(148,163,184,.10);

    color: inherit;

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

    cursor: pointer;
}

.cerca-map-filter-close .material-icons-round {
    font-size: 22px;
}


/* ============================================================
   SECCIONES DEL PANEL
   ============================================================ */

.cerca-map-filter-section {
    margin-bottom: 20px;
}

.cerca-map-filter-title {
    display: flex;

    align-items: center;

    gap: 7px;

    margin-bottom: 10px;

    color: #cbd5e1;

    font-size: .72rem;
    font-weight: 900;

    letter-spacing: .02em;
}

body.light-theme .cerca-map-filter-title {
    color: #475569;
}

.cerca-map-filter-title .material-icons-round {
    color: #f59e0b;

    font-size: 18px;
}


/* ============================================================
   GRID DE CATEGORÍAS
   ============================================================ */

.cerca-map-filter-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 8px;
}

.cerca-map-filter-row {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 8px;
}


/* ============================================================
   BOTONES DE FILTRO
   ============================================================ */

.cerca-map-filter-option {
    width: 100%;

    min-height: 60px;

    padding: 10px 11px;

    border: 1px solid rgba(148,163,184,.16);
    border-radius: 15px;

    background: rgba(30,41,59,.78);

    color: #e2e8f0;

    display: flex;

    align-items: center;

    gap: 9px;

    text-align: left;

    font: inherit;

    cursor: pointer;

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

.cerca-map-filter-option:active {
    transform: scale(.97);
}

.cerca-map-filter-option:hover {
    border-color: rgba(245,158,11,.38);
}

body.light-theme .cerca-map-filter-option {
    background: #fff;

    color: #0f172a;

    border-color: rgba(15,23,42,.10);
}

.cerca-map-filter-option .material-icons-round {
    flex: none;

    font-size: 23px;

    color: #f59e0b;
}

.cerca-map-filter-option b {
    font-size: .74rem;

    font-weight: 900;

    line-height: 1.15;
}

.cerca-map-filter-option small {
    width: 100%;

    display: block;

    color: #94a3b8;

    font-size: .59rem;

    line-height: 1.2;
}

.cerca-map-filter-option.wide {
    flex-wrap: wrap;

    align-content: center;
}


/* Estado activo */

.cerca-map-filter-option.active {
    border-color: rgba(245,158,11,.75);

    background: rgba(245,158,11,.14);

    color: #fff;

    box-shadow:
        inset 0 0 0 1px rgba(245,158,11,.15),
        0 5px 15px rgba(0,0,0,.12);
}

body.light-theme .cerca-map-filter-option.active {
    color: #0f172a;

    background: rgba(245,158,11,.12);
}


/* ============================================================
   COLORES POR ICONO
   ============================================================ */

.cerca-map-filter-option[data-map-filter="accidente"]
.material-icons-round {
    color: #ef4444;
}

.cerca-map-filter-option[data-map-filter="trafico"]
.material-icons-round {
    color: #f59e0b;
}

.cerca-map-filter-option[data-map-filter="seguridad"]
.material-icons-round {
    color: #a855f7;
}

.cerca-map-filter-option[data-map-filter="emergencia"]
.material-icons-round {
    color: #f97316;
}

.cerca-map-filter-option[data-map-filter="inundacion"]
.material-icons-round {
    color: #38bdf8;
}

.cerca-map-filter-option[data-map-filter="clima"]
.material-icons-round {
    color: #60a5fa;
}

.cerca-map-filter-option[data-map-filter="agua"]
.material-icons-round,
.cerca-map-filter-option[data-map-filter="fuga"]
.material-icons-round {
    color: #3b82f6;
}

.cerca-map-filter-option[data-map-filter="vialidad"]
.material-icons-round {
    color: #fb923c;
}

.cerca-map-filter-option[data-map-filter="movilidad"]
.material-icons-round {
    color: #06b6d4;
}

.cerca-map-filter-option[data-map-filter="sos"]
.material-icons-round {
    color: #ef4444;
}

.cerca-map-filter-option[data-map-origin="skyline"]
.material-icons-round {
    color: #22d3ee;
}

.cerca-map-filter-option[data-map-origin="ciudadano"]
.material-icons-round {
    color: #10b981;
}

.cerca-map-filter-option[data-map-filter="__verificadas__"]
.material-icons-round {
    color: #10b981;
}

.cerca-map-filter-option[data-map-filter="__eventos__"]
.material-icons-round {
    color: #8b5cf6;
}


/* ============================================================
   LEYENDA DENTRO DEL PANEL
   ============================================================ */

.cerca-map-legend-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0,1fr));

    gap: 8px;
}

.cerca-map-legend-grid > div {
    min-height: 44px;

    padding: 8px 10px;

    border: 1px solid rgba(148,163,184,.12);
    border-radius: 12px;

    background: rgba(30,41,59,.52);

    display: flex;

    align-items: center;

    gap: 8px;

    color: #cbd5e1;

    font-size: .67rem;

    font-weight: 700;
}

body.light-theme .cerca-map-legend-grid > div {
    background: rgba(15,23,42,.035);

    color: #334155;
}

.cerca-map-legend-grid .material-icons-round {
    flex: none;

    color: #f59e0b;

    font-size: 20px;
}


/* ============================================================
   MOSTRAR TODO
   ============================================================ */

.cerca-map-filter-reset {
    width: 100%;

    min-height: 50px;

    margin-top: 3px;

    border: 0;
    border-radius: 15px;

    background:
        linear-gradient(
            135deg,
            #f59e0b,
            #f97316
        );

    color: #111827;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    font: inherit;

    font-size: .78rem;
    font-weight: 950;

    cursor: pointer;

    box-shadow:
        0 8px 24px rgba(245,158,11,.20);
}

.cerca-map-filter-reset:active {
    transform: scale(.98);
}


/* Bloquear scroll detrás del sheet */

body.map-filter-open {
    overflow: hidden;
}


/* ============================================================
   TOOLBAR DERECHA DEL MAPA
   ============================================================ */

.aj-map-toolbar {
    position: absolute;

    top: 110px;
    right: 14px;

    z-index: 1100;

    display: flex;

    flex-direction: column;

    gap: 10px;
}

.aj-map-tool {
    width: 48px;
    height: 48px;

    padding: 0;

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

    background: rgba(15,23,42,.92);

    color: #fff;

    display: flex;

    align-items: center;
    justify-content: center;

    cursor: pointer;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    box-shadow:
        0 8px 24px rgba(0,0,0,.32);

    transition:
        transform .15s ease,
        background .15s ease;
}

.aj-map-tool:active {
    transform: scale(.94);
}

.aj-map-tool:hover {
    background: rgba(30,41,59,.98);
}

.aj-map-tool .material-icons-round {
    font-size: 25px;
}

body.light-theme .aj-map-tool {
    background: rgba(255,255,255,.94);

    color: #0f172a;

    border-color: rgba(15,23,42,.10);
}


/* ============================================================
   BOTÓN VER MAPA
   ============================================================ */

.btn-ver-mapa {
    background: #3b82f6;

    color: #fff;

    border: 0;

    padding: 6px 12px;

    border-radius: 8px;

    font-size: .75rem;
    font-weight: 700;

    cursor: pointer;

    display: flex;

    align-items: center;

    gap: 4px;
}


/* ============================================================
   ALERTAS CERCANAS
   ============================================================ */

.aj-nearby-card {
    padding: 14px;

    border: 1px solid var(--border-color);

    border-radius: 20px;

    background:
        linear-gradient(
            135deg,
            rgba(15,23,42,.96),
            rgba(30,41,59,.82)
        );

    box-shadow:
        0 14px 35px rgba(0,0,0,.14);
}

body.light-theme .aj-nearby-card {
    background:
        linear-gradient(
            135deg,
            #fff,
            #f8fafc
        );
}

.aj-nearby-head {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;
}

.aj-nearby-head h3 {
    font-size: .95rem;

    display: flex;

    align-items: center;

    gap: 7px;
}

.aj-nearby-head h3 .material-icons-round {
    color: #ef4444;

    font-size: 20px;
}

.aj-nearby-sub {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: .72rem;
}

.aj-nearby-count {
    padding: 5px 9px;

    border: 1px solid rgba(239,68,68,.22);
    border-radius: 999px;

    background: rgba(239,68,68,.1);

    color: #f87171;

    font-size: .72rem;
    font-weight: 900;
}

.aj-nearby-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}

.aj-nearby-empty {
    padding: 16px;

    border: 1px dashed var(--border-color);
    border-radius: 14px;

    color: var(--text-secondary);

    text-align: center;

    font-size: .78rem;
}

.aj-nearby-item {
    display: grid;

    grid-template-columns:
        40px 1fr auto;

    gap: 10px;

    align-items: center;

    padding: 10px;

    border: 1px solid var(--border-color);
    border-radius: 15px;

    background: rgba(255,255,255,.035);

    cursor: pointer;

    transition: .2s;
}

.aj-nearby-item:hover {
    transform: translateY(-1px);

    border-color: rgba(59,130,246,.35);
}

.aj-nearby-icon {
    width: 40px;
    height: 40px;

    border-radius: 13px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #fff;
}

.aj-nearby-icon.sos {
    background: #dc2626;
}

.aj-nearby-icon.danger {
    background: #ef4444;
}

.aj-nearby-icon.warning {
    background: #f59e0b;
}

.aj-nearby-icon.info {
    background: #0284c7;
}

.aj-nearby-icon.security {
    background: #7c3aed;
}

.aj-nearby-title {
    font-size: .82rem;
    font-weight: 850;

    line-height: 1.15;
}

.aj-nearby-meta {
    margin-top: 4px;

    color: var(--text-secondary);

    font-size: .68rem;
}

.aj-distance {
    color: #38bdf8;

    font-size: .68rem;
    font-weight: 900;

    white-space: nowrap;
}


/* ============================================================
   PINES Y CLUSTERS
   ============================================================ */

.aj-cluster-pin,
.aj-community-pin,
.aj-skyline-pin {
    background: transparent !important;

    border: 0 !important;
}

.aj-cluster-icon {
    position: relative;

    width: 44px;
    height: 44px;

    border: 3px solid #fff;
    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #fff;

    font-size: .78rem;
    font-weight: 950;

    box-shadow:
        0 8px 24px rgba(0,0,0,.35);
}

.aj-cluster-icon::after {
    content: "";

    position: absolute;

    inset: -7px;

    border: 2px solid currentColor;
    border-radius: 50%;

    opacity: .28;
}


/* ============================================================
   CERCA — REPORTE CIUDADANO MAPA V2
   ============================================================ */

.aj-map-bottom-sheet {

    position: absolute;

    z-index: 1600;

  left: 9px;
right: 9px;

/* CERCA — dejar libre el NAV inferior */
bottom:
    calc(
        100px +
        env(
            safe-area-inset-bottom,
            0px
        )
    );

display: none;

/* Si la nota es grande, hace scroll dentro */
max-height:
    min(
        55vh,
        500px
    );

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

overscroll-behavior: contain;
-webkit-overflow-scrolling: touch;

    padding:
    8px
    12px
    20px;

    border:
        1px solid
        rgba(34,211,238,.12);

    border-radius:
        22px;

    background:

        radial-gradient(
            circle at 100% 0%,
            rgba(34,211,238,.075),
            transparent 35%
        ),

        rgba(
            8,
            15,
            30,
            .97
        );

    color:
        #fff;

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    box-shadow:
        0 18px 50px
        rgba(0,0,0,.42);

    scrollbar-width:
        none;
}


.aj-map-bottom-sheet::-webkit-scrollbar {

    display: none;
}


.aj-map-bottom-sheet.show {

    display: block;

    animation:
        cercaMapSheetIn
        .24s
        ease-out;
}


@keyframes cercaMapSheetIn {

    from {

        transform:
            translateY(18px);

        opacity: 0;
    }

    to {

        transform:
            translateY(0);

        opacity: 1;
    }
}


/* ============================================================
   HANDLE
   ============================================================ */

.cerca-report-sheet-handle {

    width: 38px;
    height: 4px;

    margin:
        1px auto
        10px;

    border-radius:
        999px;

    background:
        rgba(148,163,184,.28);
}


/* ============================================================
   CABECERA
   ============================================================ */

.cerca-report-sheet-head {

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;
}


.cerca-report-sheet-source {

    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;
}


.cerca-report-sheet-source-icon {

    flex: none;

    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius:
        12px;

    background:
        rgba(34,211,238,.075);

    border:
        1px solid
        rgba(34,211,238,.12);

    color:
        #22d3ee;
}


.cerca-report-sheet-source-icon
.material-icons-round {

    font-size:
        20px;
}


.cerca-report-sheet-source small {

    display: block;

    margin-bottom:
        2px;

    color:
        #22d3ee;

    font-size:
        .54rem;

    font-weight:
        900;

    letter-spacing:
        .08em;
}


.cerca-report-sheet-source strong {

    display: block;

    color:
        #f8fafc;

    font-size:
        .79rem;

    font-weight:
        900;
}


/* ============================================================
   CERRAR
   ============================================================ */

.aj-map-sheet-close {

    flex: none;

    width: 34px;
    height: 34px;

    padding: 0;

    border:
        1px solid
        rgba(148,163,184,.10);

    border-radius:
        11px;

    background:
        rgba(255,255,255,.035);

    color:
        #94a3b8;

    cursor:
        pointer;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;
}


.aj-map-sheet-close
.material-icons-round {

    font-size:
        20px;
}


/* ============================================================
   RIESGO + COMUNIDAD
   ============================================================ */

.cerca-report-sheet-status {

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0,1fr)
        );

    gap: 7px;

    margin-top:
        11px;
}


.cerca-report-risk,
.cerca-report-confirmations {

    min-width: 0;

    min-height:
        54px;

    padding:
        8px
        9px;

    border-radius:
        13px;

    display: flex;

    align-items:
        center;

    gap: 7px;

    border:
        1px solid
        rgba(148,163,184,.10);

    background:
        rgba(255,255,255,.028);
}


.cerca-report-risk >
.material-icons-round,
.cerca-report-confirmations >
.material-icons-round {

    flex: none;

    font-size:
        20px;
}


.cerca-report-risk small,
.cerca-report-confirmations small {

    display: block;

    color:
        #64748b;

    font-size:
        .49rem;

    font-weight:
        900;

    letter-spacing:
        .08em;
}


.cerca-report-risk strong,
.cerca-report-confirmations strong {

    display: block;

    margin-top:
        2px;

    color:
        #e2e8f0;

    font-size:
        .66rem;

    line-height:
        1.15;
}


/* BAJO */

.cerca-report-risk[data-level="low"] {

    color:
        #38bdf8;
}


/* MEDIO */

.cerca-report-risk[data-level="medium"] {

    color:
        #fbbf24;

    border-color:
        rgba(245,158,11,.15);

    background:
        rgba(245,158,11,.045);
}


/* ALTO */

.cerca-report-risk[data-level="high"] {

    color:
        #fb7185;

    border-color:
        rgba(239,68,68,.17);

    background:
        rgba(239,68,68,.05);
}


/* CRÍTICO */

.cerca-report-risk[data-level="critical"] {

    color:
        #ef4444;

    border-color:
        rgba(220,38,38,.22);

    background:
        rgba(220,38,38,.07);
}


.cerca-report-confirmations {

    color:
        #22c55e;
}


/* ============================================================
   UBICACIÓN
   ============================================================ */

.cerca-report-location {

    display: flex;

    align-items:
        flex-start;

    gap: 8px;

    margin-top:
        10px;

    padding:
        10px;

    border-radius:
        14px;

    background:
        rgba(34,211,238,.035);

    border:
        1px solid
        rgba(34,211,238,.085);
}


.cerca-report-location >
.material-icons-round {

    flex: none;

    margin-top:
        2px;

    color:
        #22d3ee;

    font-size:
        19px;
}


.cerca-report-location div {

    min-width:
        0;
}


.cerca-report-location small {

    display: block;

    margin-bottom:
        3px;

    color:
        #64748b;

    font-size:
        .49rem;

    font-weight:
        900;

    letter-spacing:
        .07em;
}


.cerca-report-location strong {

    display:
        -webkit-box;

    overflow:
        hidden;

    color:
        #f8fafc;

    font-size:
        .73rem;

    font-weight:
        800;

    line-height:
        1.35;

    -webkit-line-clamp:
        3;

    -webkit-box-orient:
        vertical;
}


/* ============================================================
   DESCRIPCIÓN
   ============================================================ */

.cerca-report-description {

    margin-top:
        10px;

    padding:
        1px
        2px;
}


.cerca-report-description small {

    display: block;

    color:
        #64748b;

    font-size:
        .49rem;

    font-weight:
        900;

    letter-spacing:
        .07em;
}


.cerca-report-description p {

    margin:
        5px
        0
        0;

    color:
        #e2e8f0;

    font-size:
        .74rem;

    line-height:
        1.45;

    white-space:
        pre-line;
}


/* ============================================================
   FOTO
   ============================================================ */

.cerca-report-photo {

    overflow:
        hidden;

    margin-top:
        10px;

    border-radius:
        14px;

    border:
        1px solid
        rgba(148,163,184,.10);
}


.cerca-report-photo img {

    display:
        block;

    width:
        100%;

    max-height:
        210px;

    object-fit:
        cover;
}


/* ============================================================
   META
   ============================================================ */

.aj-map-sheet-meta {

    margin-top:
        10px;

    display: flex;

    align-items:
        center;

    flex-wrap:
        wrap;

    gap:
        6px
        10px;

    color:
        #64748b;

    font-size:
        .58rem;
}


.aj-map-sheet-meta span {

    display:
        inline-flex;

    align-items:
        center;

    gap:
        4px;
}


.aj-map-sheet-meta
.material-icons-round {

    color:
        #64748b;

    font-size:
        13px;
}


/* ============================================================
   ACCIONES
   ============================================================ */

.aj-map-sheet-actions {

    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0,1fr)
        );

    gap:
        7px;

    margin-top:
        11px;
}


.aj-map-sheet-actions button {

    min-width:
        0;

    min-height:
        43px;

    border-radius:
        12px;

    padding:
        8px
        9px;

    font-size:
        .65rem;

    font-weight:
        900;

    cursor:
        pointer;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    gap:
        5px;
}


.aj-map-sheet-actions button
.material-icons-round {

    font-size:
        17px;
}


.aj-sheet-primary {

    border:
        1px solid
        rgba(34,211,238,.17);

    background:
        rgba(34,211,238,.085);

    color:
        #67e8f9;
}


.aj-sheet-confirm {

    border:
        1px solid
        rgba(34,197,94,.18);

    background:
        rgba(34,197,94,.09);

    color:
        #4ade80;
}


/* ============================================================
   LIGHT
   ============================================================ */

body.light-theme
.aj-map-bottom-sheet {

    background:
        rgba(255,255,255,.98);

    color:
        #0f172a;

    border-color:
        rgba(15,23,42,.08);
}


body.light-theme
.cerca-report-sheet-source strong,
body.light-theme
.cerca-report-location strong {

    color:
        #0f172a;
}


body.light-theme
.cerca-report-description p {

    color:
        #334155;
}


/* ============================================================
   MÓVIL PEQUEÑO
   ============================================================ */

@media (max-width: 370px) {

    .cerca-report-sheet-status {

        gap:
            5px;
    }


    .cerca-report-risk,
    .cerca-report-confirmations {

        padding:
            7px;
    }


    .cerca-report-risk strong,
    .cerca-report-confirmations strong {

        font-size:
            .60rem;
    }

}


/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (
    prefers-reduced-motion:
    reduce
) {

    .aj-map-bottom-sheet.show {

        animation:
            none;
    }

}


/* ============================================================
   RUTA CERCA — PANEL DE NAVEGACIÓN
   ============================================================ */

.aj-route-panel {
    position: absolute;

    z-index: 8000;

    left: 10px;
    right: 10px;
    bottom: 10px;

    display: none;

    max-height: min(54%, 410px);

    overflow: hidden;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 22px;

    background: rgba(8,15,28,.98);

    color: #fff;

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow:
        0 18px 48px rgba(0,0,0,.42);
}

.aj-route-panel.show {
    display: flex;

    flex-direction: column;
}

body.light-theme .aj-route-panel {
    background: rgba(255,255,255,.98);

    color: #0f172a;

    border-color: rgba(15,23,42,.12);
}

.aj-route-head {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 10px;

    padding: 13px 14px 10px;

    border-bottom: 1px solid rgba(148,163,184,.16);
}

.aj-route-head h3 {
    margin: 0;

    display: flex;

    align-items: center;

    gap: 6px;

    font-size: .92rem;
}

.aj-route-head p {
    margin-top: 3px;

    color: var(--text-secondary);

    font-size: .66rem;
}

.aj-route-close {
    padding: 4px;

    border: 0;

    background: transparent;

    color: inherit;

    display: flex;

    cursor: pointer;
}

.aj-route-summary {
    display: grid;

    grid-template-columns:
        repeat(3,1fr);

    gap: 6px;

    padding: 10px 12px;
}

.aj-route-summary > div {
    min-width: 0;

    padding: 8px;

    border: 1px solid rgba(148,163,184,.16);
    border-radius: 12px;
}

.aj-route-summary strong {
    display: block;

    font-size: .86rem;
}

.aj-route-summary span {
    display: block;

    margin-top: 2px;

    color: var(--text-secondary);

    font-size: .57rem;
}

.aj-route-steps {
    overflow-y: auto;

    padding: 0 12px 12px;

    display: flex;

    flex-direction: column;

    gap: 7px;

    -webkit-overflow-scrolling: touch;
}

.aj-route-step {
    display: grid;

    grid-template-columns:
        30px minmax(0,1fr) auto;

    gap: 8px;

    align-items: center;

    padding: 8px;

    border: 1px solid rgba(148,163,184,.14);
    border-radius: 12px;

    background: rgba(255,255,255,.03);
}

body.light-theme .aj-route-step {
    background: rgba(15,23,42,.025);
}

.aj-route-step .material-icons-round {
    color: #38bdf8;

    font-size: 19px;
}

.aj-route-step strong {
    display: block;

    font-size: .72rem;

    overflow-wrap: anywhere;
}

.aj-route-step small {
    color: var(--text-secondary);

    font-size: .61rem;
}

.aj-route-step-distance {
    color: #38bdf8;

    font-size: .61rem;
    font-weight: 800;

    white-space: nowrap;
}

.aj-route-loading {
    padding: 20px;

    text-align: center;

    color: var(--text-secondary);

    font-size: .75rem;
}

.aj-route-line-pulse {
    animation:
        ajRoutePulse 1.5s ease-in-out infinite alternate;
}

@keyframes ajRoutePulse {
    from { opacity: .62; }
    to   { opacity: 1; }
}


/* ============================================================
   MODOS DE TRANSPORTE DE RUTA
   ============================================================ */

.aj-route-modes {
    display: grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap: 6px;
}

.aj-route-mode {
    min-height: 40px;

    padding: 7px 6px;

    border: 1px solid rgba(148,163,184,.18);
    border-radius: 11px;

    background: rgba(255,255,255,.035);

    color: inherit;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 5px;

    font-size: .65rem;
    font-weight: 800;

    cursor: pointer;
}

.aj-route-mode.active {
    border-color: #38bdf8;

    background: rgba(56,189,248,.13);

    color: #7dd3fc;
}

body.light-theme .aj-route-mode {
    background: rgba(15,23,42,.03);
}


/* ============================================================
   DESTINO / RUTA CERCA
   ============================================================ */

#view-mapa .aj-destination-sheet {
    z-index: 8000;
}

.aj-route-origin {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-bottom: 9px;

    padding: 9px 11px;

    border: 1px solid rgba(74,222,128,.18);
    border-radius: 12px;

    background: rgba(74,222,128,.08);

    font-size: .69rem;
}

.aj-route-origin .material-icons-round {
    color: #4ade80;

    font-size: 18px;
}

.aj-pick-map-btn {
    width: 100%;

    min-height: 42px;

    margin-top: 9px;

    border: 1px dashed rgba(96,165,250,.45);
    border-radius: 12px;

    background: rgba(59,130,246,.07);

    color: #93c5fd;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    font-size: .69rem;
    font-weight: 800;

    cursor: pointer;
}

.aj-calc-safe-route {
    width: 100%;

    min-height: 48px;

    margin-top: 11px;

    border: 0;
    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            #16a34a,
            #15803d
        );

    color: #fff;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    font-size: .76rem;
    font-weight: 900;

    cursor: pointer;

    box-shadow:
        0 10px 25px rgba(22,163,74,.20);
}

.aj-calc-safe-route:disabled {
    opacity: .45;

    cursor: not-allowed;
}

.aj-map-pick-banner {
    position: absolute;

    z-index: 8500;

    top: 10px;
    left: 50%;

    transform: translateX(-50%);

    width: min(92%,420px);

    display: none;

    padding: 9px 12px;

    border: 1px solid rgba(96,165,250,.35);
    border-radius: 14px;

    background: rgba(15,23,42,.96);

    color: #fff;

    text-align: center;

    font-size: .68rem;
    font-weight: 750;

    box-shadow:
        0 10px 30px rgba(0,0,0,.35);
}

.aj-map-pick-banner.show {
    display: block;
}

.aj-destination-pin {
    filter:
        drop-shadow(0 4px 6px rgba(0,0,0,.35));
}


/* ============================================================
   MAPA ESPECIAL / TRACKING
   ============================================================ */

#ajTrackingMap {
    flex: 1;

    min-height: 240px;

    background: #0b1329;
}

.cerca-special-map {
    position: relative;

    z-index: 1;

    flex: 1 1 auto;

    min-height: 0;

    background: #0b1329;
}


/* ============================================================
   COMPARADOR DE RUTAS
   ============================================================ */

.aj-v9-route-compare {
    display: grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap: 6px;

    margin: 0 12px 9px;
}

.aj-v9-route-option {
    min-width: 0;

    padding: 8px;

    border: 1px solid rgba(148,163,184,.15);
    border-radius: 12px;

    background: rgba(255,255,255,.03);
}

.aj-v9-route-option.best {
    border-color: rgba(34,197,94,.38);

    background: rgba(34,197,94,.08);
}

.aj-v9-route-option strong {
    display: block;

    font-size: .73rem;
}

.aj-v9-route-option span {
    display: block;

    margin-top: 2px;

    color: var(--text-secondary);

    font-size: .55rem;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aj-v9-route-option b {
    display: block;

    margin-top: 5px;

    color: #4ade80;

    font-size: .68rem;
}


/* ============================================================
   RUTA CERCA — BUSCADOR
   ============================================================ */

.cerca-route-search12 {
    position: relative;

    z-index: 30;

    flex: 0 0 auto;

    padding: 8px 10px;

    background: var(--bg-main);

    border-bottom: 1px solid var(--border-color);
}

.cerca-route-origin12 {
    display: flex;

    align-items: center;

    gap: 8px;

    margin: 0 3px 7px;

    color: var(--text-secondary);
}

.cerca-route-origin12 > .material-icons-round {
    color: #4ade80;

    font-size: 17px;
}

.cerca-route-origin12 small {
    display: block;

    font-size: .53rem;
    font-weight: 900;
}

.cerca-route-origin12 strong {
    display: block;

    margin-top: 1px;

    color: var(--text-primary);

    font-size: .68rem;
}

.cerca-route-input12 {
    min-height: 44px;

    padding: 0 5px 0 8px;

    border: 1px solid var(--border-color);
    border-radius: 14px;

    background: var(--bg-card);

    display: grid;

    grid-template-columns:
        30px minmax(0,1fr) 38px;

    align-items: center;
}

.cerca-route-input12 > .material-icons-round {
    color: #fb7185;

    font-size: 19px;
}

.cerca-route-input12 input {
    width: 100%;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--text-primary);

    font: inherit;

    font-size: .74rem;
}

.cerca-route-input12 button {
    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 10px;

    background: rgba(56,189,248,.12);

    color: #38bdf8;

    display: flex;

    align-items: center;
    justify-content: center;
}

.cerca-route-results12 {
    position: absolute;

    left: 10px;
    right: 10px;
    top: 96px;

    display: none;

    max-height: 210px;

    overflow-y: auto;

    border: 1px solid var(--border-color);
    border-radius: 14px;

    background: var(--bg-card);

    box-shadow:
        0 15px 35px rgba(0,0,0,.28);
}

.cerca-route-results12.show {
    display: block;
}

.cerca-route-result12 {
    width: 100%;

    padding: 9px 10px;

    border: 0;
    border-bottom: 1px solid var(--border-color);

    background: transparent;

    color: inherit;

    display: grid;

    grid-template-columns:
        28px minmax(0,1fr);

    gap: 7px;

    text-align: left;
}

.cerca-route-result12:last-child {
    border-bottom: 0;
}

.cerca-route-result12 .material-icons-round {
    color: #38bdf8;

    font-size: 19px;
}

.cerca-route-result12 strong {
    display: block;

    font-size: .68rem;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cerca-route-result12 small {
    display: block;

    margin-top: 2px;

    color: var(--text-secondary);

    font-size: .55rem;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ============================================================
   AYUDA CERCA
   ============================================================ */

.cerca-help-route-status131 {
    display: none;

    margin-top: 8px;

    padding: 8px 9px;

    border: 1px solid rgba(56,189,248,.18);
    border-radius: 11px;

    background: rgba(56,189,248,.06);
}

.cerca-help-route-status131.show {
    display: block;
}

.cerca-help-route-status131 strong {
    display: block;

    color: var(--text-primary);

    font-size: .62rem;
}

.cerca-help-route-status131 span {
    display: block;

    margin-top: 2px;

    color: var(--text-secondary);

    font-size: .51rem;

    line-height: 1.3;
}


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

@media (max-width: 700px) {

    .cerca-map-clean-controls {
        top: 12px;
        left: 12px;
    }

    .cerca-map-filter-main {
        min-height: 44px;

        padding: 0 14px;

        font-size: .78rem;
    }

    .aj-map-toolbar {
        top: 108px;
        right: 12px;

        gap: 9px;
    }

    .aj-map-tool {
        width: 48px;
        height: 48px;
    }

    .cerca-map-filter-panel {
        max-height: 83vh;

        padding-left: 14px;
        padding-right: 14px;
    }

    .cerca-map-filter-grid,
    .cerca-map-filter-row,
    .cerca-map-legend-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

    .cerca-map-filter-option {
        min-height: 59px;
    }

}


/* ============================================================
   PANTALLAS MUY PEQUEÑAS
   ============================================================ */

@media (max-width: 380px) {

    .cerca-map-filter-panel {
        padding-left: 11px;
        padding-right: 11px;
    }

    .cerca-map-filter-grid,
    .cerca-map-filter-row {
        gap: 6px;
    }

    .cerca-map-filter-option {
        min-height: 57px;

        padding: 8px;

        gap: 6px;
    }

    .cerca-map-filter-option b {
        font-size: .69rem;
    }

    .cerca-map-filter-option small {
        font-size: .54rem;
    }

}


/* ============================================================
   SAFE AREA DE MÓVILES
   ============================================================ */

@supports (
    padding-bottom: env(safe-area-inset-bottom)
) {

    .cerca-map-filter-panel {
        padding-bottom:
            calc(
                20px +
                env(safe-area-inset-bottom)
            );
    }

}
/* ==========================================================
   CERCA — ZONAS ACTIVAS / ONDAS SKYLINE
   ========================================================== */


/* ==========================================================
   ZONA CENTRAL
   ========================================================== */

.leaflet-overlay-pane svg path.cerca-zone-core {

    filter:
        drop-shadow(
            0 0 8px
            rgba(255,255,255,.10)
        );

    animation:
        cercaZoneCorePulse
        3s
        ease-in-out
        infinite;
}


/* ==========================================================
   PRIMERA ONDA
   ========================================================== */

.leaflet-overlay-pane svg path.cerca-zone-wave-1 {

    animation:
        cercaZoneWave1
        3s
        ease-in-out
        infinite;
}


/* ==========================================================
   SEGUNDA ONDA
   ========================================================== */

.leaflet-overlay-pane svg path.cerca-zone-wave-2 {

    animation:
        cercaZoneWave2
        3s
        ease-in-out
        infinite;
}


/* ==========================================================
   PULSO DEL CENTRO
   ========================================================== */

@keyframes cercaZoneCorePulse {

    0%,
    100% {
        opacity: .62;
    }

    50% {
        opacity: .95;
    }
}


/* ==========================================================
   ONDA INTERMEDIA
   ========================================================== */

@keyframes cercaZoneWave1 {

    0% {
        opacity: .15;
        stroke-dashoffset: 0;
    }

    50% {
        opacity: .42;
    }

    100% {
        opacity: .15;
        stroke-dashoffset: -32;
    }
}


/* ==========================================================
   ONDA EXTERIOR
   ========================================================== */

@keyframes cercaZoneWave2 {

    0% {
        opacity: .05;
        stroke-dashoffset: 0;
    }

    50% {
        opacity: .25;
    }

    100% {
        opacity: .05;
        stroke-dashoffset: -44;
    }
}


/* ==========================================================
   ACCESIBILIDAD
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .leaflet-overlay-pane svg path.cerca-zone-core,
    .leaflet-overlay-pane svg path.cerca-zone-wave-1,
    .leaflet-overlay-pane svg path.cerca-zone-wave-2 {

        animation:
            none !important;
    }
}