body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f2f5;
  color: #333;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 15px 30px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 7px 5px rgba(0, 0, 0, 0.1);
}

.selectors-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  position: relative;
  top: 70px;
  z-index: 999;
  width: 70%;
  margin: 0 auto;
}

.selectors-container label {
  font-weight: bold;
  color: #333;
  margin-right: 8px;
}

.selectors-container select {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 1em;
  background-color: #f9f9f9;
  transition: border 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}

.selectors-container select:hover {
  border-color: #007bff;
}

.selectors-container select:focus {
  outline: none;
  border-color: #0056b3;
  background-color: #e6f7ff;
}

/* Estilos para el ícono de reset */
.selectors-container #resetFilters {
  margin-left: 20px;
  color: #dc3545;
  /* Color rojo para resaltar */
  font-size: 1.5em;
  transition: color 0.3s ease;
}

.selectors-container #resetFilters:hover {
  color: #ff6666;
}

.selectors-container label i {
  margin-right: 2px;
  color: #27338d;
  font-size: 1.2em;
  vertical-align: middle;
  margin-bottom: 6px;
}

#map {
  height: calc(100vh - 135px);
  margin-top: 71px;
}

.navbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  padding: 15px 30px;
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-sizing: border-box;
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.1);
}

.navbar .logo {
  display: flex;
  align-items: center;
}

.navbar .logo img {
  height: 40px;
}

.navbar .buttons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.navbar button {
  background-color: transparent;
  color: #3b3b3b;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s, transform 0.3s;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar button:hover {
  background-color: transparent;
  transform: translateY(-2px);
}

.leaflet-popup-content-wrapper {
  min-width: 300px;
  /* Puedes ajustar el mínimo */
  max-width: 600px;
  /* Ajusta el máximo según lo que necesites */
  word-wrap: break-word;
  /* Permite que las palabras largas se partan y bajen */
  overflow-wrap: break-word;
  /* Alternativa para asegurar el ajuste de texto */
  white-space: normal;
  /* Asegura que el texto no se mantenga en una sola línea */
  padding: 20px;
}

.leaflet-popup-content {
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
}

.popup-container {
  text-align: left;
  padding: 10px 20px;
  /* Igual padding en los lados izquierdo y derecho */
}

.popup-header {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: normal;
  /* Permitir que el texto se ajuste en varias líneas si es necesario */
  word-wrap: break-word;
  /* Partir palabras largas si es necesario */
}

.popup-info {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.popup-links a {
  display: flex;
  align-items: center;
  gap: 3px;
  /* Reduce el espacio entre el icono y el texto */
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
  margin-bottom: 3px;
  /* Reduce aún más el espacio entre los botones */
}

.popup-links a:last-child {
  margin-bottom: 0;
  /* Elimina el margen inferior del último enlace */
}

.popup-links a:hover {
  color: #0056b3;
  text-decoration: underline;
}

.popup-links i {
  font-size: 18px;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .navbar .buttons {
    display: none;
  }

  .dropdown-menu {
    display: block !important;
  }

  .dropdown-button {
    background-color: #3b3b3b;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    padding: 5px 10px;
    font-size: 0.8em;
    border-radius: 5px;
    display: block !important;
  }

  .dropdown-button:hover {
    background-color: #272727;
    transform: translateY(-2px);
  }
}

.dropdown-menu {
  display: none;
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  right: 0;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid #0000000f;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s, opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #dddddd26;
  opacity: 1;
  transform: translateY(-2px);
}

.dropdown-menu.show .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu {
  display: none;
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
  right: 0;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid #0000000f;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s, opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #dddddd26;
  opacity: 1;
  transform: translateY(-2px);
}

.dropdown-menu.show .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-menu.show .dropdown-button {
  display: block;
}


@media (max-width: 1865px) {

  .navbar .buttons {
    display: none;
  }

  .dropdown-menu {
    display: block !important;
  }
}

/* Ajustes para pantallas de hasta 1500px */
@media (min-width: 1200px)and (max-width: 1500px) {
  .selectors-container {
    width: 80%;
    /* Ajustar el ancho para pantallas más grandes pero no ocupar todo el espacio */
    gap: 20px;
    /* Espaciado entre los elementos */
    padding: 14px;
    /* Ajustar el padding ligeramente */
  }

  .selectors-container label {
    font-size: 1em;
    /* Mantener el tamaño de la etiqueta */
  }

  .selectors-container select {
    width: auto;
    /* Permitir que los dropdowns tengan su ancho en función del contenido */
    padding: 12px;
    /* Ajustar el padding */
  }

  #resetFilters {
    font-size: 1.5em;
    /* Mantener el tamaño del ícono */
  }

  #map {
    height: calc(100vh - 170px);
    /* Reducir el tamaño del mapa ligeramente para acomodar el contenedor */
  }
}

/* Ajustes para pantallas de hasta 860px */
@media (max-width: 1200px) {
  .selectors-container {
    flex-direction: column;
    align-items: stretch;
    width: 90%;
    gap: 15px;
    padding: 10px;
    padding-top: 14px;
  }

  .selectors-container label {
    margin-right: 0;
  }

  .selectors-container select {
    width: 100%;
  }

  #resetFilters {
    align-self: flex-end;
    margin-left: 0;
    margin-top: 10px;
  }

  #map {
    height: calc(100vh - 200px);
  }
}

/* Ajustes para pantallas de hasta 700px */
@media (max-width: 700px) {
  .selectors-container {
    flex-direction: column;
    width: 90%;
    gap: 10px;
    padding-top: 15px;
  }

  .selectors-container select {
    font-size: 0.9em;
  }

  #resetFilters {
    font-size: 1.2em;
  }

  #map {
    height: calc(100vh - 250px);
  }
}

/* Ajustes para pantallas de hasta 499px */
@media (max-width: 499px) {
  .selectors-container {
    flex-direction: column;
    width: 100%;
    padding: 5px;
    gap: 8px;
  }

  .selectors-container label {
    font-size: 0.9em;
  }

  .selectors-container select {
    font-size: 0.85em;
    padding: 8px;
  }

  #resetFilters {
    font-size: 1em;
    margin-top: 5px;
  }

  #map {
    height: calc(100vh - 270px);
  }
}

/* Estilos para el ícono de toggle en forma de triángulo dentro del contenedor */
.selectors-container .toggle-icon {
  position: absolute;
  bottom: -15px;
  /* Dentro del contenedor, pegado al borde inferior */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid #333;
  /* Color del triángulo */
  cursor: pointer;
  transition: border-top-color 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.toggle-icon:hover {
  border-top-color: #0056b3;
  /* Cambia el color al pasar el mouse */
}

/* Posición del toggle icon cuando el contenedor está colapsado (fuera del contenedor) */
.toggle-icon-collapsed {
  position: absolute;
  top: 74px;
  /* Ajusta la posición como desees */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 15px solid #333;
  /* Color del triángulo */
  cursor: pointer;
  transition: border-top-color 0.3s ease;
  z-index: 1000;
}

.toggle-icon-collapsed:hover {
  border-top-color: #0056b3;
  /* Cambia el color al pasar el mouse */
}

/* Animación para el contenedor */
.selectors-container {
  position: relative;
  /* transition: transform 0.1s ease, max-height 0.1s ease; */
  transform-origin: top;
  /* Para animar desde la parte superior */
  max-height: 500px;
  transform: translateY(0);
  /* Visible inicialmente */
  visibility: visible;
  pointer-events: all;
}

.selectors-container.collapsed {
  transform: translateY(-100%);
  /* Desplazar hacia arriba fuera de la vista */
  max-height: 0;
  visibility: hidden;
  pointer-events: none;
}

.selectors-container.expanded {
  transform: translateY(0);
  /* Baja nuevamente al estado visible */
  max-height: 500px;
  /* Altura estimada */
  visibility: visible;
  pointer-events: all;
}

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-size: 1.5em;
  color: #333;
}

.spinner {
  border: 5px solid #f3f3f3;
  border-radius: 50%;
  border-top: 5px solid #007bff;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
