/* ── Map page layout ── */

.map-page .site-shell {
  height: calc(100vh - 56px);
}

.map-page .main-pane {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

/* ── Top bar ── */

.map-top-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.map-top-bar h1 {
  font-size: clamp(18px, 2.2vw, 28px);
  margin: 0;
}

.map-top-bar .status {
  margin: 0;
  font-size: 13px;
  color: #666;
}

/* ── Region filter strip ── */

.region-strip {
  background: #f7f7f7;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.region-strip::-webkit-scrollbar {
  display: none;
}

.region-pill {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 12px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
}

.region-pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.region-pill:hover:not(.active) {
  background: #e4e4e4;
}

/* ── Map container ── */

.map-container {
  flex: 1;
  min-height: 0;
  position: relative;
}

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

/* ── Custom pin markers ── */

.pin-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

/* ── Custom cluster markers ── */

.cluster-marker {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ── City card (bottom sheet) ── */

.city-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 18px 20px 24px;
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.26s ease;
  max-height: 55vh;
  overflow-y: auto;
}

.city-card.open {
  transform: translateY(0);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#card-city {
  font-size: clamp(20px, 2.1vw, 28px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
}

.card-close {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: inherit;
  padding: 0;
}

.card-close:hover {
  background: var(--line);
}

.card-meta {
  margin-bottom: 16px;
}

.card-meta p {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.45;
  color: #3a3a3a;
}

.card-meta .card-host {
  font-weight: 500;
  color: var(--ink);
}

.card-meta .card-date {
  font-size: 13px;
  color: #555;
}

.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card-maps-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbb;
  border-radius: 10px;
  padding: 6px 14px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.4;
}

.card-maps-btn:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.card-site-link {
  font-size: 14px;
  color: var(--ink);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

/* ── Leaflet overrides ── */

.leaflet-control-attribution {
  font-size: 10px !important;
}

/* Keep zoom controls above bottom sheets */
.leaflet-control-zoom {
  z-index: 1100 !important;
}

/* Hide default MarkerCluster styles — we use custom divIcon */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: transparent !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: transparent !important;
}


/* ── Trip planner button ── */

.trip-planner-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
  background: #0d6e43;
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.trip-planner-btn:hover {
  background: #0f7a4c;
}

/* ── Trip panel ── */

.trip-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 18px 20px 20px;
  z-index: 900;
  transform: translateY(100%);
  transition: transform 0.26s ease;
  max-height: 70vh;
  overflow-y: auto;
}

.trip-panel.open {
  transform: translateY(0);
}

.trip-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.trip-panel-title {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0;
  color: #0d6e43;
}

/* ── Trip wizard: progress ── */

.trip-progress {
  margin-bottom: 20px;
}

.trip-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-height: 22px;
}

.trip-step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
}

.trip-step-back {
  background: none;
  border: none;
  padding: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  cursor: pointer;
}

.trip-step-back:hover {
  color: var(--ink);
}

.trip-progress-bar {
  display: flex;
  gap: 4px;
  height: 3px;
}

.trip-progress-seg {
  flex: 1;
  background: #e0e0e0;
  transition: background 0.3s;
}

.trip-progress-seg.filled {
  background: var(--ink);
}

/* ── Trip wizard: one step at a time ── */

.trip-step {
  display: flex;
  flex-direction: column;
  animation: tripSlideIn 0.28s ease;
}

.trip-step[hidden] {
  display: none;
}

.trip-step.slide-back {
  animation: tripSlideBack 0.28s ease;
}

@keyframes tripSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes tripSlideBack {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

.trip-question {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
  line-height: 1.2;
}

/* ── Trip option pills (region + duration) ── */

.trip-option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trip-option-pill {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 500;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.trip-option-pill:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.trip-option-lucky {
  background: #ffffff;
  color: #8b1a1a;
  border-color: #8b1a1a;
  font-weight: 600;
}

.trip-option-lucky:hover {
  background: #8b1a1a;
  color: #ffffff;
  border-color: #8b1a1a;
}

.trip-option-pill.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.trip-option-lucky.active {
  background: #8b1a1a;
  color: #ffffff;
  border-color: #8b1a1a;
}

.carmen-text {
  font-size: 12px;
  font-style: italic;
  color: #8b1a1a;
  align-self: center;
  white-space: nowrap;
}

.trip-step-cta {
  margin-top: 14px;
  margin-bottom: 0;
}

.trip-date-input {
  width: 100%;
  padding: 9px 10px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-sizing: border-box;
  display: block;
  margin-bottom: 14px;
}

.trip-error {
  margin: 0 0 10px;
  font-size: 13px;
  color: #c0392b;
}

.trip-search-btn {
  width: 100%;
  padding: 11px 16px;
  background: #0d6e43;
  color: #ffffff;
  border: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.trip-search-btn:hover {
  background: #0f7a4c;
}

/* ── Trip results ── */

.trip-results-summary {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0d6e43;
}

.trip-results-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.trip-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.trip-result-item.has-note {
  opacity: 0.7;
}

.trip-result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trip-result-date {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0d6e43;
}

.trip-result-city {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-result-venue {
  font-size: 12px;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-result-note {
  font-size: 11px;
  color: #888;
  font-style: italic;
}

.trip-result-go {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-family: inherit;
}

.trip-result-go:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.trip-no-results {
  font-size: 13px;
  color: #666;
  padding: 10px 0;
}

.trip-others {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}

.trip-others-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.trip-others-cities {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.trip-back-btn {
  background: none;
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}

.trip-back-btn:hover {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

/* ── Desktop card + trip panel ── */

@media (min-width: 961px) {
  .city-card {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: auto;
    width: 300px;
    border: 1px solid var(--line);
    max-height: 340px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }

  .trip-panel {
    position: absolute;
    top: 60px;
    right: 14px;
    bottom: auto;
    left: auto;
    width: 320px;
    border: 1px solid var(--line);
    max-height: calc(100% - 80px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: none;
    display: none;
  }

  .trip-panel.open {
    display: block;
    transform: none;
  }

  .trip-planner-btn {
    top: 14px;
    right: 14px;
  }
}

/* ── Mobile ── */

@media (max-width: 960px) {
  .map-page .site-shell {
    height: auto;
  }

  .map-page .main-pane {
    height: auto;
    overflow: visible;
  }

  .map-container {
    height: 62vh;
    min-height: 320px;
  }

  .map-top-bar h1 {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .city-card {
    padding: 14px 16px 20px;
  }
}

/* ── Mobile spice pass (map-view scoped) ── */

.map-page {
  background:
    radial-gradient(circle at 14% 8%, rgba(13, 110, 67, 0.12), transparent 40%),
    linear-gradient(180deg, #f6f7f5 0%, #eceeea 100%);
}

.map-page .left-rail {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 247, 247, 0.95) 100%);
}

.map-top-bar {
  background:
    linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
}

.region-pill {
  border-color: #bfc6bf;
  background: #fbfcfa;
}

.region-pill.active {
  background: #0d6e43;
  border-color: #0d6e43;
}

.trip-planner-btn {
  border-radius: 10px;
}

.city-card,
.trip-panel {
  border-top: 1px solid #c8cebf;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
}

.city-card::before,
.trip-panel::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 10px;
  background: #b9b9b9;
  margin: 0 auto 12px;
}

.card-maps-btn {
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
}

.trip-search-btn {
  border-radius: 10px;
  padding: 12px 18px;
}

.trip-option-pill {
  border-radius: 10px;
  padding: 9px 14px;
}

@media (max-width: 960px) {
  .map-page .left-rail {
    flex-direction: row;
    align-items: center;
    padding: 7px 12px;
    gap: 0;
  }

  .map-page .logo-wrap {
    display: none;
  }

  .map-page .map-box {
    display: none;
  }

  .map-page .back-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 10px;
    border: 1px solid #bec4be;
    border-radius: 10px;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #fbfcfa;
  }

  .map-top-bar {
    padding: 7px 12px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .map-top-bar h1 {
    font-size: 17px;
    line-height: 1;
    letter-spacing: -0.01em;
  }

  .map-top-bar .status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5f665f;
  }

  .region-strip {
    position: sticky;
    top: 0;
    z-index: 450;
    padding: 7px 10px;
    background: rgba(244, 246, 242, 0.96);
    backdrop-filter: blur(6px);
  }

  .region-pill {
    font-size: 11px;
    padding: 6px 12px;
  }

  .map-container {
    height: 75dvh;
    min-height: 440px;
  }

  .trip-planner-btn {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 12px;
    width: auto;
    padding: 12px 14px;
    font-size: 13px;
    text-align: center;
    background: #0c6b40;
    box-shadow: 0 8px 22px rgba(4, 26, 14, 0.35);
  }

  .city-card {
    max-height: 58dvh;
    padding: 14px 14px 18px;
  }

  .trip-panel {
    max-height: 76dvh;
    padding: 14px 14px 18px;
  }

  .card-header {
    margin-bottom: 8px;
  }

  #card-city {
    font-size: 26px;
  }

  .card-meta p {
    font-size: 13px;
  }

  .trip-panel-title {
    font-size: 22px;
  }

  .trip-question {
    font-size: 22px;
    margin-bottom: 12px;
  }
}

.map-card-update-link {
  margin-left: auto;
}
