/* ---- MAP PAGE OVERRIDES ---- */
  html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }

  .map-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }

  /* ---- HEADER OVERRIDES ---- */
  .map-header-inner {
    width: 100%;
    padding: 0 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;   /* required so mobile-nav-drawer positions under header */
  }

  /* Logo block — left */
  .header-logo-block {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
  }

  .header-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gold-400);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(192,154,48,0.35);
  }

  .header-logo-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .header-logo-text span {
    color: var(--gold-400);
  }

  /* Below the header: sidebar + map side by side */
  .map-body {
    display: flex;
    flex: 1;
    overflow: hidden;
  }

  /* LEFT SIDEBAR */
  .spot-sidebar {
    width: 340px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--ink-100);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .sidebar-header {
    padding: 1.2rem 1.4rem 0.9rem;
    border-bottom: 1px solid var(--ink-100);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold-50) 0%, var(--surface) 100%);
    border-left: 3px solid var(--gold-400);
  }

  .sidebar-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.02em;
  }

  .sidebar-header p {
    font-size: 11px;
    color: var(--ink-300);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    margin-bottom: 0.75rem;
  }

  /* SEARCH BAR */
  .sidebar-search-wrap {
    position: relative;
    margin-bottom: 0.7rem;
  }

  .sidebar-search {
    width: 100%;
    font-size: 13px;
    padding: 8px 12px 8px 34px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--ink-100);
    background: var(--surface);
    color: var(--ink-900);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
  }

  .sidebar-search::placeholder { color: var(--ink-300); }
  .sidebar-search:focus {
    border-color: var(--gold-300);
    box-shadow: 0 0 0 3px rgba(193,154,48,0.13);
  }

  .sidebar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    pointer-events: none;
    color: var(--ink-300);
  }

  /* CATEGORY FILTER PILLS */
  .sidebar-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .sidebar-filters::-webkit-scrollbar { display: none; }

  .filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--ink-100);
    background: var(--surface);
    color: var(--ink-500);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
  }

  .filter-pill:hover {
    border-color: var(--gold-300);
    color: var(--ink-900);
    background: var(--gold-50);
  }

  .filter-pill.active {
    background: var(--gold-400);
    border-color: var(--gold-400);
    color: var(--ink-900);
    font-weight: 600;
  }

  .spot-list {
    overflow-y: auto;
    flex: 1;
  }

  .spot-list::-webkit-scrollbar { width: 4px; }
  .spot-list::-webkit-scrollbar-track { background: transparent; }
  .spot-list::-webkit-scrollbar-thumb { background: var(--ink-100); border-radius: 4px; }

  .spot-item {
    display: flex;
    gap: 12px;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--ink-100);
    cursor: pointer;
    transition: background var(--transition);
    text-decoration: none;
  }

  .spot-item:hover {
    background: var(--surface-2);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(100, 80, 20, 0.10);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  }

  .spot-item.active {
    background: var(--gold-100);
    border-left: 3px solid var(--gold-400);
    padding-left: calc(1.4rem - 3px);
  }

  .spot-item.hidden { display: none; }

  .spot-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-3);
  }

  .spot-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--surface-3);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
  }

  .spot-info { flex: 1; min-width: 0; }

  .spot-name {
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .spot-desc {
    font-size: 12px;
    color: var(--ink-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .spot-category-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 999px;
    margin-bottom: 4px;
    background: var(--gold-100);
    color: var(--gold-600);
    border: 1px solid var(--gold-200);
    text-transform: uppercase;
  }

  /* Empty search state */
  .sidebar-empty {
    padding: 2rem 1.4rem;
    text-align: center;
    color: var(--ink-300);
    font-size: 13px;
    display: none;
  }

  /* DETAIL PANEL */
  .spot-detail {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(253, 252, 247, 0.98);
    backdrop-filter: blur(12px);
    border-top: 2px solid var(--gold-200);
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 -6px 32px rgba(100,80,20,0.14);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 500;
  }

  .spot-detail.visible {
    transform: translateY(0);
  }

  .spot-detail-img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
  }

  .spot-detail-img-placeholder {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
  }

  .spot-detail-info { flex: 1; min-width: 0; }

  .spot-detail-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
  }

  .spot-detail-desc {
    font-size: 15px;
    color: var(--ink-500);
    line-height: 1.6;
  }

  .spot-detail-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: var(--surface-2);
    border: 1.5px solid var(--ink-100);
    color: var(--ink-400);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
    transform: none;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
  }
  .spot-detail-close:hover {
    background: var(--surface-3);
    color: var(--ink-900);
    transform: none;
    box-shadow: none;
  }

  .spot-detail-meta {
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-600);
    line-height: 1.6;
  }

  .spot-detail-meta div {
    margin-bottom: 0;
    padding: 5px 0;
    border-bottom: 1px solid var(--ink-100);
    display: flex;
    align-items: flex-start;
    gap: 6px;
  }

  .spot-detail-meta div:last-child {
    border-bottom: none;
  }

  .meta-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-300);
    flex-shrink: 0;
    min-width: 64px;
    padding-top: 1px;
  }

  /* RIGHT MAP */
  .map-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
  }

  #map {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Leaflet popup tweak for this layout */
  .leaflet-popup-content button {
    margin-top: 8px;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* =============================================
     MOBILE — Map fills screen, sidebar becomes
     a bottom drawer that slides up on demand
     ============================================= */

  @media (max-width: 768px) {
    /* Kill body scroll — map page is fullscreen */
    html, body { overflow: hidden; height: 100%; }

    /* Map body: stack children, map takes all space */
    .map-body {
      flex-direction: column;
      position: relative;
    }

    /* Map fills all remaining space */
    .map-wrap {
      flex: 1;
      height: 100%;
      min-height: 0;
    }

    /* ── SIDEBAR becomes a bottom drawer ── */
    .spot-sidebar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      width: 100%;
      height: 72px;          /* collapsed: just the handle bar */
      max-height: 80vh;      /* expanded: up to 80% of screen */
      border-right: none;
      border-top: 1.5px solid var(--gold-200);
      border-radius: 18px 18px 0 0;
      box-shadow: 0 -6px 32px rgba(100, 80, 20, 0.14);
      z-index: 600;
      overflow: hidden;
      transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      background: var(--surface);
      flex-direction: column;
    }

    /* Expanded state — toggled by JS */
    .spot-sidebar.drawer-open {
      height: 78vh;
    }

    /* ── Drag handle at the top of the drawer ── */
    .drawer-handle {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 10px 0 6px;
      cursor: pointer;
      flex-shrink: 0;
      user-select: none;
      -webkit-user-select: none;
    }

    .drawer-handle-bar {
      width: 36px;
      height: 4px;
      border-radius: 999px;
      background: var(--ink-100);
    }

    .drawer-handle-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--ink-300);
      line-height: 1;
    }

    /* Push sidebar header below the handle */
    .sidebar-header {
      flex-shrink: 0;
      overflow: hidden;
    }

    /* Sidebar locate button — always visible inside the drawer */
    .sidebar-locate-btn {
      display: flex;
    }

    /* Spot list scrolls inside drawer */
    .spot-list {
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    /* ── Header: compact on mobile ── */
    .map-header-inner {
      padding: 0 0.9rem;
      gap: 0.5rem;
    }

    /* ── Floating locate button on the map (mirrors sidebar btn on mobile) ── */
    .mobile-locate-fab {
      position: fixed;
      bottom: 84px;
      right: 14px;
      z-index: 610;
      background: rgba(253,252,247,0.96);
      border: 1.5px solid var(--ink-100);
      border-radius: 999px;
      box-shadow: 0 3px 12px rgba(100,80,20,0.18);
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      font-size: 12px;
      font-weight: 600;
      color: var(--ink-700);
      cursor: pointer;
      backdrop-filter: blur(8px);
      transition: all var(--transition);
      white-space: nowrap;
    }

    .mobile-locate-fab.locating  { opacity: 0.6; }
    .mobile-locate-fab.located   { background: var(--gold-100); border-color: var(--gold-300); color: var(--gold-700); }

    /* ── Spot detail panel: full-width on mobile ── */
    .spot-detail {
      left: 0;
      right: 0;
      padding: 1rem 1.1rem 1.2rem;
      gap: 0.9rem;
      flex-wrap: wrap;
      z-index: 620; /* above drawer */
    }

    .spot-detail-img,
    .spot-detail-img-placeholder {
      width: 64px;
      height: 64px;
    }

    .spot-detail-name { font-size: 0.95rem; }
    .spot-detail-desc { font-size: 13px; }
    .spot-detail-meta { font-size: 12px; }

    .detail-btn-group {
      flex-direction: row;
      width: 100%;
      gap: 8px;
    }

    .detail-action-btn {
      flex: 1;
      min-width: 0;
      font-size: 13px;
      padding: 10px 12px;
    }
  }

  /* ── Extra small phones (≤ 400px) ── */
  @media (max-width: 400px) {
    .header-logo-text { font-size: 0.9rem; }
    .header-logo-icon { width: 30px; height: 30px; font-size: 15px; }

    .spot-detail {
      padding: 0.8rem 0.9rem 1rem;
    }

    .detail-action-btn {
      font-size: 12px;
      padding: 9px 10px;
    }
  }

/* ---- DETAIL PANEL ACTION BUTTONS ---- */
.detail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: all var(--transition);
  border: 2px solid transparent;
  min-width: 130px;
}

.detail-action-btn.btn-book {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--ink-900);
}
.detail-action-btn.btn-book:hover {
  background: var(--gold-500);
  border-color: var(--gold-500);
}

.detail-action-btn.btn-maps {
  background: var(--surface-2);
  border-color: var(--ink-100);
  color: var(--ink-700);
}
.detail-action-btn.btn-maps:hover {
  background: rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.35);
  color: #2563EB;
}

.detail-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

  /* ── Desktop: hide mobile-only elements ── */
  .drawer-handle        { display: none; }
  .mobile-locate-fab    { display: none; }

  /* ---- DETAIL IMAGE PLACEHOLDER (no emoji) ---- */
.spot-detail-img-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1.5px solid var(--ink-100);
}

.spot-detail-img-placeholder svg {
  width: 36px;
  height: 36px;
  color: var(--ink-200);
}

/* ---- SIDEBAR THUMB PLACEHOLDER (no emoji) ---- */
.spot-thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--ink-100);
}

.spot-thumb-placeholder svg {
  width: 28px;
  height: 28px;
  color: var(--ink-200);
}

/* ---- DIRECTIONS LINK IN ACCESS ---- */
.directions-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.18);
  margin-left: 6px;
  transition: all var(--transition);
}

.directions-link:hover {
  background: rgba(37,99,235,0.15);
  color: #1d4ed8;
}

/* Access row layout */
#accessRow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.5;
}

#detailAccess {
  flex: 1;
  min-width: 0;
}

#detailAccess ol {
  margin: 4px 0 0 14px;
}

/* ---- LOCATE DOT (shared) ---- */
.locate-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2563EB;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
  transition: background var(--transition);
}
/* ================================================================
   ENHANCEMENT PACK
   ================================================================ */

/* ---- 1. Expanded picture in detail panel ---- */
.spot-detail {
  /* allow the image to breathe more */
  align-items: flex-start;
}

.spot-detail-img-wrap {
  flex-shrink: 0;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(100,80,20,0.18);
  width: 189px;
  height: 200px;
}

.spot-detail-img {
  width: 189px;
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.spot-detail-img-placeholder {
  width: 189px;
  height: 200px;
  border-radius: var(--radius-md);
}

/* Category ribbon over image */
.detail-img-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.88);
  color: var(--ink-700);
  pointer-events: none;
}

@media (max-width: 768px) {
  .spot-detail-img-wrap,
  .spot-detail-img,
  .spot-detail-img-placeholder {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 400px) {
  .spot-detail-img-wrap,
  .spot-detail-img,
  .spot-detail-img-placeholder {
    width: 100px;
    height: 100px;
  }
}

/* ---- 2. Category badge differentiation ---- */
.spot-category-badge[data-cat="waterfall"] {
  background: #EBF4FF; color: #1D6FA4; border-color: #B3D7F0;
}
.spot-category-badge[data-cat="forest"] {
  background: #EDFBF0; color: #276237; border-color: #A3D9AE;
}
.spot-category-badge[data-cat="river"] {
  background: #E8F8F8; color: #1D6E72; border-color: #9DD8DA;
}
.spot-category-badge[data-cat="beach"] {
  background: #FFF6E5; color: #8C5A00; border-color: #F5C97A;
}
.spot-category-badge[data-cat="mountain"] {
  background: #F2EEF9; color: #5C3A9B; border-color: #C8B4E8;
}
.spot-category-badge[data-cat="heritage"] {
  background: #FBF0E6; color: #7A3B0F; border-color: #F0C097;
}

/* ---- 3. Filter pill count badges ---- */
.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  background: var(--ink-100);
  color: var(--ink-500);
  transition: all var(--transition);
}

.filter-pill.active .pill-count {
  background: rgba(28,26,20,0.2);
  color: var(--ink-900);
}

/* ---- 4. Welcome hint tooltip ---- */
.map-hint {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 490;
  background: rgba(253,252,247,0.97);
  border: 1.5px solid var(--gold-200);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  box-shadow: 0 3px 14px rgba(100,80,20,0.15);
  backdrop-filter: blur(10px);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  animation: hintFadeOut 4s forwards;
}

@keyframes hintFadeOut {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); pointer-events: none; }
}

/* ---- 5. Book button pulse on panel open ---- */
@keyframes bookPulse {
  0%   { box-shadow: 0 0 0 0 rgba(192,154,48,0.5); }
  60%  { box-shadow: 0 0 0 10px rgba(192,154,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(192,154,48,0); }
}

.detail-action-btn.btn-book.pulse-once {
  animation: bookPulse 0.7s ease-out 0.25s 1;
}
/* ---- DETAIL IMAGE PLACEHOLDER INNER (with label) ---- */
.detail-img-placeholder-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border-radius: var(--radius-md);
}

.detail-img-placeholder-inner svg {
  width: 42px;
  height: 42px;
  color: var(--ink-200);
}

.detail-img-placeholder-inner span {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-300);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- DETAIL BUTTON GROUP: push away from close button on desktop ---- */
@media (min-width: 769px) {
  .detail-btn-group {
    margin-right: 44px;
  }
}

/* min-height handled by explicit width/height on img-wrap */