.portada-municipal {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.portada-municipal::before { /*Máscara para simular sombra*/
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  border-radius: 22px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.10);
}

.portada-fondo {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fondo-portada {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.portada-contenido {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100%;
}

/* Fondo blanco con degradado hacia la derecha */
.portada-izquierda {
  width: 80%;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, white 40%, rgba(255,255,255,0.0) 90%);
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

.portada-izquierda .escudo {
  max-height: 100px;
  margin: 50px;
}

.portada-izquierda p.nombre-municipio {
  font-size: clamp(1.2em, 5vw, 2em);
  line-height: 1.3;
  margin: auto 150px auto 2%;
  color: #363435;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;

  text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.portada-derecha {
  min-width: 20%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: flex-start;
  padding: 20px;
  color: #fcf5ef;
  background-color: #416259;
  backdrop-filter: blur(4px);
  border-radius: 20px;
  font-size: 14pt;
  font-weight: 100 !important;
  line-height: 1em;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.portada-derecha .label-municipio {
  white-space: nowrap;
}

.portada-derecha .label-municipio span {
  font-size: 20pt;
  font-weight:600 !important;
}

.selector-custom {
  position: relative;
  width: 80%;
  background-color: #304b44;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.10);
  padding: 10px 20px;
  color: #fff;
  font-style: italic;
  cursor: pointer;
  margin-top: 12.5%;
}

.selector-custom.activo {
  border-radius: 20px 20px 0 0;
}

.selector-opciones {
  font-size: clamp(0.8em, 3vw, 1.1em);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #304b44;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  z-index: 10;

  overflow-y: auto;
  max-height: 250px; /*Máximo visible de la lista desplegada de opciones*/
}

#buscadorMunicipal {
  width: 100%;
  height: 100%;
  padding: 0;
  font-size: 16.5px; /*O 0.859em también funciona*/
  font-style: italic;
  font-weight: 100;
  color: #fff;
  background-color: #304b44;
  border: none;
  outline: none;
  overflow: visible;
}

.selector-actual {
  font-weight: 400 !important;
  position: relative;
  padding-right: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; 
}

.selector-actual::after {
  content: "▼";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #fff;
  pointer-events: none;
}

.selector-opciones li {
  padding: 10px 20px;
  font-weight: 300;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.selector-opciones li:hover {
  background-color: #416259;
}

.selector-opciones li:last-child {
  border-radius: 0 0 20px 20px;
}

.portada-municipal {
  margin-bottom: -40px !important;
}

@media (min-width: 834px) and (max-width: 1194px) {
  .portada-derecha {
    max-width: 10%;
  }
}

@media screen and (max-width: 833px) {
  .portada-contenido {
    display: block;
    height: auto;
    position: relative;
  }

  .portada-municipal::before {
  display: none;
  }

  .portada-izquierda {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    background: linear-gradient(to right, white 55%, rgba(255,255,255,0.0) 120%);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    text-align: center;
    z-index: 2;
    position: relative;
  }

  .portada-izquierda::before {
    content: "";
    position: absolute;
        width: calc(100%);
      height: 200px;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
    border-radius: 20px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.10);
  }

  .portada-izquierda .escudo {
    margin: auto 15% auto 15%;
    max-height: 50%;
  }

  .portada-derecha {
    width: calc(100% - 40px);
    border-radius: 22px;
    height: 50px !important;
    background-color: #416259;
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-size: 13pt;
    position: relative;
    z-index: 3;
  }

  .selector-custom {
    width: 50%;
    margin: 20px 10px 20px auto;
  }

  .selector-opciones {
    left: 0;
    right: 0;
  }

  .portada-derecha .label-municipio {
    line-height: 1em;
    margin: auto 20px auto auto;
  }

  .portada-derecha .label-municipio span {
    font-size: 1em;
  }

  .portada-municipal {
    height: auto;
    overflow: visible;
  }

  .fondo-portada {
    height: 200px;
    object-fit: cover;
    border-radius: 22px;
  }

  .portada-izquierda p.nombre-municipio {
    margin: auto 30px auto 1%;
  }
}

@media screen and (max-width: 429px) {
  .selector-custom {
    width: 40%;
    margin: 20px auto;
  }

  .portada-izquierda .escudo {
    margin: auto 10% auto 8%;
    max-height: 50%;
  }

  .portada-izquierda p.nombre-municipio {
    margin: auto 10px auto 0%;
  }
}

.selector-opciones::-webkit-scrollbar {
  width: 6px;
}

.selector-opciones::-webkit-scrollbar-track {
  background: transparent;
}

.selector-opciones::-webkit-scrollbar-thumb {
  background-color: rgba(48, 75, 68, 0.95); /* fondo con transparencia */
  border-radius: 10px;
  border: 1px transparent #304b44;
}

.selector-opciones {
  scrollbar-width: thin;
  scrollbar-color: #416259 transparent;
}