/*
 * =========================================================
 * Leyenda moderna - Precipitación
 * =========================================================
 */

.visor-pluvio #map
.saih-legend-control {
    margin-bottom: 18px !important;
    margin-left: 28px !important;

    font-family: 'Open Sans', Arial, sans-serif;
    z-index: 1020;
}


.visor-pluvio #map
.saih-legend-panel {
    width: 310px;
    max-width: calc(100vw - 92px);

    overflow: hidden;

    background: rgba(255, 255, 255, 0.75);

    border: 1px solid #dce6ea;
    border-radius: 12px;

    box-shadow:
        0 4px 14px
        rgba(34, 67, 80, 0.15);

    backdrop-filter: blur(4px);

    color: #354f5b;
}


.visor-pluvio #map
.saih-legend-header,
.visor-pluvio #map
.saih-legend-section-header {
    width: 100%;
    padding: 0;

    background: transparent;

    border: 0;

    font-family: inherit;
    text-align: left;

    cursor: pointer;
}


.visor-pluvio #map
.saih-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 9px 10px 8px 12px;
}


.visor-pluvio #map
.saih-legend-header:hover,
.visor-pluvio #map
.saih-legend-header:focus {
    background: #f8fafb;
    outline: none;
}


.visor-pluvio #map
.saih-legend-kicker {
    display: block;

    margin-bottom: 1px;

    color: #7d929c;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


.visor-pluvio #map
.saih-legend-title {
    display: block;

    color: #294f60;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}


.visor-pluvio #map
.saih-legend-main-chevron,
.visor-pluvio #map
.saih-legend-section-chevron {
    color: #80949d;

    font-size: 11px;

    transition: transform 0.15s ease;
}


.visor-pluvio #map
.saih-legend-panel.is-collapsed
.saih-legend-main-chevron {
    transform: rotate(-90deg);
}


.visor-pluvio #map
.saih-legend-panel.is-collapsed
.saih-legend-body {
    display: none;
}


.visor-pluvio #map
.saih-legend-body {
    border-top: 1px solid #e3ebee;
}


.visor-pluvio #map
.saih-legend-section +
.saih-legend-section {
    border-top: 1px solid #edf2f4;
}


.visor-pluvio #map
.saih-legend-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    padding: 7px 10px 7px 12px;

    color: #526f7b;

    font-size: 10.5px;
    font-weight: 700;
}


.visor-pluvio #map
.saih-legend-section-header:hover,
.visor-pluvio #map
.saih-legend-section-header:focus {
    background: #f8fafb;
    outline: none;
}


.visor-pluvio #map
.saih-legend-section.is-open
.saih-legend-section-chevron {
    transform: rotate(0deg);
}


.visor-pluvio #map
.saih-legend-section:not(.is-open)
.saih-legend-section-chevron {
    transform: rotate(-90deg);
}


.visor-pluvio #map
.saih-legend-section-body {
    display: none;

    padding: 0 10px 9px 12px;
}


.visor-pluvio #map
.saih-legend-section.is-open
.saih-legend-section-body {
    display: block;
}


.visor-pluvio #map
.saih-legend-grid {
    display: grid;
    gap: 5px 8px;
}


.visor-pluvio #map
.saih-legend-grid--observed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


.visor-pluvio #map
.saih-legend-list {
    display: grid;
    gap: 5px;
}


.visor-pluvio #map
.saih-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;

    min-width: 0;

    padding: 3px 4px;

    border-radius: 6px;
}


.visor-pluvio #map
.saih-legend-item img {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;

    object-fit: contain;
}


.visor-pluvio #map
.saih-legend-item-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
}


.visor-pluvio #map
.saih-legend-item-text strong {
    color: #456875;

    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.15;
}


.visor-pluvio #map
.saih-legend-item-text small {
    margin-top: 1px;

    color: #83979f;

    font-size: 10.5px;
    line-height: 1.15;
}


.visor-pluvio #map
.saih-legend-dot {
    flex: 0 0 auto;

    width: 10px;
    height: 10px;

    border: 2px solid #fff;
    border-radius: 50%;

    box-shadow:
        0 0 0 1px
        rgba(69, 104, 117, 0.16);
}


.visor-pluvio #map
.saih-legend-dot--n1 {
    background: #FFD700;
}

.visor-pluvio #map
.saih-legend-dot--n2 {
    background: #FF9900;
}

.visor-pluvio #map
.saih-legend-dot--n3 {
    background: #FF0000;
}


.visor-pluvio #map
.saih-legend-raster-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px 8px;
}


.visor-pluvio #map
.saih-legend-raster-grid span {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: #607d89;

    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}


.visor-pluvio #map
.saih-legend-raster-grid i {
    display: inline-block;

    width: 17px;
    height: 9px;

    background: var(--legend-color);

    border: 1px solid rgba(69, 104, 117, 0.20);
    border-radius: 3px;
}


@media (max-width: 1100px) {

    .visor-pluvio #map
    .saih-legend-control {
        margin-left: 18px !important;
    }
}


@media (max-width: 768px) {

    .visor-pluvio #map
    .saih-legend-control {
        margin-left: 10px !important;
        margin-bottom: 12px !important;
    }


    .visor-pluvio #map
    .saih-legend-panel {
        width: min(300px, calc(100vw - 82px));
        max-width: none;
    }


    .visor-pluvio #map
    .saih-legend-grid--observed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }


     /*
     * El desplegable de tipos debe quedar
     * por encima del cajetín Resumen.
     */
    #map #buttons.top-actions-wrap {
        z-index: 1040 !important;
    }

    #map #buttons.top-actions-wrap.is-open {
        z-index: 1045 !important;
    }
}

/*
 * =========================================================
 * Popup SAIH
 * =========================================================
 */

.saih-popup {
    width: 260px;

    color: #354f5b;

    font-family: inherit;
}


/*
 * Cabecera
 */
.saih-popup__header {
    padding: 1px 1px 8px;

    border-bottom: 1px solid #dce6ea;
}

.saih-popup__title {
    color: #294f60;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.saih-popup__type {
    margin-top: 2px;

    color: #7d929c;

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.04em;

    text-transform: uppercase;
}


/*
 * Métricas
 */
.saih-popup__metrics {
    display: flex;

    gap: 7px;

    margin: 10px 0;
}

.saih-popup__metric {
    flex: 1;

    min-width: 0;

    padding: 8px 9px;

    background: #f3f7f8;

    border: 1px solid #e2eaed;
    border-radius: 10px;
}

.saih-popup__metric-label {
    margin-bottom: 3px;

    color: #7a909a;

    font-size: 10px;
    font-weight: 600;
}

.saih-popup__metric-value {
    color: #294f60;

    font-size: 15px;
    font-weight: 700;

    white-space: nowrap;
}


/*
 * Acciones
 */
.saih-popup__actions {
    display: flex;

    flex-wrap: wrap;

    gap: 5px;

    padding-top: 8px;

    border-top: 1px solid #dce6ea;
}

.saih-popup__action,
.saih-popup__action:link,
.saih-popup__action:visited {
    display: inline-block;

    padding: 5px 8px;

    background: #eef3f5;

    border: 1px solid #d5e0e4;
    border-radius: 7px;

    color: #456875 !important;

    font-size: 10px;
    font-weight: 600;

    line-height: 1.2;

    text-decoration: none !important;
}

.saih-popup__action:hover,
.saih-popup__action:focus {
    background: #e3ecef;

    color: #294f60 !important;

    text-decoration: none !important;
}


/*
 * Acción principal: ficha
 */
.saih-popup__action--primary,
.saih-popup__action--primary:link,
.saih-popup__action--primary:visited {
    background: #39758c;

    border-color: #39758c;

    color: #fff !important;
}

.saih-popup__action--primary:hover,
.saih-popup__action--primary:focus {
    background: #2f6478;

    border-color: #2f6478;

    color: #fff !important;
}


/*
 * Contenedor exterior de Leaflet
 */
.saih-popup-shell
.leaflet-popup-content-wrapper {
    border-radius: 14px;

    box-shadow:
        0 5px 18px
        rgba(34, 67, 80, 0.16);
}

.saih-popup-shell
.leaflet-popup-content {
    margin: 13px 15px;
}


/*
 * =========================================================
 * Estados de precipitación
 * Solo cambia el color del valor de última hora
 * =========================================================
 */

/* Nivel 1 */
.saih-popup__metric--alert-1
.saih-popup__metric-value {
    color: #d2c028;
}


/* Nivel 2 */
.saih-popup__metric--alert-2
.saih-popup__metric-value {
    color: #FAA558;
}


/* Nivel 3 */
.saih-popup__metric--alert-3
.saih-popup__metric-value {
    color: #b32632;
}


/*
 * =========================================================
 * Contenedor Leaflet neutro para valores sobre mapa
 * =========================================================
 */

.leaflet-marker-icon.saih-value-icon {
    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;
}


/*
 * =========================================================
 * Valor fijo al hacer zoom
 * =========================================================
 */

.saih-map-value {
    display: inline-flex;

    align-items: center;

    padding: 4px 6px;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid #d9e4e8;
    border-radius: 7px;

    color: #456875;

    box-shadow:
        0 2px 7px
        rgba(34, 67, 80, 0.13);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.2;

    white-space: nowrap;
}


.saih-map-value a,
.saih-map-value a:link,
.saih-map-value a:visited {
    color: #456875 !important;

    text-decoration: none !important;
}


.saih-map-value:hover {
    background: #fff;

    border-color: #bfd1d7;
}


.saih-map-value:hover a {
    color: #294f60 !important;
}


/*
 * =========================================================
 * Cajetín de ratón
 * =========================================================
 */

.leaflet-tooltip.saih-hover-tooltip {
    padding: 5px 7px;

    background: rgba(255, 255, 255, 0.97);

    border: 1px solid #d9e4e8;
    border-radius: 7px;

    color: #354f5b;

    box-shadow:
        0 2px 7px
        rgba(34, 67, 80, 0.13);

    font-size: 12px;
    line-height: 1.2;

    white-space: nowrap;
}


.saih-hover-label__title {
    margin-bottom: 3px;

    color: #294f60;

    font-size: 11.5px;
    font-weight: 700;
}


.saih-hover-label__data {
    display: flex;

    align-items: center;

    gap: 5px;

    color: #607d89;
}


.saih-hover-label__value {
    color: #456875;

    font-weight: 700;
}

/*
 * =========================================================
 * Popup previsión HARMONIE
 * =========================================================
 */

.saih-popup__forecast-run {
    margin-top: 3px;

    color: #8a9ba3;

    font-size: 10px;
    font-weight: 500;
}


.saih-popup__metrics--forecast {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 7px;
}


.saih-popup__forecast-period {
    display: flex;
    flex-direction: column;

    gap: 2px;

    margin: 2px 0 9px;

    padding: 7px 9px;

    background: #f8fafb;

    border: 1px solid #e5ecef;
    border-radius: 8px;
}


.saih-popup__forecast-period span {
    color: #7a909a;

    font-size: 10.5px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.03em;
}


.saih-popup__forecast-period strong {
    color: #456875;

    font-size: 10.5px;
    font-weight: 600;

    line-height: 1.35;
}





/*
 * =========================================================
 * Panel moderno de avisos - Precipitación
 * =========================================================
 */

.visor-pluvio #map
.leaflet-top.leaflet-left {
    top: 10px !important;
    left: 18px !important;
    right: auto !important;
    width: auto;

    /*
     * Temporalmente mantenemos los avisos
     * por encima de las leyendas.
     */
    z-index: 1030 !important;
}


.visor-pluvio #map
.saih-lluvia-alert-control {
    position: relative;
    z-index: 1031;
    left: 10px;

    margin: 0 !important;
    font-family: 'Open Sans', Arial, sans-serif;
}


.visor-pluvio #map
.saih-lluvia-alert-panel {
    width: 330px;
    max-width: calc(100vw - 92px);
    overflow: hidden;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid #dce6ea;
    border-radius: 12px;

    box-shadow:
        0 5px 18px
        rgba(34, 67, 80, 0.16);

    backdrop-filter: blur(4px);

    color: #354f5b;
}


.visor-pluvio #map
.saih-lluvia-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding: 10px 10px 9px 12px;

    border-bottom: 1px solid #e3ebee;
}


.visor-pluvio #map
.saih-lluvia-alert-kicker {
    display: flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 2px;

    color: #7d929c;

    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


.visor-pluvio #map
.saih-lluvia-alert-title {
    color: #294f60;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}


.visor-pluvio #map
.saih-lluvia-alert-header-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}


.visor-pluvio #map
.saih-lluvia-alert-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 25px;
    height: 25px;
    padding: 0 7px;

    background: #edf3f5;

    border: 1px solid #dce6ea;
    border-radius: 999px;

    color: #456875;

    font-size: 11px;
    font-weight: 700;
}


.visor-pluvio #map
.saih-lluvia-alert-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 25px;
    height: 25px;
    padding: 0;

    background: #f7fafb;

    border: 1px solid #dce6ea;
    border-radius: 7px;

    color: #607d89;

    font-size: 15px;
    line-height: 1;

    cursor: pointer;
}


.visor-pluvio #map
.saih-lluvia-alert-header-btn:hover,
.visor-pluvio #map
.saih-lluvia-alert-header-btn:focus {
    background: #edf3f5;
    color: #294f60;
    outline: none;
}


.visor-pluvio #map
.saih-lluvia-alert-body {
    max-height: 500px;
    overflow-y: auto;
    overscroll-behavior: contain;
}


.visor-pluvio #map
.saih-lluvia-alert-panel.is-minimized
.saih-lluvia-alert-body {
    display: none;
}


.visor-pluvio #map
.saih-lluvia-alert-panel.is-minimized
.saih-lluvia-alert-header {
    border-bottom: 0;
}


.visor-pluvio #map
.saih-lluvia-alert-section +
.saih-lluvia-alert-section {
    border-top: 1px solid #e3ebee;
}


.visor-pluvio #map
.saih-lluvia-alert-section-title {
    padding: 7px 10px 5px 12px;

    background: #f8fafb;

    color: #78909a;

    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}


.visor-pluvio #map
.saih-lluvia-alert-group {
    --alert-accent: #78909c;
    --alert-soft: #f5f8f9;

    border-top: 1px solid #edf2f4;
}


.visor-pluvio #map
.saih-lluvia-alert-section-title +
.saih-lluvia-alert-group {
    border-top: 0;
}


.visor-pluvio #map
.saih-lluvia-alert-group--nivel3 {
    --alert-accent: #b32632;
    --alert-soft: #fff4f5;
}


.visor-pluvio #map
.saih-lluvia-alert-group--nivel2 {
    --alert-accent: #bd5f00;
    --alert-soft: #fff7ed;
}


.visor-pluvio #map
.saih-lluvia-alert-group--nivel1 {
    --alert-accent: #8d7900;
    --alert-soft: #fffbed;
}


.visor-pluvio #map
.saih-lluvia-alert-group--info {
    --alert-accent: #376f91;
    --alert-soft: #f1f7fb;
}


.visor-pluvio #map
.saih-lluvia-alert-group-header {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto 16px;
    align-items: center;
    gap: 8px;

    width: 100%;
    padding: 8px 10px;

    background: transparent;

    border: 0;

    color: #456875;

    text-align: left;

    cursor: pointer;
}


.visor-pluvio #map
.saih-lluvia-alert-group-header:hover,
.visor-pluvio #map
.saih-lluvia-alert-group-header:focus {
    background: var(--alert-soft);
    outline: none;
}


.visor-pluvio #map
.saih-lluvia-alert-group-header--static {
    cursor: default;
}


.visor-pluvio #map
.saih-lluvia-alert-group-header--static:hover {
    background: transparent;
}


.visor-pluvio #map
.saih-lluvia-alert-group-marker {
    align-self: stretch;

    width: 4px;
    min-height: 22px;

    background: var(--alert-accent);

    border-radius: 999px;
}


.visor-pluvio #map
.saih-lluvia-alert-group-label {
    min-width: 0;

    color: #3f606d;

    font-size: 11px;
    font-weight: 700;
}


.visor-pluvio #map
.saih-lluvia-alert-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 22px;
    height: 20px;
    padding: 0 6px;

    background: var(--alert-soft);

    border: 1px solid rgba(69, 104, 117, 0.18);
    border-radius: 999px;

    color: var(--alert-accent);

    font-size: 10px;
    font-weight: 700;
}


.visor-pluvio #map
.saih-lluvia-alert-chevron {
    color: #80949d;

    font-size: 11px;
    text-align: center;

    transition: transform 0.15s ease;
}


.visor-pluvio #map
.saih-lluvia-alert-group.is-collapsed
.saih-lluvia-alert-chevron {
    transform: rotate(-90deg);
}


.visor-pluvio #map
.saih-lluvia-alert-group-body {
    padding: 0 9px 8px 18px;
}


.visor-pluvio #map
.saih-lluvia-alert-group.is-collapsed
.saih-lluvia-alert-group-body {
    display: none;
}


.visor-pluvio #map
.saih-lluvia-alert-item {
    display: block;

    width: 100%;
    padding: 6px 7px;

    background: transparent;

    border: 0;
    border-radius: 7px;

    color: #4d6873;

    text-align: left;

    cursor: pointer;
}


.visor-pluvio #map
.saih-lluvia-alert-item +
.saih-lluvia-alert-item {
    margin-top: 1px;
}


.visor-pluvio #map
.saih-lluvia-alert-item:hover,
.visor-pluvio #map
.saih-lluvia-alert-item:focus {
    background: var(--alert-soft);
    outline: none;
}


.visor-pluvio #map
.saih-lluvia-alert-item.is-static {
    cursor: default;
}


.visor-pluvio #map
.saih-lluvia-alert-item-title {
    color: #3f606d;

    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.25;
}


.visor-pluvio #map
.saih-lluvia-alert-item-detail {
    margin-top: 1px;

    color: #83979f;

    font-size: 10.5px;
    line-height: 1.25;
}


.visor-pluvio #map
.saih-lluvia-alert-item.is-extra {
    display: none;
}


.visor-pluvio #map
.saih-lluvia-alert-group.is-show-all
.saih-lluvia-alert-item.is-extra {
    display: block;
}


.visor-pluvio #map
.saih-lluvia-alert-more {
    display: inline-flex;

    margin-top: 4px;
    padding: 4px 7px;

    background: transparent;

    border: 0;
    border-radius: 6px;

    color: var(--alert-accent);

    font-size: 10.5px;
    font-weight: 700;

    cursor: pointer;
}


.visor-pluvio #map
.saih-lluvia-alert-more:hover,
.visor-pluvio #map
.saih-lluvia-alert-more:focus {
    background: var(--alert-soft);
    outline: none;
}


.visor-pluvio #map
.saih-lluvia-alert-empty {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    padding: 12px;

    color: #607d70;
}


.visor-pluvio #map
.saih-lluvia-alert-empty-dot {
    flex: 0 0 auto;

    width: 9px;
    height: 9px;
    margin-top: 3px;

    background: #5f9677;

    border-radius: 50%;
}


.visor-pluvio #map
.saih-lluvia-alert-empty strong {
    display: block;

    color: #4b7461;

    font-size: 11px;
}


.visor-pluvio #map
.saih-lluvia-alert-empty span {
    display: block;

    margin-top: 2px;

    color: #83958c;

    font-size: 10.5px;
}


.visor-pluvio #map
.saih-lluvia-alert-restore {
    display: none;
    align-items: center;
    gap: 7px;

    min-height: 34px;
    padding: 0 10px;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid #dce6ea;
    border-radius: 10px;

    box-shadow:
        0 3px 10px
        rgba(34, 67, 80, 0.14);

    color: #456875;

    font-size: 10.5px;
    font-weight: 700;

    cursor: pointer;
}


.visor-pluvio #map
.saih-lluvia-alert-control.is-closed
.saih-lluvia-alert-panel {
    display: none;
}


.visor-pluvio #map
.saih-lluvia-alert-control.is-closed
.saih-lluvia-alert-restore {
    display: inline-flex;
}


.visor-pluvio #map
.saih-lluvia-alert-restore-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 21px;
    height: 21px;
    padding: 0 6px;

    background: #edf3f5;

    border-radius: 999px;

    color: #456875;

    font-size: 10.5px;
}


@media (max-width: 768px) {

    .visor-pluvio #map
    .leaflet-top.leaflet-left {
        top: 58px !important;
        left: 10px !important;
    }


    .visor-pluvio #map
    .saih-lluvia-alert-panel {
        width: min(310px, calc(100vw - 82px));
        max-width: none;
    }


    .visor-pluvio #map
    .saih-lluvia-alert-body {
        max-height: 400px;
    }
}

.leaflet-tile {
    image-rendering: auto;
}

/* =========================================================
   VISOR PLUVIÓMETROS - CONTROLES LEAFLET MODERNOS
   ========================================================= */

/* Contenedores estándar de Leaflet */
.visor-pluvio #map .leaflet-bar {
    border: none;
    border-radius: 6px;
    background-color: transparent;
    box-shadow: 0 2px 6px rgba(25, 55, 75, 0.14);
}

/* Botones estándar y personalizados */
.visor-pluvio #map .leaflet-bar a,
.visor-pluvio #map .leaflet-bar button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px !important;
    height: 34px !important;

    min-width: 34px;
    min-height: 34px;

    padding: 0;
    margin: 0;

    background-color: #ffffff;
    color: #29485b;

    border: 1px solid #dce6ec;
    border-radius: 5px;

    font-size: 17px;
    line-height: 1;

    box-sizing: border-box;
    cursor: pointer;
}

/* Hover */
.visor-pluvio #map .leaflet-bar a:hover,
.visor-pluvio #map .leaflet-bar button:hover {
    background-color: #eef4f7;
    color: #17658f;
    border-color: #b9cfdd;
}

/* Foco accesible */
.visor-pluvio #map .leaflet-bar a:focus-visible,
.visor-pluvio #map .leaflet-bar button:focus-visible {
    outline: 2px solid #2477a5;
    outline-offset: 2px;
}

/* Zoom */
.visor-pluvio #map .leaflet-control-zoom {
    display: flex;
    flex-direction: column;
    gap: 3px;

    background-color: transparent;
    box-shadow: none;
}

.visor-pluvio #map .leaflet-control-zoom a {
    font-size: 19px;
    font-weight: 600;
}

/* EasyButton */
.visor-pluvio #map .leaflet-control-easyButton {
    border: none;
    background-color: transparent;
    box-shadow: none;
}

.visor-pluvio #map .leaflet-control-easyButton .easy-button-button {
    width: 34px;
    height: 34px;
    border-radius: 5px;
}

/* Iconos interiores */
.visor-pluvio #map .leaflet-control-easyButton i,
.visor-pluvio #map .leaflet-bar button i {
    font-size: 16px;
    line-height: 1;
}

/* Control de capas cerrado */
.visor-pluvio #map
.leaflet-control-layers:not(.leaflet-control-layers-expanded) {
    border: 1px solid #dce6ec;
    border-radius: 6px;
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(25, 55, 75, 0.14);
}

/* Icono del selector de capas */
.visor-pluvio #map .leaflet-control-layers-toggle {
    width: 34px;
    height: 34px;
    background-size: 22px 22px;
    background-position: center;
}

/* =========================================================
   AJUSTE EASYBUTTON - iconos centrados
   ========================================================= */

.visor-pluvio #map .leaflet-control-easyButton {
    border: none;
    background: transparent;
    box-shadow: none;
}

.visor-pluvio #map .leaflet-control-easyButton .easy-button-button {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;

    overflow: hidden;
    line-height: 1 !important;
}

/* Centrar el contenido interno real del botón */
.visor-pluvio #map .leaflet-control-easyButton .easy-button-button span,
.visor-pluvio #map .leaflet-control-easyButton .easy-button-button .button-state,
.visor-pluvio #map .leaflet-control-easyButton .easy-button-button i {
    position: absolute;
    inset: 0;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100%;
    height: 100%;

    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Ocultar estados no activos, por si EasyButton mete más de uno */
.visor-pluvio #map .leaflet-control-easyButton .easy-button-button .button-state {
    display: none !important;
}

.visor-pluvio #map .leaflet-control-easyButton .easy-button-button .button-state.active {
    display: flex !important;
}

/* =========================================================
   PLUVIOMETRÍA - BOTÓN MAPAS ÚLTIMA HORA
   ========================================================= */

.visor-pluvio #map .saih-mapas-hora-control {
    margin-right: 10px !important;
    margin-bottom: 10px !important;

    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.visor-pluvio #map .saih-mapas-hora-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 36px !important;
    height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #fff !important;
    border: 1px solid #dce6ec !important;
    border-radius: 7px !important;

    box-shadow: 0 2px 6px rgba(25, 55, 75, 0.14) !important;

    color: #29485b !important;
    text-decoration: none !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.visor-pluvio #map .saih-mapas-hora-btn:hover {
    background: #eef4f7 !important;
    border-color: #b9cfdd !important;
    color: #17658f !important;
}

.visor-pluvio #map .saih-mapas-hora-btn .fa-map {
    display: block;
    position: static !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 18px !important;
    line-height: 1 !important;
    transform: none !important;
}


/* Simbologia V2 - circulos de lluvia observada (mapa y leyenda). */
.visor-pluvio #map .saih-pluvio-v2-icon {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
.visor-pluvio #map .saih-pluvio-v2-icon svg,
.visor-pluvio #map .saih-legend-item > svg {
    display: block;
    overflow: visible;
}
.visor-pluvio #map .saih-legend-item > svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}
