/* ===== RESULTS MAP VIEW (hidden until the Map button is clicked) ===== */
.ftw-map-toggle-btn {
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 400;
  color: #444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ftw-map-toggle-btn i {
  color: #0d7159;
  font-size: 14px;
}

.ftw-map-toggle-btn:hover {
  background: #f8f9fa;
  border-color: #ccc;
  transform: translateY(-1px);
}

.ftw-map-toggle-btn.active {
  background: #0d7159;
  border-color: #0d7159;
  color: #ffffff;
}

.ftw-map-toggle-btn.active i {
  color: #ffffff;
}

.ftw-results-map-panel {
  position: relative;
  margin: 0 0 28px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(13, 113, 89, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  background: #eef3f2;
}

.ftw-results-map-canvas {
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 520px;
}

.ftw-results-map-status {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  color: #444;
  text-align: center;
}

/* Leaflet divIcon wrappers: let the inner pill size itself */
.ftw-map-price-icon,
.ftw-map-origin-icon {
  background: transparent;
  border: none;
}

.ftw-map-price-marker {
  display: inline-block;
  transform: translate(-50%, -50%);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.ftw-map-price-marker:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Same price bands as the result cards */
.ftw-map-price-marker.price-band-profit,
.ftw-map-popup-price.price-band-profit {
  background: #dcf7eb;
  border-color: rgba(19, 150, 118, 0.35);
  color: #0d7159;
}

.ftw-map-price-marker.price-band-good,
.ftw-map-popup-price.price-band-good {
  background: #deebff;
  border-color: rgba(46, 109, 214, 0.3);
  color: #1f5fb8;
}

.ftw-map-price-marker.price-band-mid,
.ftw-map-popup-price.price-band-mid {
  background: #fff0bf;
  border-color: rgba(196, 151, 14, 0.35);
  color: #8f6500;
}

.ftw-map-price-marker.price-band-high,
.ftw-map-popup-price.price-band-high {
  background: #ffdede;
  border-color: rgba(201, 54, 54, 0.3);
  color: #b12828;
}

.ftw-map-origin-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: #0d7159;
  color: #ffffff;
  font-size: 13px;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 4px 14px rgba(13, 113, 89, 0.4);
}

.ftw-map-route-line {
  stroke: #139676;
  stroke-width: 1.5;
  stroke-opacity: 0.45;
  stroke-dasharray: 4 6;
  fill: none;
}

.ftw-map-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 16px;
}

.ftw-map-popup-wrap .leaflet-popup-content {
  margin: 16px 18px;
}

.ftw-map-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  font-family: 'Jost', sans-serif;
  min-width: 220px;
}

.ftw-map-popup-city {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  color: #111;
}

.ftw-map-popup-city .flag {
  width: 22px !important;
  height: 15px !important;
  border-radius: 2px;
}

.ftw-map-popup-code {
  font-size: 12px;
  color: #0d7159;
  background: #e6f4f1;
  border-radius: 6px;
  padding: 2px 6px;
}

.ftw-map-popup-price {
  padding: 6px 16px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 17px;
}

.ftw-map-popup-times {
  font-size: 13px;
  color: #666;
}

.ftw-map-popup-btn {
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: #139676;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ftw-map-popup-btn:hover {
  background: #0d7159;
}

/* Brief highlight on the card after "Show flight" */
#searchResults .item.ftw-map-highlight {
  box-shadow: 0 0 0 3px #139676, 0 18px 50px rgba(19, 150, 118, 0.25) !important;
  transition: box-shadow 0.3s ease;
}

@media (max-width: 767px) {
  .ftw-results-map-panel {
    border-radius: 16px;
  }

  .ftw-results-map-canvas {
    height: 70vh;
    min-height: 380px;
  }
}

.ftw-results-map-panel .leaflet-container {
  font-family: 'Jost', sans-serif;
}

.ftw-map-toggle-btn:focus {
  outline: none;
}

.ftw-map-toggle-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(19, 150, 118, 0.35);
}

@media (max-width: 767px) {
  .ftw-map-price-marker {
    padding: 3px 8px;
    font-size: 11px;
  }

  .ftw-map-origin-marker {
    padding: 4px 9px;
    font-size: 12px;
  }
}
