/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sage: #6B8F71;
  --sage-light: #E8F0E9;
  --terracotta: #C2714F;
  --terracotta-light: #F5E6DF;
  --warm-gray: #8B8680;
  --warm-gray-light: #F0EDEA;
  --gold: #D4A843;
  --cream: #FDFBF7;
  --white: #FFFFFF;
  --text: #2D2926;
  --text-muted: #7A746E;
  --border: #E8E4DF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;
  --font-serif: 'DM Serif Display', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --topbar-h: 64px;
}
html, body { height: 100%; font-family: var(--font-sans); color: var(--text); background: var(--cream); }

/* ========== TOPBAR ========== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--topbar-h); background: var(--white);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}
.topbar-logo {
  font-family: var(--font-serif); font-size: 22px; color: var(--text);
  white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.topbar-logo span { letter-spacing: -0.3px; }
.topbar-search {
  flex: 1; max-width: 480px; position: relative;
}
.topbar-search input {
  width: 100%; height: 42px; border: none; border-radius: var(--radius-pill);
  background: var(--warm-gray-light); padding: 0 16px 0 42px;
  font-family: var(--font-sans); font-size: 14px; color: var(--text);
  outline: none; transition: box-shadow 0.2s, background 0.2s;
}
.topbar-search input:focus { background: var(--white); box-shadow: 0 0 0 2px var(--sage); }
.topbar-search input::placeholder { color: var(--text-muted); }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.search-results {
  position: absolute; top: 50px; left: 0; right: 0; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none;
  max-height: 320px; overflow-y: auto; z-index: 10;
}
.search-results.active { display: block; }
.search-result-item {
  padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--cream); }
.search-result-item .emoji { font-size: 20px; }
.search-result-item .info { flex: 1; }
.search-result-item .info .name { font-weight: 500; font-size: 14px; }
.search-result-item .info .loc { font-size: 12px; color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 1; min-width: 0; }
.btn-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--white);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-pill:hover { border-color: var(--text); background: var(--cream); }
.btn-pill.active { border-color: var(--sage); background: var(--sage-light); color: var(--sage); }
.btn-icon {
  display: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--white);
  align-items: center; justify-content: center; cursor: pointer; color: var(--text);
}

/* ========== FILTER PANEL ========== */
.filter-panel {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 900;
  background: var(--white); padding: 20px 24px 16px;
  box-shadow: var(--shadow-md); border-bottom: 1px solid var(--border);
  transform: translateY(-100%); opacity: 0; pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.filter-panel.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.filter-section { margin-bottom: 14px; }
.filter-section h3 {
  font-family: var(--font-sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 8px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--warm-gray-light); border: 1.5px solid transparent;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s;
  color: var(--text);
}
.filter-chip:hover { border-color: var(--warm-gray); }
.filter-chip.active-country { background: var(--sage-light); border-color: var(--sage); color: var(--sage); }
.filter-chip.active-type { background: var(--terracotta-light); border-color: var(--terracotta); color: var(--terracotta); }
.filter-chip.active-condition { background: var(--warm-gray-light); border-color: var(--warm-gray); color: var(--text); }
.filter-counter { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ========== MAP ========== */
#map {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  z-index: 1;
}
.leaflet-control-attribution { font-size: 10px !important; }

/* Map Pins */
.map-pin {
  width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden; cursor: pointer; transition: transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.map-pin:hover { transform: scale(1.2); }
.map-pin img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.pin-emoji { font-size: 22px; line-height: 1; }
/* pin images handled by .map-pin img rule above */
.map-pin-castle { border: 3px solid #E05A33; }
.map-pin-palace { border: 3px solid #E6A817; }
.map-pin-abbey { border: 3px solid #2E8B57; }
.map-pin-tower { border: 3px solid #4A7FC1; }
.map-pin-fortified { border: 3px solid #8B5CF6; }

/* Map Legend */
.map-legend {
  position: absolute; bottom: 40px; left: 12px; z-index: 800;
  background: white; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  font-family: 'Inter', sans-serif; min-width: 160px;
}
.legend-title { font-weight: 600; font-size: 13px; color: #2D2926; margin-bottom: 8px; }
.legend-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  cursor: pointer; border-radius: 6px; transition: opacity 0.2s; font-size: 13px;
}
.legend-item:hover { background: #F0EDEA; }
.legend-check {
  width: 18px; height: 18px; border-radius: 4px; border: 2px solid #ccc;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: transparent; flex-shrink: 0;
  transition: all 0.2s;
}
.legend-item.active .legend-check { background: var(--sage); border-color: var(--sage); color: #fff; }
.legend-item:not(.active) { opacity: 0.5; }
.legend-item:not(.active) .legend-label { text-decoration: line-through; }
.legend-color { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(0,0,0,0.08); }
.legend-label { color: #2D2926; flex: 1; }
.legend-count { color: #7A746E; font-size: 11px; }

/* Cluster */
.cluster-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); border: 3px solid var(--sage);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-weight: 700; font-size: 14px;
  color: var(--sage); box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.cluster-icon-lg { width: 52px; height: 52px; font-size: 16px; border-color: var(--terracotta); color: var(--terracotta); }

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: 420px;
  background: var(--white); z-index: 800; overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  transform: translateX(100%); transition: transform 0.3s ease;
}
.sidebar.active { transform: translateX(0); }
.sidebar-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: 1px solid var(--border);
  font-size: 16px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background 0.2s; backdrop-filter: blur(8px);
}
.sidebar-close:hover { background: var(--cream); }
.sidebar-image {
  width: 100%; height: 320px; background: linear-gradient(135deg, #E8DDD3, #D4C5B5);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; overflow: hidden;
}
.sidebar-image img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.banner-gallery {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; height: 100%; width: 100%;
  scrollbar-width: none;
}
.banner-gallery::-webkit-scrollbar { display: none; }
.banner-gallery img {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover;
  scroll-snap-align: start; cursor: pointer;
}
.banner-counter {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(0,0,0,0.55); color: #fff; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
}
.sidebar-image { position: relative; }
.sidebar-content { padding: 24px; }
.sidebar-name {
  font-family: var(--font-serif); font-size: 28px; color: var(--text);
  line-height: 1.2; margin-bottom: 6px;
}
.sidebar-location { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; }
.sidebar-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.badge {
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
}
.badge-type { background: var(--terracotta-light); color: var(--terracotta); }
.badge-era { background: var(--sage-light); color: var(--sage); }
.badge-condition { background: var(--warm-gray-light); color: var(--warm-gray); }
.sidebar-rating {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 14px;
}
.stars { color: var(--gold); letter-spacing: 1px; }
.rating-num { font-weight: 600; }
.review-count { color: var(--text-muted); }
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag-pill {
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500; background: var(--cream); border: 1px solid var(--border);
  color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px;
}
.sidebar-access { font-size: 13px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.access-badge {
  padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600;
}
.access-free { background: #E8F5E9; color: #2E7D32; }
.access-paid { background: #FFF3E0; color: #E65100; }
.access-private { background: #F3E5F5; color: #7B1FA2; }
.access-exterior { background: #E3F2FD; color: #1565C0; }
.sidebar-nearby { margin-bottom: 20px; }
.sidebar-nearby h3 { font-family: var(--font-sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.nearby-card {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.2s; border-bottom: 1px solid var(--border);
}
.nearby-card:hover { background: var(--cream); }
.nearby-card:last-child { border-bottom: none; }
.nearby-img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.nearby-info { flex: 1; min-width: 0; }
.nearby-name { font-size: 13px; font-weight: 500; }
.nearby-meta { font-size: 11px; color: var(--text-muted); }
.sidebar-desc { font-size: 15px; line-height: 1.7; color: #4A4540; margin-bottom: 16px; }
.sidebar-history { margin-bottom: 20px; }
.history-title { font-family: var(--font-sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 8px; }
.history-text { font-size: 14px; line-height: 1.7; color: #4A4540; }
.history-toggle { display: inline; }
.sidebar-google { margin-bottom: 16px; }
.google-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.google-rating img { height: 14px; }
.sidebar-photos { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.sidebar-photos img {
  width: 120px; min-width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm);
  cursor: pointer; transition: transform 0.2s; flex-shrink: 0;
}
.sidebar-photos img:hover { transform: scale(1.05); }
.sidebar-hours { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
.sidebar-hours strong { color: var(--text); }
.sidebar-actions { display: flex; gap: 10px; margin-bottom: 8px; }
.btn-add-route {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: var(--radius); border: 2px solid var(--sage);
  background: var(--white); color: var(--sage); cursor: pointer;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  transition: all 0.2s;
}
.btn-add-route:hover { background: var(--sage); color: var(--white); }
.btn-directions {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; border-radius: var(--radius);
  background: var(--sage); color: var(--white); text-decoration: none;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  transition: background 0.2s;
}
.btn-directions:hover { background: #5A7E60; }
.sidebar-footer { padding: 20px 0 8px; text-align: center; }
.sidebar-footer small { color: var(--text-muted); font-size: 11px; }

/* ========== ROUTE PANEL ========== */
.route-panel {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 400px;
  background: var(--white); z-index: 800; overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.route-panel.active { transform: translateX(0); }
.route-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.route-header h2 { font-family: var(--font-serif); font-size: 22px; }
.route-form { padding: 20px 24px; }
.route-field { margin-bottom: 14px; }
.route-field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 6px; }
.route-field input {
  width: 100%; height: 44px; border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 0 14px; font-family: var(--font-sans); font-size: 14px; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.route-field input:focus { border-color: var(--sage); }
.btn-find-routes {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius);
  background: var(--terracotta); color: var(--white);
  font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-find-routes:hover { background: #A85E3F; }
.btn-find-routes:disabled { opacity: 0.6; cursor: not-allowed; }
.route-results { padding: 0 24px 24px; }
.route-card {
  background: var(--cream); border-radius: var(--radius); padding: 18px;
  margin-bottom: 12px; animation: fadeIn 0.3s ease;
}
.route-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.route-card-header .emoji { font-size: 20px; }
.route-card-header .title { font-family: var(--font-serif); font-size: 18px; }
.route-card-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.route-card-meta strong { color: var(--text); }
.route-castle-list { list-style: none; margin-bottom: 12px; }
.route-castle-list li {
  padding: 6px 0; font-size: 13px; display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border);
}
.route-castle-list li:last-child { border-bottom: none; }
.route-castle-list .castle-rating { margin-left: auto; color: var(--gold); font-size: 12px; }
.btn-show-route {
  width: 100%; padding: 10px; border: 1.5px solid var(--sage); border-radius: var(--radius);
  background: transparent; color: var(--sage); font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-show-route:hover { background: var(--sage-light); }
.route-card-actions { display: flex; gap: 8px; }
.route-card-actions .btn-show-route, .route-card-actions .btn-save-route { flex: 1; width: auto; }
.btn-save-route {
  padding: 10px; border: 1.5px solid var(--terracotta); border-radius: var(--radius);
  background: transparent; color: var(--terracotta); font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-save-route:hover { background: var(--terracotta-light); }
.route-castle-link { color: var(--text); text-decoration: none; cursor: pointer; }
.route-castle-link:hover { color: var(--sage); text-decoration: underline; }

/* Overlay backdrop */
.overlay-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 700;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.overlay-backdrop.active { opacity: 1; pointer-events: auto; }

/* Loading spinner */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.loading::after {
  content: ''; display: block; width: 28px; height: 28px; margin: 12px auto 0;
  border: 3px solid var(--border); border-top-color: var(--sage);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .btn-pill { padding: 8px 12px; font-size: 12px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-actions { gap: 6px; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .topbar-search { display: none; }
  .topbar-search.mobile-active { display: block; position: fixed; top: var(--topbar-h); left: 0; right: 0; padding: 12px; background: var(--white); z-index: 1001; box-shadow: var(--shadow-md); }
  .topbar-search.mobile-active input { max-width: none; }
  .btn-pill { padding: 6px 10px; font-size: 11px; }
  .btn-icon { display: flex; }
  .mobile-search-toggle { display: flex; }

  .sidebar {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%;
    height: 75vh; border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .sidebar.active { transform: translateY(0); }
  .sidebar-image { height: 250px; }

  .route-panel { width: 100%; }
  .filter-panel { padding: 16px; }
  .map-legend { bottom: 20px; left: 8px; padding: 8px 10px; min-width: 140px; font-size: 12px; }
}

@media (max-width: 480px) {
  .topbar-logo span { display: none; }
  .sidebar { height: 85vh; }
}

/* Reviews */
.sidebar-reviews { margin-top: 16px; }
.reviews-title { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--text); margin-bottom: 8px; }
.reviews-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.reviews-summary .stars { color: var(--gold); font-size: 14px; }
.reviews-summary .rating-num { font-weight: 600; font-size: 14px; color: var(--text); }
.reviews-summary .review-count { font-size: 13px; color: var(--text-muted); }
.review-card { background: var(--cream); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-author { font-size: 13px; color: var(--text); }
.review-time { font-size: 11px; color: var(--text-muted); }
.review-stars { font-size: 12px; color: var(--gold); margin-bottom: 6px; }
.review-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.review-expand {
  background: none; border: none; color: var(--sage); cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 0; margin-left: 4px;
}
.reviews-link { display: inline-block; margin-top: 8px; margin-bottom: 16px; color: var(--sage); font-weight: 500; font-size: 13px; text-decoration: none; }
.reviews-link:hover { text-decoration: underline; }

/* YouTube Videos */
.sidebar-videos { margin-top: 16px; }
.videos-title { font-family: 'DM Serif Display', serif; font-size: 18px; color: var(--text); margin-bottom: 10px; }
.video-card { margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; background: var(--cream); border: 1px solid var(--border); cursor: pointer; transition: box-shadow 0.2s; }
.video-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.video-thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.video-thumb-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb-wrap .play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; background: rgba(0,0,0,0.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.video-thumb-wrap .play-overlay svg { fill: #fff; width: 22px; height: 22px; margin-left: 3px; }
.video-info { padding: 8px 10px; }
.video-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-channel { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.video-embed-wrap { position: relative; width: 100%; padding-top: 56.25%; margin-bottom: 12px; border-radius: var(--radius-sm); overflow: hidden; }
.video-embed-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.videos-more { display: inline-block; margin-top: 4px; margin-bottom: 16px; color: var(--sage); font-weight: 500; font-size: 13px; text-decoration: none; }
.videos-more:hover { text-decoration: underline; }

/* Photo gallery clickable */
.sidebar-photos img { cursor: pointer; transition: opacity 0.2s; }
.sidebar-photos img:hover { opacity: 0.8; }

/* Lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.9); z-index: 10000; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 92vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: #fff; font-size: 32px; cursor: pointer; z-index: 10001; background: none; border: none; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; font-size: 48px; width: 56px; height: 80px; cursor: pointer; z-index: 10001; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: background 0.2s; -webkit-tap-highlight-color: transparent; }
.lightbox-nav:hover { background: rgba(0,0,0,0.75); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; font-family: Inter, sans-serif; background: rgba(0,0,0,0.5); padding: 4px 14px; border-radius: 20px; z-index: 10001; }
@media (max-width: 768px) { .lightbox-nav { width: 44px; height: 64px; font-size: 36px; } .lightbox-prev { left: 6px; } .lightbox-next { right: 6px; } }

/* ========== BOOKMARKS ========== */
.sidebar-name-row { display: flex; flex-direction: column; gap: 8px; }
.sidebar-name-row .sidebar-name { flex: 1; }
.sidebar-quick-actions { display: flex; gap: 8px; }
.sidebar-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--white);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; transition: all 0.2s;
}
.sidebar-action-btn:hover { border-color: var(--sage); background: var(--sage-light); }
.sidebar-action-btn .action-icon { font-size: 16px; }
.sidebar-action-btn .action-label { white-space: nowrap; }
.sidebar-action-btn.bookmarked { background: #FFF8E7; border-color: var(--gold); color: var(--gold); }
.route-add-btn:hover { opacity: 0.8; border-color: var(--sage); }
.qv-route-add { font-size: 16px; }

.bookmarks-panel {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 400px;
  background: var(--white); z-index: 800; overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  transform: translateX(-100%); transition: transform 0.3s ease;
}
.bookmarks-panel.active { transform: translateX(0); }
.bookmarks-count { padding: 0 24px 12px; font-size: 13px; color: var(--text-muted); }
.bookmarks-list { padding: 0 24px; }
.bookmarks-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.bookmark-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--cream); border-radius: var(--radius); margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}
.bookmark-card .emoji { font-size: 20px; }
.bookmark-card .info { flex: 1; }
.bookmark-card .info .name { font-weight: 500; font-size: 14px; }
.bookmark-card .info .loc { font-size: 12px; color: var(--text-muted); }
.bookmark-card .info .rating { font-size: 12px; color: var(--gold); }
.bookmark-card .remove-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted); font-size: 14px;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center;
  justify-content: center;
}
.bookmark-card .remove-btn:hover { background: var(--terracotta-light); color: var(--terracotta); }
.bookmarks-actions { padding: 16px 24px; }
.btn-clear-bookmarks {
  width: 100%; padding: 10px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text-muted); font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-clear-bookmarks:hover { border-color: var(--terracotta); color: var(--terracotta); }
.bookmarks-route-form { padding: 0 24px 16px; }

/* Bookmark indicator on map pins */
.map-pin-bookmarked::after {
  content: '★'; position: absolute; top: -4px; right: -4px;
  font-size: 10px; color: var(--gold); background: var(--white);
  border-radius: 50%; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2); line-height: 1;
}
.map-pin { position: relative; }

@media (max-width: 768px) {
  .bookmarks-panel { width: 100%; }
}

/* ========== QUICK VIEW (MOBILE) ========== */
.quick-view {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 750;
  background: var(--white); border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  transform: translateY(100%); transition: transform 0.3s ease;
  max-height: 300px; overflow: hidden;
  display: none; /* hidden on desktop */
}
.quick-view.active { transform: translateY(0); }
.quick-view-image {
  width: 100%; height: 120px; background: linear-gradient(135deg, #E8DDD3, #D4C5B5);
  background-size: cover; background-position: center;
}
.quick-view-content { padding: 12px 16px 16px; }
.quick-view-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.quick-view-header h3 { flex: 1; font-family: var(--font-serif); font-size: 18px; color: var(--text); margin: 0; }
.qv-bookmark {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border);
  background: var(--white); font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; opacity: 0.5; transition: all 0.2s;
}
.qv-bookmark:hover, .qv-bookmark.bookmarked { opacity: 1; background: #FFF8E7; border-color: var(--gold); }
.quick-view-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.quick-view-badges .badge { font-size: 11px; padding: 2px 8px; }
.quick-view-rating { font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.quick-view-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qv-details-btn {
  width: 100%; padding: 10px; border: none; border-radius: var(--radius);
  background: var(--sage); color: var(--white); font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.qv-details-btn:hover { background: #5A7E60; }
.qv-close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(255,255,255,0.9); border: 1px solid var(--border);
  font-size: 14px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; backdrop-filter: blur(8px); z-index: 2;
}

@media (max-width: 767px) {
  .quick-view { display: block; }
}

/* ========== ROUTE BUILDER ========== */
/* Route Builder Floating Panel */
.rb-float {
  position: absolute; left: 12px; width: 280px;
  background: var(--white); z-index: 801; border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  display: none; flex-direction: column;
  max-height: calc(100vh - 140px);
  font-family: var(--font-sans);
  animation: rbSlideUp 0.3s ease;
}
.rb-float.active { display: flex; }
.rb-float.minimized .rb-float-body { display: none; }
.rb-float-header {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer;
  border-radius: 16px 16px 0 0; background: var(--cream);
  user-select: none;
}
.rb-float.minimized .rb-float-header { border-bottom: none; border-radius: 16px; }
.rb-float-title { font-weight: 600; font-size: 14px; flex: 1; }
.rb-float-actions { display: flex; gap: 4px; }
.rb-float-toggle, .rb-float-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; font-size: 16px;
  color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; transition: all 0.2s;
}
.rb-float-toggle:hover, .rb-float-close:hover { background: var(--border); }
.rb-float-body {
  padding: 12px 16px 16px; overflow-y: auto; max-height: 50vh;
}
.rb-float-body .route-field { margin-bottom: 10px; }
.rb-float-body .route-field label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 4px; display: block;
}
.rb-float-body .route-field input {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 13px;
  transition: border-color 0.2s; box-sizing: border-box;
}
.rb-float-body .route-field input:focus { outline: none; border-color: var(--sage); }
.rb-generate-btn {
  width: 100%; padding: 12px; border: none; border-radius: var(--radius);
  background: var(--sage); color: var(--white); font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s;
  margin-top: 4px;
}
.rb-generate-btn:hover { background: #5A7E60; }
.rb-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rb-empty-msg {
  text-align: center; padding: 16px 8px; color: var(--text-muted);
  font-size: 13px; font-style: italic;
}
.rb-route-results { margin-top: 12px; }
.rb-start-nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: var(--radius);
  background: #4285F4; color: #fff !important; text-decoration: none;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  margin-top: 10px; transition: background 0.2s;
}
.rb-start-nav-btn:hover { background: #3367D6; color: #fff !important; }
.rb-start-nav-btn:visited { color: #fff !important; }
.rb-start-nav-btn svg { stroke: #fff; }
/* Route Summary */
.rb-route-summary { padding: 0; }
.rb-summary-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.rb-summary-header .emoji { font-size: 24px; }
.rb-summary-name { font-weight: 700; font-size: 16px; color: var(--text); }
.rb-summary-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.rb-leg-list { margin-bottom: 12px; }
.rb-leg-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid #f2f0ed;
}
.rb-leg-item:last-child { border-bottom: none; }
.rb-leg-color {
  width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0;
}
.rb-leg-info { flex: 1; min-width: 0; }
.rb-leg-label { font-size: 13px; font-weight: 500; color: var(--text); }
.rb-leg-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.rb-edit-btn {
  width: 100%; padding: 10px; border: 2px solid var(--sage); border-radius: var(--radius);
  background: var(--white); color: var(--sage); font-family: var(--font-sans);
  font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 6px; transition: all 0.2s;
}
.rb-edit-btn:hover { background: var(--sage); color: var(--white); }
.rb-show-all-btn {
  width: 100%; padding: 8px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--white); color: var(--text-muted); font-family: var(--font-sans);
  font-size: 12px; cursor: pointer; margin-top: 6px; transition: all 0.2s;
}
.rb-show-all-btn:hover { border-color: var(--sage); color: var(--sage); }
@keyframes rbSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.rb-stops-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.rb-stops-header label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
}
.rb-stop-count {
  font-size: 12px; font-weight: 600; color: var(--sage);
  background: var(--sage-light); padding: 2px 10px; border-radius: var(--radius-pill);
}
.rb-stops-list {
  min-height: 60px; margin-bottom: 16px;
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 4px; transition: border-color 0.2s;
}
.rb-stops-list.has-stops { border-style: solid; }
.rb-stop-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--cream); border-radius: var(--radius-sm); margin-bottom: 4px;
  cursor: grab; animation: fadeIn 0.3s ease; user-select: none;
}
.rb-stop-card:last-child { margin-bottom: 0; }
.rb-stop-card.dragging { opacity: 0.5; }
.rb-stop-card .drag-handle {
  color: var(--text-muted); font-size: 14px; cursor: grab; flex-shrink: 0;
  display: flex; align-items: center;
}
.rb-stop-card .emoji { font-size: 18px; flex-shrink: 0; }
.rb-stop-card .info { flex: 1; min-width: 0; }
.rb-stop-card .info .name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-stop-card .info .loc { font-size: 11px; color: var(--text-muted); }
.rb-stop-card .remove-btn {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-muted); font-size: 13px;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.rb-stop-card .remove-btn:hover { background: var(--terracotta-light); color: var(--terracotta); }
.optional-tag {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--warm-gray); font-size: 11px; font-style: italic;
}

/* Favorites panel checkboxes for route builder */
.bookmark-card-select {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  background: var(--cream); border-radius: var(--radius); margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}
.bookmark-card-select input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--sage); cursor: pointer; flex-shrink: 0;
}
.btn-send-to-builder {
  width: 100%; padding: 12px; border: 2px solid var(--sage); border-radius: var(--radius);
  background: var(--white); color: var(--sage); font-family: var(--font-sans);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.btn-send-to-builder:hover { background: var(--sage); color: var(--white); }

@media (max-width: 768px) {
  .rb-float {
    bottom: 12px; left: 8px; right: auto; width: calc(100% - 16px);
    max-height: 55vh;
  }
  .rb-float-body { max-height: 35vh; }
}

/* Places Autocomplete Dropdown */
.pac-dropdown {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--white); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 10000;
  max-height: 200px; overflow-y: auto; margin-top: 4px;
}
.pac-dropdown-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid #f5f5f5; transition: background 0.15s;
}
.pac-dropdown-item:last-child { border-bottom: none; }
.pac-dropdown-item:hover { background: var(--cream); }
.pac-dropdown-item strong { color: var(--text); }
.pac-dropdown-item small { color: var(--text-muted); font-size: 11px; }

/* Scrollbar */
.sidebar::-webkit-scrollbar, .route-panel::-webkit-scrollbar, .search-results::-webkit-scrollbar, .rb-float-body::-webkit-scrollbar, .bookmarks-panel::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb, .route-panel::-webkit-scrollbar-thumb, .rb-float-body::-webkit-scrollbar-thumb, .bookmarks-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ========== COLLECTIONS ========== */
.collection-card {
  padding: 16px; margin: 8px 24px; border-radius: var(--radius);
  background: var(--cream); border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 12px;
}
.collection-card:hover { border-color: var(--sage); background: var(--sage-light); }
.collection-card .col-emoji { font-size: 28px; flex-shrink: 0; }
.collection-card .col-info { flex: 1; }
.collection-card .col-name { font-weight: 600; font-size: 15px; color: var(--text); }
.collection-card .col-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.collection-card .col-count { font-size: 12px; color: var(--sage); font-weight: 600; background: var(--sage-light); padding: 2px 10px; border-radius: var(--radius-pill); flex-shrink: 0; }
.collection-back { padding: 12px 24px; font-size: 13px; color: var(--sage); cursor: pointer; font-weight: 600; border: none; background: none; font-family: var(--font-sans); }
.collection-back:hover { text-decoration: underline; }
.collection-site {
  display: flex; align-items: center; gap: 10px; padding: 10px 24px;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.collection-site:hover { background: var(--cream); }
.collection-site img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.collection-site .cs-info { flex: 1; min-width: 0; }
.collection-site .cs-name { font-weight: 500; font-size: 14px; }
.collection-site .cs-meta { font-size: 12px; color: var(--text-muted); }

/* ========== NEAR ME ========== */
.near-me-result {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.near-me-result:hover { background: var(--cream); margin: 0 -24px; padding: 10px 24px; }
.near-me-result img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.near-me-result .nm-info { flex: 1; min-width: 0; }
.near-me-result .nm-name { font-weight: 500; font-size: 14px; }
.near-me-result .nm-meta { font-size: 12px; color: var(--text-muted); }

/* ========== MY STUFF TABS ========== */
.my-stuff-tabs { display: flex; padding: 0 24px; gap: 4px; border-bottom: 1px solid var(--border); }
.my-stuff-tab {
  flex: 1; padding: 10px; border: none; background: none;
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.my-stuff-tab.active { color: var(--sage); border-bottom-color: var(--sage); }
.my-stuff-tab:hover { color: var(--text); }

/* ========== RB SUGGEST ========== */
.rb-suggest { margin-bottom: 12px; }
.rb-suggest-toggle {
  width: 100%; padding: 10px 12px; border: 1.5px dashed var(--sage);
  border-radius: var(--radius); background: var(--sage-light);
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--sage); cursor: pointer; transition: all 0.2s;
}
.rb-suggest-toggle:hover { background: var(--sage); color: var(--white); }
.rb-suggest-form { margin-top: 10px; }
.rb-suggest-card {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: var(--cream); border-radius: var(--radius-sm); margin-top: 6px;
}
.rb-suggest-card img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.rb-suggest-card .info { flex: 1; min-width: 0; }
.rb-suggest-card .name { font-size: 13px; font-weight: 500; }
.rb-suggest-card .meta { font-size: 11px; color: var(--text-muted); }
.rb-suggest-card .add-btn {
  padding: 4px 10px; border: 1.5px solid var(--sage); border-radius: var(--radius-pill);
  background: var(--white); color: var(--sage); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.rb-suggest-card .add-btn:hover { background: var(--sage); color: var(--white); }

/* ========== LISTING OVERLAY ========== */
#listingOverlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000; display: none;
  pointer-events: none;
}
#listingOverlay.active { display: block; pointer-events: auto; }

/* Listing Page */
.listing-page {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000; background: var(--white, #fff);
  display: flex; flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
}
.listing-scroll-wrap {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.listing-header-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--white, #fff);
  border-bottom: 1px solid var(--border, #e8e8e8);
}
.listing-back-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border, #e8e8e8);
  background: var(--white, #fff); font-size: 24px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0; padding-bottom: 2px;
}
.listing-header-name {
  flex: 1; font-family: var(--font-serif); font-size: 16px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.listing-header-fav {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border, #e8e8e8);
  background: var(--white, #fff); font-size: 18px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0;
}

/* Slider */
.listing-slider {
  position: relative; width: 100%; height: 50vh; overflow: hidden; background: #111;
}
.listing-slider-track {
  display: flex; height: 100%; transition: transform 0.3s ease;
}
.listing-slide {
  min-width: 100%; height: 100%;
}
.listing-slide img {
  width: 100%; height: 100%; object-fit: cover; cursor: pointer;
}
.listing-slide img[src=""] { display: none; }
.listing-slider-prev, .listing-slider-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.9); border: none;
  font-size: 24px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 5;
}
.listing-slider-prev { left: 12px; }
.listing-slider-next { right: 12px; }
.listing-slider-prev:hover, .listing-slider-next:hover { background: #fff; }
.listing-slider-counter {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(0,0,0,0.6); color: #fff;
  padding: 4px 12px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.listing-type-badge {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Content area */
.listing-content {
  padding: 20px 16px 40px;
}

/* Lightbox */
.listing-lightbox {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000; background: rgba(0,0,0,0.95);
  align-items: center; justify-content: center;
}
.listing-lightbox.active { display: flex; }
.listing-lb-img {
  max-width: 95vw; max-height: 90vh; object-fit: contain;
}
.listing-lb-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  font-size: 24px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.listing-lb-prev, .listing-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  font-size: 28px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.listing-lb-prev { left: 16px; }
.listing-lb-next { right: 16px; }
.listing-lb-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 14px; font-weight: 500;
}

/* Inline map in listing */
.listing-inline-map { width: 100%; height: 250px; border-radius: var(--radius, 12px); overflow: hidden; }
.listing-inline-map iframe { width: 100%; height: 100%; border: none; }

.listing-name { font-family: var(--font-serif, 'DM Serif Display', Georgia, serif); font-size: 24px; line-height: 1.2; margin-bottom: 4px; color: var(--text, #1a1a1a); }
.listing-location { font-size: 14px; color: var(--text-muted, #8a8a8a); margin-bottom: 12px; }
.listing-location a { color: #1277e1; text-decoration: none; }

.listing-key-stats { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid var(--border, #e8e8e8); border-radius: var(--radius, 12px); overflow: hidden; }
.listing-stat-item { flex: 1; text-align: center; padding: 12px 4px; }
.listing-stat-item:not(:last-child) { border-right: 1px solid var(--border, #e8e8e8); }
.listing-stat-value { font-size: 16px; font-weight: 700; }
.listing-stat-label { font-size: 10px; color: var(--text-muted, #8a8a8a); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.listing-peek-buttons { display: flex; gap: 10px; }
.listing-peek-buttons .listing-btn { flex: 1; padding: 13px 16px; border-radius: var(--radius, 12px); font-size: 14px; font-weight: 600; font-family: var(--font-sans, 'Inter', sans-serif); cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.listing-btn-primary { background: var(--sage, #4a7c59); color: #fff; border: none; }
.listing-btn-secondary { background: var(--white, #fff); color: var(--text, #1a1a1a); border: 1.5px solid var(--border, #e8e8e8); }

.listing-divider { height: 1px; background: var(--border, #e8e8e8); margin: 20px 0; }
.listing-section-title { font-family: var(--font-serif, 'DM Serif Display', Georgia, serif); font-size: 20px; margin-bottom: 12px; color: var(--text, #1a1a1a); }

.listing-rating-bar { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; cursor: pointer; }
.listing-rating-big { font-size: 42px; font-weight: 700; line-height: 1; }
.listing-rating-stars { color: #e8a817; font-size: 18px; letter-spacing: 1px; }
.listing-rating-count { font-size: 13px; color: var(--text-muted, #8a8a8a); margin-top: 2px; text-decoration: underline; text-decoration-color: var(--text-muted, #8a8a8a); }

.listing-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.listing-tag { padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--cream, #f7f7f7); color: var(--text-muted, #585858); border: 1px solid var(--border, #e8e8e8); }

.listing-access-bar { padding: 12px 16px; background: #e8f0ea; border-radius: var(--radius, 12px); display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.listing-access-bar .listing-access-icon { font-size: 20px; }
.listing-access-bar .listing-access-label { font-size: 13px; font-weight: 600; color: var(--sage, #4a7c59); }
.listing-access-bar .listing-access-sublabel { font-size: 12px; color: var(--text-muted, #8a8a8a); }

.listing-description { font-size: 14px; line-height: 1.7; color: var(--text-muted, #585858); margin-bottom: 16px; }

.listing-hours-grid { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 13px; }
.listing-hours-day { font-weight: 600; }
.listing-hours-time { color: var(--text-muted, #585858); }

.listing-review-card { padding: 14px 0; border-bottom: 1px solid var(--border, #e8e8e8); }
.listing-review-card:last-of-type { border-bottom: none; }
.listing-review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.listing-review-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cream, #f7f7f7); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--text-muted, #8a8a8a); flex-shrink: 0; }
.listing-review-meta { flex: 1; }
.listing-review-author { font-size: 13px; font-weight: 600; }
.listing-review-date { font-size: 11px; color: var(--text-muted, #8a8a8a); }
.listing-review-stars-sm { font-size: 12px; color: #e8a817; margin-bottom: 4px; }
.listing-review-body { font-size: 13px; line-height: 1.6; color: var(--text-muted, #585858); }
.listing-reviews-all-link { display: block; text-align: center; padding: 14px; font-size: 14px; font-weight: 600; color: #1277e1; text-decoration: none; border: 1px solid var(--border, #e8e8e8); border-radius: var(--radius, 12px); margin-top: 12px; }

.listing-video-card { border-radius: var(--radius, 12px); overflow: hidden; margin-bottom: 12px; border: 1px solid var(--border, #e8e8e8); cursor: pointer; }
.listing-video-thumb { position: relative; aspect-ratio: 16/9; background: #000; }
.listing-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.listing-video-thumb .listing-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 52px; height: 52px; background: rgba(0,0,0,0.7); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.listing-video-thumb .listing-play-btn svg { fill: #fff; width: 22px; height: 22px; margin-left: 3px; }
.listing-video-meta { padding: 10px 12px; background: var(--white, #fff); }
.listing-video-title { font-size: 13px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-video-channel { font-size: 11px; color: var(--text-muted, #8a8a8a); margin-top: 2px; }
.listing-video-embed { position: relative; aspect-ratio: 16/9; border-radius: var(--radius, 12px); overflow: hidden; margin-bottom: 12px; }
.listing-video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.listing-nearby-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px 8px; }
.listing-nearby-scroll::-webkit-scrollbar { display: none; }
.listing-nearby-card { min-width: 150px; max-width: 150px; border-radius: var(--radius, 12px); border: 1px solid var(--border, #e8e8e8); overflow: hidden; cursor: pointer; flex-shrink: 0; background: var(--white, #fff); }
.listing-nearby-card-img { width: 100%; aspect-ratio: 4/3; background: var(--cream, #f7f7f7); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.listing-nearby-card-info { padding: 8px 10px; }
.listing-nearby-card-name { font-size: 12px; font-weight: 600; line-height: 1.3; margin-bottom: 2px; }
.listing-nearby-card-meta { font-size: 11px; color: var(--text-muted, #8a8a8a); }

.listing-terrain-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.listing-terrain-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid var(--border, #e8e8e8); background: var(--white, #fff); }
.listing-terrain-chip .listing-chip-icon { font-size: 16px; }
.listing-terrain-chip.green { background: #e8f5e9; border-color: #c8e6c9; color: #2e7d32; }
.listing-terrain-chip.amber { background: #fff8e1; border-color: #ffecb3; color: #f57f17; }
.listing-terrain-chip.red { background: #fce4ec; border-color: #f8bbd0; color: #c62828; }
.listing-terrain-note { font-size: 13px; color: var(--text-muted, #585858); line-height: 1.6; margin-top: 8px; padding: 10px 14px; background: var(--cream, #f7f7f7); border-radius: 8px; }

.listing-share-bar { display: flex; gap: 10px; margin: 16px 0; }
.listing-share-bar .listing-btn { flex: 1; padding: 12px; border-radius: var(--radius, 12px); font-size: 13px; font-weight: 600; font-family: var(--font-sans, 'Inter', sans-serif); cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.listing-btn-share { background: var(--white, #fff); color: var(--text, #1a1a1a); border: 1.5px solid var(--border, #e8e8e8); }

.listing-links-section { margin-bottom: 16px; }
.listing-link-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border, #e8e8e8); text-decoration: none; color: var(--text, #1a1a1a); }
.listing-link-row:last-child { border-bottom: none; }
.listing-link-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--cream, #f7f7f7); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.listing-link-info { flex: 1; min-width: 0; }
.listing-link-label { font-size: 13px; font-weight: 600; }
.listing-link-url { font-size: 12px; color: var(--text-muted, #8a8a8a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-link-arrow { color: var(--text-muted, #8a8a8a); font-size: 16px; flex-shrink: 0; }

.listing-share-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 1200; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.listing-share-toast.show { opacity: 1; }

.listing-transport-card { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border, #e8e8e8); }
.listing-transport-card:last-child { border-bottom: none; }
.listing-transport-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--cream, #f7f7f7); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.listing-transport-name { font-size: 13px; font-weight: 600; color: var(--text, #1a1a1a); margin-bottom: 2px; }
.listing-transport-detail { font-size: 12px; color: var(--text-muted, #585858); line-height: 1.5; }
.listing-transport-link { color: #1277e1; text-decoration: none; font-size: 12px; font-weight: 500; }

/* Events */
.listing-event-card { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border, #e8e8e8); }
.listing-event-card:last-child { border-bottom: none; }
.listing-event-date-box { width: 50px; flex-shrink: 0; text-align: center; background: var(--cream, #f7f7f7); border-radius: 8px; padding: 8px 4px; border: 1px solid var(--border, #e8e8e8); }
.listing-event-month { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--sage, #4a7c59); letter-spacing: 0.5px; }
.listing-event-day { font-size: 20px; font-weight: 700; color: var(--text, #1a1a1a); line-height: 1.2; }
.listing-event-info { flex: 1; }
.listing-event-name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.listing-event-desc { font-size: 12px; color: #585858; line-height: 1.5; }
.listing-event-meta { font-size: 11px; color: #8a8a8a; margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.listing-event-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.listing-event-badge.seasonal { background: #e8f5e9; color: #2e7d32; }
.listing-event-badge.concert { background: #e3f2fd; color: #1565c0; }
.listing-event-badge.family { background: #fff3e0; color: #e65100; }
.listing-event-badge.special { background: #f3e5f5; color: #7b1fa2; }

@media (min-width: 768px) {
  .listing-name { font-size: 28px; }
}
