/* ------------------------------------ */
/* 1. Variáveis CSS para Cores e Propriedades Gerais */
/* (Valores extraídos do seu CSS original, sem alterações visuais) */
/* ------------------------------------ */
:root {
  /* Cores modernas */
  --color-grey: #f5f7fa;
  --color-grey2: #e5e9f2;
  --color-white: #ffffff;
  --color-black: #1e1e1e;
  --color-soft-black: #2c3e50;
  --color-gray-border: #d0d7e2;
  --color-button-text: #2d3748;
  --color-red: #e74c3c;

  /* Cores para botões de mapa */
  --color-maps-waze-bg: #2563eb;
  --color-maps-waze-hover: #1d4ed8;

  /* Cores para interações */
  --color-areas-comuns-option-hover-bg: #4b5563;
  --color-sugestoes-popup-hover-bg: #f0f4f8;

  /* Border Radius */
  --border-radius-sm: 6px;
  --border-radius-md: 8px;
  --border-radius-lg: 10px;
  --border-radius-xl: 12px;

  /* Sombras suaves */
  --box-shadow-button-hover: 0 2px 6px rgba(0, 0, 0, 0.1);
  --box-shadow-popup: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ------------------------------------ */
/* 2. Estilos Globais e Reset Básico */
/* ------------------------------------ */
body {
  font-family: "Roboto", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  text-align: center;
  font-style: normal;
  background-color: var(--color-grey);
  margin: 0px;
  padding: 20px;
  box-sizing: border-box;
  color: var(--color-black);
}

a {
  text-decoration: none;
  color: var(--color-black);
  font-weight: bold;
}

h2 {
  font-weight: 600;
  font-size: 1.5rem;
  color: #1e293b;
}

footer {
  padding-top: 10px;
}

/* ------------------------------------ */
/* 3. Elementos de Formulário: Inputs e Selects */
/* ------------------------------------ */
input {
  flex: 1;
  padding: 6px;
  border: 1px solid var(--color-gray-border);
  border-radius: var(--border-radius-md);
  max-width: 100%;
  font-size: 14px;
}

input:focus,
select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

label {
  font-weight: 500;
  font-size: 0.9rem;
  text-align: left;
  display: block;
  margin-bottom: 8px;
}

#areascomuns-dropdown {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--color-gray-border);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  background-color: var(--color-white);
}

#areascomuns-dropdown option:hover {
  background-color: var(--color-areas-comuns-option-hover-bg);
  color: var(--color-white);
}

.erro {
  color: var(--color-red);
  font-size: 14px;
  margin-top: 5px;
  text-align: left;
}

/* ------------------------------------ */
/* 4. Botões */
/* ------------------------------------ */
button {
  border: 0;
  outline: 0;
  cursor: pointer;
  color: var(--color-button-text);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-border);
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 8px;
  display: inline-block;
  min-height: 28px;
  transition: background-color 0.24s, box-shadow 0.24s;
}

button:hover {
  box-shadow: var(--box-shadow-button-hover);
}

#print-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Botões estilizados (Google Maps / Waze) */
.btn {
  display: block;
  text-decoration: none;
  padding: 8px;
  margin: 10px auto;
  font-size: 14px;
  font-weight: bold;
  border-radius: var(--border-radius-lg);
  text-align: center;
  transition: 0.3s;
}

.btn.maps {
  margin-top: 20px;
  background: var(--color-maps-waze-bg);
  color: var(--color-white);
  max-width: 200px;
}

.btn.maps:hover {
  background: var(--color-maps-waze-hover);
}

.btn.waze {
  margin-top: 20px;
  background: var(--color-maps-waze-bg);
  color: var(--color-white);
  max-width: 200px;
}

.btn.waze:hover {
  background: var(--color-maps-waze-hover);
}

/* ------------------------------------ */
/* 5. Layout Principal e Containers */
/* ------------------------------------ */
.conteudo {
  max-width: 600px;
  margin: auto;
}

.container {
  position: relative;
  background: var(--color-white);
  padding: 10px 100px;
  max-width: 600px;
  min-height: calc(100vh - 64px);
  border-radius: 10px;
  border: 2px solid var(--color-grey2);
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.busca-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-bottom: 30px;
  margin-top: 30px;
}

.links-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 90px;
  max-width: 100%;
}

.lotesquintas-container {
  margin-bottom: 25px;
}

#dropdown-container {
  width: 100%;
}

.input-group {
  display: flex;
  gap: 6px;
  position: relative;
}

/* ------------------------------------ */
/* 6. QR Codes */
/* ------------------------------------ */
.label-qrcode {
  font-size: 15px;
}

.qrcode {
  margin: 10px auto;
  display: flex;
  justify-content: center;
}

/* ------------------------------------ */
/* 7. Popups e Sugestões */
/* ------------------------------------ */
.sugestoes-popup {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-border);
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  z-index: 10;
  margin-top: 1px;
  box-shadow: var(--box-shadow-popup);
  border-radius: var(--border-radius-xl);
}

.sugestoes-popup ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.sugestoes-popup li {
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.sugestoes-popup li:hover {
  background-color: var(--color-sugestoes-popup-hover-bg);
}

/* ------------------------------------ */
/* 8. Mapa Leaflet */
/* ------------------------------------ */
#map {
  height: 490px;
  max-width: 600px;
  margin-top: 30px;
  margin-left: auto;
  margin-right: auto;
  display: block;
  border-radius: 10px;
}

/* Ajuste do fundo da caixa de informações do mapa*/
.leaflet-routing-container {
  background-color: transparent !important;
  color: var(--color-black) !important;
  box-shadow: none;
  font-size: 12px;
  width: 210px !important;
  max-height: 400px !important;
}

/* Personalizando os marcadores do mapa (pinos de partida e chegada) */
.leaflet-routing-icon {
  background-color: transparent !important;
  border: none;
}

/* ------------------------------------ */
/* 9. Classes Utilitárias (Hidden/Print) */
/* ------------------------------------ */
.hidden {
  display: none;
}

.print-block {
  display: none;
}

/* ------------------------------------ */
/* 10. Media Queries para Impressão */
/* ------------------------------------ */

@media print {
  body {
    padding: 0px;
  }
  .container {
    padding: 0px;
    border-radius: 0px;
    border: none;
    min-height: 0px;
  }

  #map {
    height: 475px;
    width: 600px;
  }

  #print-btn,
  #googleMapsBtn,
  #wazeBtn,
  .label-qrcode {
    display: none;
  }
  .busca-container,
  footer {
    display: none;
  }
  .print-block {
    display: block;
  }
}

/* ------------------------------------ */
/* 11. Media Queries para Responsividade (Mobile) */
/* ------------------------------------ */
/* Para telas com largura máxima de 768px (tablets e celulares em orientação paisagem) */
@media screen and (max-width: 768px) {
  body {
    padding: 20px;
  }
  .container {
    max-width: 700px; /* utiliza a maior parte da tela */
    padding: 15px;
  }

  button,
  input {
    font-size: 16px;
  }

  .btn {
    font-size: 16px;
    padding: 10px;
  }
  .busca-container {
    display: block;
    margin-top: 20px;
  }

  .links-container {
    display: block;
  }
  .links-holder {
    margin-top: 50px;
  }
  #print-btn {
    display: none;
  }

  #map {
    display: none;
  }
}

/* Para telas com largura máxima de 480px (celulares) */
@media screen and (max-width: 480px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 10px;
    min-height: calc(100vh - 45px);
  }

  .btn {
    font-size: 12px;
    padding: 8px;
  }

  .links-holder {
    margin-top: 40px;
  }

  @media screen and (max-width: 380px) {
    .input-group {
      flex-direction: column;
      gap: 5px;
    }
  }
}
