/* Frosted-glass header floating over the map */
body.map #header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  /* background: rgba(255, 255, 255, 0.72); */
  /* backdrop-filter: blur(14px); */
  /* -webkit-backdrop-filter: blur(14px); */
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.06); */
}

/* Layout fills the full viewport — header floats on top */
body.map .layout {
  padding: 0;
  height: 100svh;
  overflow: hidden;
  max-width: none;
}

/* Main container: sidebar + map side by side */
.map-explore {
  display: flex;
  height: 100%;
}

/* ── Sidebar ────────────────────────────────────────── */

.map-explore__sidebar {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
  padding-top: 74px; /* header height */
}

.map-explore__sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.map-explore__sidebar-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.map-explore__heading {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.map-explore__count {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Search */
.map-explore__search {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.map-explore__search-input {
  width: 100%;
  height: 36px;
  padding: 0 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.8125rem;
  background: #f9fafb;
  box-sizing: border-box;
  outline: none;
  font-family: inherit;

  &:focus {
    border-color: #6b7280;
    background: #fff;
  }
}

/* Spot list */
.map-explore__list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Spot card ───────────────────────────────────────── */

.map-explore__card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
  position: relative;

  &:hover {
    background: #f9fafb;
  }
}

.map-explore__card--active {
  background: #fff8f0;
  border-left: 3px solid #ff2800;
  padding-left: calc(1.25rem - 3px);

  & .map-explore__card-name {
    color: #ff2800;
  }
}

.map-explore__card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}

.map-explore__card-thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: #f3f4f6;
}

.map-explore__card-body {
  flex: 1;
  min-width: 0;
}

.map-explore__card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-explore__card-country {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 1px;
}

.map-explore__card-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #9ca3af;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;

  &:hover {
    background: #f3f4f6;
    color: #374151;
  }

  & svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
  }
}

/* ── Map ─────────────────────────────────────────────── */

.map-explore__map {
  flex: 1;
  min-width: 0;
}

/* ── Markers ─────────────────────────────────────────── */

.map-explore__marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff2800;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.map-explore__marker--hover,
.map-explore__marker--active {
  transform: scale(1.6);
  background: #c42000;
}

/* Popup */
.map-explore__popup .mapboxgl-popup-content {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

.map-explore__popup .mapboxgl-popup-tip {
  border-top-color: #fff;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
  .map-explore {
    flex-direction: column-reverse;
  }

  .map-explore__sidebar {
    width: 100%;
    height: 50%;
    padding-top: 0;
    border-right: none;
    border-top: 1px solid #e5e7eb;
  }

  .map-explore__map {
    flex: 1;
    padding-top: 74px;
  }
}
