/* ==========================================================================
   NEXO BURGER — FORMULÁRIO DIRETO DE ENDEREÇO COM AUTOCOMPLETAR INTEGRADO
   (Alta Acessibilidade, Contraste WCAG AAA e Ergonomia Mobile)
   ========================================================================== */

.direct-address-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}

/* ─── Campo de Busca Inteligente com Autocomplete ───────────────────────── */
.address-search-field {
  position: relative;
  background: rgba(255, 90, 0, 0.05);
  border: 1px solid rgba(255, 90, 0, 0.25);
  border-radius: var(--radius-md, 14px);
  padding: 0.85rem;
  margin-bottom: 0.25rem;
}

.address-search-field .form-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffaa7a;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.label-badge-auto {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 90, 0, 0.2);
  color: #ff7a1a;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid rgba(255, 90, 0, 0.35);
}

.address-search-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
}

.address-search-input {
  flex: 1;
  background: #18181b !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  font-size: 16px !important;
  padding: 0.75rem 0.85rem !important;
  border-radius: 10px !important;
  touch-action: manipulation;
}

.address-search-input::placeholder {
  color: #a8a29e !important;
}

.address-search-input:focus {
  border-color: var(--brand-orange, #ff5a00) !important;
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.22) !important;
}

.btn-direct-gps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast, 0.18s ease);
}

.btn-direct-gps:hover {
  background: #3f3f46;
  border-color: var(--brand-orange, #ff5a00);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ─── Sugestões do Autocomplete Dropdown ─────────────────────────────────── */
.address-suggestions-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #18181b;
  border: 1px solid rgba(255, 90, 0, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: rgba(255, 90, 0, 0.15);
  outline: none;
}

.suggestion-pin {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.suggestion-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.suggestion-main {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-sub {
  font-size: 0.75rem;
  color: #dedad4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-loading,
.suggestion-empty {
  padding: 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  color: #dedad4;
}

/* ─── Grid de Número e Bairro ───────────────────────────────────────────── */
.address-row-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0.65rem;
  width: 100%;
}

@media (max-width: 380px) {
  .address-row-grid {
    grid-template-columns: 1fr;
  }
}

.number-input-group {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.btn-sn-quick {
  background: #27272a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #dedad4;
  border-radius: 10px;
  padding: 0.72rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-sn-quick:hover {
  background: #3f3f46;
  color: #ffffff;
}

.btn-sn-quick.active {
  background: var(--brand-orange, #ff5a00);
  border-color: #ff6a1a;
  color: #ffffff;
  font-weight: 800;
}

/* ─── Card de Status de Rota & Frete ────────────────────────────────────── */
.address-route-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1a1a1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin-top: 0.35rem;
}

.route-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.route-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.route-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
}

.route-desc {
  font-size: 0.75rem;
  color: #dedad4;
  line-height: 1.35;
}

.route-fee-pill {
  font-family: var(--font-heading, sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-gold, #f5a623);
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.route-fee-pill.success {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

.route-fee-pill.warning {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ─── Gaveta de Mapa Recolhível ─────────────────────────────────────────── */
.address-map-toggle-wrap {
  margin-top: 0.25rem;
}

.btn-toggle-map-direct {
  width: 100%;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #dedad4;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-map-direct:hover {
  border-color: var(--brand-orange, #ff5a00);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

.toggle-map-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.btn-toggle-map-direct[aria-expanded="true"] .toggle-map-arrow {
  transform: rotate(180deg);
}

.address-map-drawer {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.map-helper-text {
  display: block;
  font-size: 0.72rem;
  color: #aba49c;
  margin-top: 0.4rem;
  text-align: center;
}
