/* Google Maps styles */

/* Formulario de Búsqueda */
#searchSection {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
}

/* Input del formulario */
#inputContainer {
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid black;
  width: 700px;
}

/* Campo de entrada */
#nhco-addressInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  line-height: 1.5;
  padding: 0px;
  margin-bottom: -6px;
}

/* Botón */
#searchButton {
  font-family: "Inter", Sans-Serif;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.5;
  margin-bottom: -4px;
}

#searchError{
  color: #bc0404;
  margin-top: 6px;
  font-size: 12px;
  min-height: 14px;
  line-height: 14px;
}

/* Icono */
#searchButton img {
  width: 20px;
  height: 20px;
  margin-left: 8px;
}

#mainContainer {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100%;
  gap: 20px;
  overflow: hidden;
}

/* Mapa */
#map {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  transition: height 0.3s ease; 
}

#map:not(:has(.gm-style))::before {
  content: "Haz clic o busca una dirección para cargar el mapa";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
  font-size: 18px;
  text-align: center;
  background-color: #f0f0f0;
  pointer-events: none;
  z-index: 1;
}

#map.with-results {
  height: 50vh;
}

/* Contenedor de Resultados */
#resultsContainer {
  display: none;
  flex-direction: column;
  flex: 0 0 30%;
  height: 65vh;
}

/* Encabezado de Resultados */
#resultsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#resultsHeader #resultsCount {
  font-size: 26px;
  font-weight: 500;
  color: #000;
  margin-left: 32px;
}

#closeResults {
  background: none;
  border: none;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  color: #3e3e3e;
}

#closeResults:hover {
  color: #000;
}

/* Lista de Resultados */
#resultsList {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;
  overflow-y: auto;
}

/* Elementos individuales de los resultados */
.result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid black;
  background: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.result-item:hover {
  background: #f5f5f5;
}

/* Icono de ubicación */
.location-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.result-content {
  display: flex;
  flex-direction: column;
}

.result-content strong {
  font-size: 16px;
  font-weight: bold;
}

.result-content p {
  margin: 0;
  color: #555;
  font-size: 14px;
}

/* Responsividad */
@media screen and (max-width: 768px) {
  #mainContainer {
    flex-direction: column;
  }

  #resultsContainer {
    flex: 0 0 50%;
    height: 50%;
    border-right: none;
    border-top: 1px solid #ccc;
  }

  #map {
    flex: 1;
    height: 50vh;
  }

  #resultsList {
    gap: 10px;
    padding: 10px;
  }

  .result-item {
    padding: 10px;
  }

  #resultsHeader {
    font-size: 16px;
    padding: 10px;
  }

  #closeResults {
    font-size: 18px;
  }
}

@media screen and (max-width: 480px) {
  #resultsHeader {
    font-size: 14px;
    padding: 8px;
  }

  .result-item {
    padding: 8px;
    gap: 8px;
  }

  .location-icon {
    width: 20px;
    height: 20px;
  }

  .result-content strong {
    font-size: 14px;
  }

  .result-content p {
    font-size: 12px;
  }
}

@media screen and (max-width: 768px) {

  #mainContainer {
    display: block; 
    height: auto;
    overflow: visible;
  }

  #resultsContainer {
    width: 100%;
    margin-bottom: 20px;
  }

  #map {
    width: 100%;
    height: 400px;
  }

  #resultsList {
    overflow-y: hidden;
  }

  #resultsHeader #resultsCount {
    font-size: 18px;
    margin-left: 32px;
  }

  #searchSection {
    display: block;
    justify-content: center;
    padding: 0 15px;
  }

  #inputContainer {
    max-width: 100%;
    width: 100%;
    border-bottom: 1px solid black;
  }

  #nhco-addressInput {
    font-size: 14px;
  }

  #searchButton {
    font-size: 14px;
  }
}

@media screen and (max-width: 480px) {
  #searchSection {
    display: block;
    justify-content: center;
    padding: 0 10px;
  }

  #inputContainer {
    max-width: 100%;
    width: 100%;
  }

  #nhco-addressInput {
    font-size: 12px;
  }

  #searchButton {
    font-size: 12px;
  }
}

#closeResults img#closeIcon {
  margin-right: -9px;
  max-width: none;
  width: 26px;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.map-overlay p {
    font-size: 18px;
    color: #333;
}
