.rtve-embed {
  width: 90vw;
  position: relative;
  margin: 50px 0;
}

@media (min-width: 768px) {
  .rtve-embed {
    width: 99.6vw;
    margin-left: calc((100vw - 100%) / -2);
    overflow: hidden;
    margin-bottom: 60px;
    margin-top: 60px;
  }
}

.mainheader {
  z-index: 4000;
}

#map {
  height: 100vh;
  position: relative;
}

#filters-container {
  z-index: 1100;
  pointer-events: auto;
  width: 100vw;
}

#filters button {
  --clr: #1976d2;
  background: #fff;
  color: #333;
  border: 2px solid var(--clr);
  border-radius: 25px;
  padding: 10px 18px;
  font: 400 14px/1 "Roboto", "Arial", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  justify-content: center;
  height: 40px;
  box-sizing: border-box;
}

#filters button[data-filter="total"] {
  --clr: #905b00;
}

#filters button[data-filter="jubilacion"] {
  --clr: #d32f2f;
}

#filters button[data-filter="incapacidad"] {
  --clr: #1976d2;
}

#filters button[data-filter="viudedad"] {
  --clr: #388e3c;
}

#filters button[data-filter="orfandad"] {
  --clr: #7b1fa2;
}

#filters button[data-filter="favor"] {
  --clr: #f57c00;
}

#filters button:hover {
  border-color: var(--clr);
  color: var(--clr);
  background: rgba(255, 255, 255, 0.9);
}

#filters button.active {
  background: var(--clr);
  color: #fff;
  border-color: #fff;
}

.flecha-nav {
  display: none;
}

#geocoder-container,
.mapboxgl-ctrl-geocoder {
  width: 95vw;
  max-width: 95vw;
  margin: 0 auto;
  border-radius: 8px;
  transition: top 0.3s;
  z-index: 1001;
  box-shadow: none;
  background: none;
}

.mapboxgl-ctrl-geocoder .suggestions,
.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--suggestion,
.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--suggestion-list {
  z-index: 2500 !important;
}

@media (max-width: 901px) {
  .mapboxgl-ctrl-geocoder .suggestions {
    z-index: 2500 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #ddd !important;
    border-top: none !important;
    max-height: 200px !important;
    overflow-y: auto !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder {
    position: relative !important;
  }
}

#leyenda {
  z-index: 1002;
  width: auto;
  max-width: 800px;
  padding: 8px 12px;
  margin: 12px 0 0 50px;
  background: transparent;
  font-family: Roboto, Arial, sans-serif;
}

#leyenda-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

#leyenda-title {
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0%;
  color: #333;
  text-align: left;
}

#leyenda-title div {
  margin: 0;
  padding: 0;
}

#leyenda-bar-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  position: relative;
}

#leyenda-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#leyenda-labels-wrapper {
  display: flex;
  justify-content: space-between;
  width: 80px;
  margin-top: 2px;
}

#leyenda-color {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(
    to right,
    rgb(255, 255, 255),
    rgb(251, 234, 234),
    rgb(246, 213, 213),
    rgb(242, 193, 193),
    rgb(237, 172, 172),
    rgb(233, 151, 151),
    rgb(229, 130, 130),
    rgb(224, 109, 109),
    rgb(220, 89, 89),
    rgb(215, 68, 68),
    rgb(211, 47, 47)
  );
  width: 80px;
}

.leyenda-label {
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 16px;
  line-height: 32px;
  letter-spacing: 0%;
  vertical-align: middle;
  color: #333;
}

.tooltip-maquetacion {
  font: 14px/1.35 "Segoe UI", "Arial", sans-serif;
  background: #ffffff;
  padding: 14px 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  max-inline-size: 100%;
  position: relative;
  overflow: visible;
  height: auto;
  max-height: none;
  overflow-y: visible;
  margin-top: 40px;
}

.tooltip-maquetacion > *:last-child {
  margin-bottom: 0;
}

/* Línea de color superior */
.tooltip-color-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #905b00;
}

.tooltip-maquetacion .titulo {
  font-weight: 600;
  font-size: 2.1rem;
  margin-top: 8px;
  margin-bottom: 4px;
  line-height: 1.2;
}

.poblacion {
  font-size: 1.5rem;
  color: #757474;
  margin-bottom: 12px;
  line-height: 1.2;
}

.pension-info {
  background: #f5f5f5;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.pension-media-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pension-label {
  font-weight: 600;
  color: #333;
  font-size: 1.5rem;
}

.pension-value {
  font-weight: 600;
  color: #333;
  font-size: 1.4rem;
}

.pension-info-doble {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.pension-info-izquierda {
  flex: 1;
  background: #f5f5f5;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: center;
}

.pension-info-derecha {
  flex: 1;
  padding: 10px 12px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.pension-info-izquierda .pension-label,
.pension-info-derecha .media-espana-label {
  font-weight: 600;
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.pension-info-izquierda .pension-value,
.pension-info-derecha .media-espana-value {
  font-weight: 600;
  color: #333;
  font-size: 1.4rem;
}

.pension-value,
.media-espana-value,
.total-pensiones {
  font-variant-numeric: tabular-nums;
}

.media-espana {
  font-size: 0.85rem;
  color: #666;
  margin-top: 2px;
}

.total-pensiones {
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5rem;
  line-height: 1.2;
}

.distribucion-titulo {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 0.95rem;
}

.tabla-distribucion {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
  margin-bottom: 12px;
  table-layout: fixed;
  border: none;
}

.tabla-distribucion th,
.tabla-distribucion td {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f0f0;
  word-wrap: break-word;
}

.tabla-distribucion .fila-seleccionada {
  background-color: #f5f5f5;
  font-weight: 600;
}

.tabla-distribucion .tipo {
  text-align: left;
}

.tabla-distribucion .porcentaje,
.tabla-distribucion .pension {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 901px) {
  .tooltip-maquetacion {
    font-size: 12px;
  }

  .tooltip-maquetacion .titulo {
    font-size: 16px;
  }

  .tooltip-maquetacion .total {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
  }

  .tooltip-maquetacion .habitantes-info {
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
  }

  .pension-info-doble {
    flex-direction: column;
    gap: 8px;
  }
}

#modal-overlay {
  display: none;
}

#tooltip-movil.tooltip-maquetacion {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 90vw;
  max-width: 400px;
  height: auto;
  max-height: 85vh;
  padding: 20px 20px 15px 20px;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
  overflow-y: visible;
  display: none;
  z-index: 99999;
  background: #fff;
  transition: transform 0.3s ease-in-out;
}

#tooltip-movil.tooltip-maquetacion.show {
  transform: translateX(-50%) translateY(0);
}

#tooltip-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
  color: #777676;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tooltip-lateral {
  position: absolute;
  top: 120px;
  right: 24px;
  width: 465px;
  max-inline-size: 465px;
  height: auto;
  padding: 14px 16px 10px 16px;
  z-index: 1200;
  display: none;
}

/* Barras apiladas en tooltip */
#barra-apilada-tooltip {
  margin-top: 1rem;
  margin-bottom: 10px;
  width: 100%;
  min-height: 60px;
}

#barra-apilada-tooltip svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

#barra-apilada-tooltip .barra-label {
  font-size: 12px;
  fill: #333;
}

#barra-apilada-tooltip .barra-porcentaje {
  font-size: 11px;
  fill: #fff;
  font-weight: 600;
  text-anchor: middle;
}

.nav-mapa {
  position: absolute;
  top: 320px;
  left: 50px;
  z-index: 1000;
}

.nav-mapa button {
  width: 30px;
  height: 30px;
  background-color: white;
  display: block;
  margin: 5px 0;
  text-indent: -1000px;
  font-size: 0;
  border-radius: 2px;
  border: 1px solid #898989;
  cursor: pointer;
  background-position-x: -4px;
}

.nav-mapa button:hover {
  opacity: 0.8;
}

.nav-mapa button.active {
  box-shadow: 0px 0px 2px black inset;
}

.icon-map-peninsula {
  background-image: url("https://css2.rtve.es/css/rtve.2023.noticias/cadaveres-hormigon/i/Icon_Spain-000000.svg");
  background-size: cover;
}

.icon-map-canarias {
  background-image: url("https://css2.rtve.es/css/rtve.2023.noticias/cadaveres-hormigon/i/Icon_Canarias-000000.svg");
  background-size: cover;
}

button#fit {
  z-index: -1;
}

.btn_reset {
  display: none !important;
}

.mapboxgl-ctrl-top-left .mapboxgl-ctrl {
  float: left;
  margin: 250px 0 0 48px;
}

.mapboxgl-ctrl-group {
  width: 30px;
  box-shadow: none;
  border-radius: 2px;
  border: 1px solid #898989;
  background-color: white;
}

.mapboxgl-ctrl-zoom-in,
.mapboxgl-ctrl-zoom-out {
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  border: none !important;

  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  overflow: hidden;
  position: relative;
  cursor: pointer !important;
}

.mapboxgl-ctrl-zoom-in::before {
  content: "+";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: #333;
  pointer-events: none;
  line-height: 1;
}

.mapboxgl-ctrl-zoom-out::before {
  content: "−";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: #333;
  pointer-events: none;
  line-height: 1;
}

.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,
.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
  display: none !important;
}

.mapboxgl-ctrl-zoom-in,
.mapboxgl-ctrl-zoom-out {
  pointer-events: auto !important;
  user-select: none;
  outline: none !important;
}

.mapboxgl-ctrl-group:not(:empty) {
  box-shadow: none;
}

.mapboxgl-ctrl-compass {
  display: none !important;
}

@media (max-width: 901px) {
  #panel-superior {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    pointer-events: auto;
  }

  #leyenda-title div {
    display: inline !important;
  }

  #leyenda-title div:not(:last-child):after {
    content: " ";
  }

  #toggle-filters {
    display: flex;
    align-self: flex-end;
    margin: 8px 16px 0 0;
  }

  #filters-container {
    position: static;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    background: none;
    gap: 8px;
  }

  #nav-search-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
  }

  .nav-mapa-mobile {
    position: static !important;
    display: flex !important;
    gap: 4px;
    margin: 0;
  }

  .nav-mapa-mobile button {
    width: 30px !important;
    height: 30px !important;
    font-size: 8px !important;
    padding: 0px !important;
    border-radius: 2px !important;
    border: 1px solid #898989;
    background-color: white;
    background-size: cover !important;
    background-position-x: -4px !important;
    text-indent: -1000px;
    background-repeat: no-repeat;
  }

  .nav-mapa-mobile .icon-map-peninsula {
    background-image: url("https://css2.rtve.es/css/rtve.2023.noticias/cadaveres-hormigon/i/Icon_Spain-000000.svg");
  }

  .nav-mapa-mobile .icon-map-canarias {
    background-image: url("https://css2.rtve.es/css/rtve.2023.noticias/cadaveres-hormigon/i/Icon_Canarias-000000.svg");
  }

  .nav-mapa:not(.nav-mapa-mobile) {
    display: none !important;
  }

  .flecha-nav {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex !important;
    /* Mostrar en móvil */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 1001;
  }

  .flecha-nav:hover {
    background: #fff;
    color: #333;
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .flecha-nav:active {
    transform: scale(0.95);
  }

  .flecha-nav.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }

  #flecha-derecha {
    margin-left: -11px;
  }

  #filters {
    flex: 1;
    margin: 0;
    border-radius: 10px;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding: 8px 8px 8px 8px;
  }

  #filters::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  #filters button {
    flex-shrink: 0;
    min-width: 90px;
  }

  #filters::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.6) 0%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.6) 100%
    );
    pointer-events: none;
    z-index: 0;
  }

  #filters {
    position: relative;
  }

  #geocoder-mobile-placeholder {
    flex: 1;
    margin: 0;
    height: 38px !important;
    min-width: 0;
    display: flex;
    align-items: center;
    border: 1px solid #7c7c7c;
    border-radius: 6px;
  }

  @media (max-width: 901px) {
    #geocoder-container {
      height: 32px !important;
      margin: 0 !important;
      position: static !important;
      width: 100% !important;
    }

    #geocoder-container .mapboxgl-ctrl-geocoder {
      width: 100% !important;
    }

    #geocoder-container .mapboxgl-ctrl-geocoder input {
      font-size: 12px !important;
      height: 32px !important;
      line-height: 1 !important;
      padding: 0 32px 0 8px !important;
      border-radius: 4px !important;
      box-sizing: border-box !important;
      display: flex !important;
      align-items: center !important;
    }

    #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
      top: 6px !important;
      right: 6px !important;
      left: auto !important;
      width: 20px !important;
      height: 20px !important;
    }

    #geocoder-container
      .mapboxgl-ctrl-geocoder
      .mapboxgl-ctrl-geocoder--button {
      width: 32px !important;
      height: 32px !important;
      line-height: 32px !important;
      position: absolute !important;
      top: 0 !important;
      right: 0 !important;
    }
  }

  .mapboxgl-ctrl-geocoder .suggestions {
    z-index: 2500 !important;
    position: relative !important;
  }

  .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--suggestion {
    z-index: 2500 !important;
  }

  .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--suggestion-list {
    z-index: 2500 !important;
  }

  #leyenda {
    position: relative !important;
    width: 100%;
    margin: 8px auto;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  }

  #leyenda-content {
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
  }

  #leyenda-title {
    text-align: left !important;
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 16px !important;
  }

  #leyenda-bar-container {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    justify-content: flex-end !important;
  }

  #leyenda-color {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 140px !important;
    height: 14px !important;
  }

  .leyenda-label {
    font-size: 14px !important;
  }

  .nav-mapa {
    top: 370px;
    left: 10px;
    display: flex;
    gap: 5px;
  }

  .nav-mapa button {
    width: 30px;
    height: 30px;
    border: 1px solid #898989;
    border-radius: 2px;
  }

  .mapboxgl-ctrl-zoom-in,
  .mapboxgl-ctrl-zoom-out {
    display: none !important;
  }

  .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
    display: none !important;
  }
}

@media (max-width: 499px) {
  #filters {
    width: 96vw !important;
    max-width: 96vw !important;
    padding: 6px 15px 6px 6px !important;
  }

  #filters button {
    min-width: 75px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    margin: 2px !important;
  }

  #nav-search-row {
    gap: 6px !important;
    padding: 0 6px !important;
  }

  .nav-mapa-mobile button {
    width: 30px !important;
    height: 30px !important;
    font-size: 7px !important;
    padding: 0px !important;
    border-radius: 2px !important;
    background-size: cover !important;
    background-position-x: -4px !important;
  }

  #geocoder-mobile-placeholder {
    height: 32px !important;
  }

  #geocoder-container {
    height: 28px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder input {
    font-size: 12px !important;
    height: 28px !important;
    line-height: 1 !important;
    padding: 0 30px 0 6px !important;
    display: flex !important;
    align-items: center !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
    width: 16px !important;
    height: 16px !important;
    margin: 0;
    top: 0 !important;
    right: 0 !important;
    transform: translateY(-3px);
  }

  #geocoder-container .mapboxgl-ctrl-geocoder--icon.mapboxgl-ctrl-geocoder--icon-search {
    transform: translate(-7px, 6px)
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--button {
    width: 18px !important;
    height: 18px !important;
    position: absolute !important;
    top: 1px !important;
    right: 3px !important;
    background: #fff;
  }

  #leyenda {
    padding: 8px !important;
  }

  #leyenda-title {
    text-align: left !important;
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 13px !important;
  }

  #leyenda-bar-container {
    flex-direction: row !important;
    align-items: center !important;
    gap: 5px !important;
    flex: 1 !important;
    justify-content: flex-end !important;
  }

  #leyenda-color {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 80px !important;
    height: 8px !important;
  }

  .leyenda-label {
    font-size: 11px !important;
  }

  #filters::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.5) 0%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.5) 100%
    );
    pointer-events: none;
    z-index: 0;
  }

  #filters {
    position: relative;
  }
}

@media (min-width: 700px) and (max-width: 901px) {
  #filters {
    max-width: 90vw !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 20px !important;
  }

  #filters::-webkit-scrollbar {
    display: none;
  }

  #filters button {
    min-width: 95px;
    padding: 6px 12px;
    font-size: 13px;
    flex-shrink: 0;
    margin: 4px;
  }

  #nav-search-row {
    gap: 10px !important;
  }

  .nav-mapa-mobile button {
    width: 30px !important;
    height: 30px !important;
    font-size: 9px !important;
    padding: 0px !important;
    border-radius: 2px !important;
    background-size: cover !important;
    background-position-x: -4px !important;
  }

  #geocoder-mobile-placeholder {
    height: 36px !important;
  }

  #geocoder-container {
    height: 36px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder {
    height: 36px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder input {
    font-size: 14px !important;
    height: 36px !important;
    line-height: 1 !important;
    padding: 0 40px 0 12px !important;
    display: flex !important;
    align-items: center !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: 20px !important;
    height: 20px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--button {
    width: 36px !important;
    height: 36px !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
  }

  #filters::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.6) 0%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.6) 100%
    );
    pointer-events: none;
    z-index: 0;
  }

  #filters {
    position: relative;
  }

  /* Leyenda horizontal para tablet */
  #leyenda-title {
    text-align: left !important;
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 15px !important;
  }

  #leyenda-bar-container {
    flex-direction: row !important;
    align-items: center !important;
    gap: 7px !important;
    flex: 1 !important;
    justify-content: flex-end !important;
  }

  #leyenda-color {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 120px !important;
    height: 12px !important;
  }

  .leyenda-label {
    font-size: 13px !important;
  }

  .nav-mapa {
    top: 280px;
    left: 15px;
  }

  .nav-mapa button {
    width: 30px;
    height: 30px;
  }

  .mapboxgl-ctrl-zoom-in,
  .mapboxgl-ctrl-zoom-out {
    display: none !important;
  }
}

@media (min-width: 500px) and (max-width: 699px) {
  #filters {
    max-width: 95vw !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding: 0 15px 0 8px !important;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  #filters::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  #filters button {
    min-width: 85px;
    padding: 6px 10px;
    font-size: 12px;
    flex-shrink: 0;
    margin: 4px 3px;
  }

  #nav-search-row {
    gap: 8px !important;
  }

  .nav-mapa-mobile button {
    width: 30px !important;
    height: 30px !important;
    font-size: 8px !important;
    padding: 0px !important;
    border-radius: 2px !important;
    background-size: cover !important;
    background-position-x: -4px !important;
  }

  #geocoder-mobile-placeholder {
    height: 32px !important;
  }

  #geocoder-container {
    height: 32px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder {
    height: 32px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder input {
    font-size: 11px !important;
    height: 32px !important;
    line-height: 1 !important;
    padding: 0 32px 0 8px !important;
    display: flex !important;
    align-items: center !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon {
    top: 6px !important;
    right: 6px !important;
    left: auto !important;
    width: 18px !important;
    height: 18px !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--button {
    width: 32px !important;
    height: 32px !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
  }

  #filters::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.55) 0%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.55) 100%
    );
    pointer-events: none;
    z-index: 0;
  }

  #filters {
    position: relative;
  }

  #leyenda-title {
    text-align: left !important;
    margin-bottom: 0;
    flex-shrink: 0;
    font-size: 14px !important;
  }

  #leyenda-bar-container {
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    flex: 1 !important;
    justify-content: flex-end !important;
  }

  #leyenda-color {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100px !important;
    height: 10px !important;
  }

  .leyenda-label {
    font-size: 12px !important;
  }

  .nav-mapa {
    top: 250px;
    left: 15px;
  }

  .nav-mapa button {
    width: 30px;
    height: 30px;
  }

  .mapboxgl-ctrl-zoom-in,
  .mapboxgl-ctrl-zoom-out {
    display: none !important;
  }
}

@media (min-width: 902px) {
  #panel-superior {
    position: absolute;
    width: 100%;
    top: 0;
    border: 3px solid green;
  }

  #nav-search-row {
    display: none !important;
  }

  .nav-mapa:not(.nav-mapa-mobile) {
    display: block !important;
  }

  .mapboxgl-ctrl-geocoder--input {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
  }

  #geocoder-container {
    position: absolute;
    top: 70px !important;
    right: 24px !important;
    width: 433px !important;
    margin: 0 !important;
    z-index: 1200 !important;
  }

  #geocoder-container .mapboxgl-ctrl-geocoder {
    width: 465px !important;
  }

  #filters-container {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1100;
    flex-direction: column;
    align-items: center;
    background: transparent;
  }

  #filters {
    display: flex !important;
    flex-direction: row;
    flex-wrap: wrap;
    width: max-content;
    margin: 12px auto 0;
    justify-content: center;
    gap: 4px;
    padding: 8px;
  }

  #geocoder-container,
  .mapboxgl-ctrl-geocoder {
    position: absolute;
    top: 50px;
    right: 0;
    width: 433px;
    margin: 0;
    z-index: 1200;
  }

  #leyenda {
    position: absolute;
    top: 70px;
    left: 50px;
    width: 185px;
    margin: 0;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  #leyenda-title {
    font-size: 16px !important;
  }

  .nav-mapa {
    position: absolute;
    top: 320px;
    left: 50px;
  }

  .nav-mapa button {
    width: 30px;
    height: 30px;
  }

  .mapboxgl-ctrl-zoom-in,
  .mapboxgl-ctrl-zoom-out {
    display: block !important;
  }
}

@media (min-width: 1200px) {
    #leyenda {
      top: 30px;
    }
}


@media (min-width: 1700px) {
    #geocoder-container, .mapboxgl-ctrl-geocoder {
      top: -40px;
    }
}