/* ============================================================
   MAPA — Explorar hotéis (feature Pro)
   ============================================================ */

/* Botão de entrada — ícone compacto dentro do input de hotel */
.btn-map-entry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  align-self: center;
  margin-right: 0.55rem;
  background: rgba(201,150,62,0.08);
  border: 1px solid rgba(201,150,62,0.3);
  border-radius: var(--radius-full);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-map-entry svg { display: block; }
.btn-map-entry:hover {
  background: rgba(201,150,62,0.16);
  border-color: var(--gold);
}
.map-pro-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  background: var(--gold);
  color: #fff;
  border-radius: 3px;
  padding: 2px 4px;
}

/* Seção principal do mapa */
.map-section {
  background: var(--navy-800);
  border: 1px solid rgba(201,150,62,0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* Quando o mapa está aberto dentro do search-card */
.search-card--map-open {
  padding: 0;
  overflow: hidden;
}
.search-card--map-open .map-section {
  margin-bottom: 0;
  border: none;
  border-radius: var(--radius-lg);
}

/* Toolbar: campo de destino + botões */
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.map-dest-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}
#map-dest-input {
  width: 100%;
  background: var(--navy-700);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--off-white);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
}
#map-dest-input::placeholder { color: var(--muted); }
#map-dest-input:focus { border-color: var(--gold); }
[data-theme="light"] #map-dest-input {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: var(--navy-600);
}
.map-dest-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--navy-700);
  border: 1px solid rgba(201,150,62,0.2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 500;
  overflow: hidden;
}
[data-theme="light"] .map-dest-dropdown {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.map-dest-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--off-white-dim);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .1s, color .1s;
}
.map-dest-item:last-child { border-bottom: none; }
.map-dest-item:hover { background: rgba(201,150,62,0.1); color: var(--off-white); }
[data-theme="light"] .map-dest-item { color: var(--navy-600); border-color: rgba(0,0,0,0.05); }
[data-theme="light"] .map-dest-item:hover { background: rgba(165,122,42,0.08); color: var(--navy-900); }

.btn-map-search {
  white-space: nowrap;
  padding: 8px 16px !important;
  font-size: 13px !important;
}
.btn-map-search.pulse {
  animation: mapPulse 1.4s ease-in-out infinite;
}
@keyframes mapPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(201,150,62,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(201,150,62,0); }
}
.btn-map-close {
  padding: 8px 12px !important;
  font-size: 18px !important;
  line-height: 1;
  color: var(--muted) !important;
}
.btn-map-close:hover { color: var(--off-white) !important; }

/* Container do Leaflet */
#map-container {
  width: 100%;
  height: 400px;
  background: var(--navy-900);
}
@media (max-width: 640px) { #map-container { height: 280px; } }

/* Status bar */
.map-status {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.map-status-error { color: var(--error); }

/* Lista de hotéis abaixo do mapa */
.map-hotel-list {
  max-height: 320px;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.map-hotel-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background .1s;
}
.map-hotel-card:last-child { border-bottom: none; }
.map-hotel-card:hover { background: rgba(255,255,255,0.03); }
[data-theme="light"] .map-hotel-card:hover { background: rgba(0,0,0,0.03); }
.mhc-info { flex: 1; min-width: 0; }
.mhc-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--off-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="light"] .mhc-name { color: var(--navy-600); }
.mhc-addr {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mhc-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.mhc-rating {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

/* ── Seleção múltipla de hotéis no mapa ── */
.map-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  position: sticky;
  top: 0;
  z-index: 2;
}
[data-theme="light"] .map-list-header {
  background: rgba(0,0,0,0.02);
  border-bottom-color: rgba(0,0,0,0.06);
}
.map-list-sel-count { font-weight: 600; color: var(--gold); }
.map-list-hint      { font-size: 11px; color: var(--muted); }

.map-hotel-card.mhc-selected {
  background: rgba(229,182,90,0.07);
  border-left: 3px solid var(--gold);
  padding-left: 11px; /* 14 - 3 border */
}
[data-theme="light"] .map-hotel-card.mhc-selected {
  background: rgba(184,136,0,0.05);
}

.mhc-select-btn {
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid rgba(229,182,90,0.5);
  background: transparent;
  color: var(--gold);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-body, inherit);
}
.mhc-select-btn:hover {
  background: rgba(229,182,90,0.12);
  border-color: var(--gold);
}
.mhc-select-btn.mhc-sel-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}
.mhc-select-btn.mhc-sel-active:hover {
  background: #f0c56a;
  border-color: #f0c56a;
}

/* Footer sticky abaixo da lista */
.map-list-footer {
  display: none;
  padding: 10px 14px;
  background: var(--navy-900, #060f1e);
  border-top: 1px solid rgba(229,182,90,0.25);
  border-radius: 0 0 12px 12px;
}
[data-theme="light"] .map-list-footer { background: #f0f0f5; }
.map-list-footer.map-footer-visible { display: block; }
.btn-analyze-selection {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Marcadores customizados no mapa */
.map-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform .15s;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,0.5));
}
.map-marker-wrap:hover { transform: scale(1.15); }
.map-marker {
  background: var(--gold, #C9963E);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  padding: 6px 11px;
  white-space: nowrap;
  border: 2.5px solid #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.01em;
}
/* Ponta do balão apontando para a localização do hotel */
.map-marker-tail {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--gold, #C9963E);
  margin-top: -2px;
}

/* Popup do Leaflet — override para tema escuro */
.map-popup .leaflet-popup-content-wrapper {
  background: var(--navy-700, #142436);
  border: 1px solid rgba(201,150,62,0.2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  color: var(--off-white, #F5F0E8);
  padding: 0;
}
.map-popup .leaflet-popup-tip { background: var(--navy-700, #142436); }
.map-popup .leaflet-popup-content { margin: 0; }
.map-popup-inner { padding: 14px; }
.popup-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--off-white, #F5F0E8);
  margin-bottom: 5px;
  line-height: 1.3;
}
.popup-meta { margin-bottom: 4px; }
.popup-rating {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold, #C9963E);
}
.popup-count { font-size: 11px; color: var(--muted, #8A8275); }
.popup-address { font-size: 12px; color: var(--muted, #8A8275); line-height: 1.4; }
.map-popup .leaflet-popup-close-button { color: var(--muted, #8A8275) !important; font-size: 18px !important; padding: 6px 8px !important; }
