:root {
  --sidebar-bg: #e7e3da;
  --text-primary: #11181c;
  --text-muted: #555;
  --pill-border: #000;
  --pill-active-bg: #000;
  --pill-active-text: #fff;
  --link-color: #11181c;
  --search-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
}

#app-shell {
  position: relative;
  height: 100vh;
}

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

/* Sidebar overlay */
#finder-sidebar {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  width: 304px;
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#finder-sidebar > * {
  pointer-events: auto;
}

#sidebar-panel {
  background: var(--sidebar-bg);
  border-radius: 16px;
  padding: 0 16px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#sidebar-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

#sidebar-panel-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--text-primary);
  cursor: pointer;
}

#sidebar-panel-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
}

#sidebar-logo {
  display: block;
  width: 100%;
  max-width: 244px;
  height: auto;
}

#sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.875rem;
}

#sidebar-title-pin {
  flex-shrink: 0;
  height: 1.15em;
  width: auto;
}

#sidebar-title-text {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #333333;
}

#sidebar-credit {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-primary);
}

#sidebar-credit a {
  color: inherit;
  text-decoration: underline;
}

#sidebar-credit a:hover {
  color: #2c3851;
}

/* Search bar — pill at top of sidebar */
#search-container {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.search-field {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.search-field-row {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--sidebar-bg);
  border-radius: 100px;
  box-shadow: var(--search-shadow);
  padding: 0 8px 0 16px;
  height: 40px;
}

.search-field-row #search-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 2rem 0.5rem 0;
  border: none;
  border-radius: 100px;
  font-size: 0.95rem;
  outline: none;
  background: transparent;
  color: var(--text-primary);
}

.search-field-row #search-clear {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#search-clear:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

#search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.35rem;
  list-style: none;
  background: #e8e4dc;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1100;
}

#search-suggestions li {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.3;
  border-bottom: 1px solid #f0f0f0;
}

#search-suggestions li:last-child {
  border-bottom: none;
}

#search-suggestions li:hover,
#search-suggestions li.suggestion-active {
  background: rgba(231, 227, 218, 0.6);
}

.suggestion-main {
  display: block;
  color: var(--text-primary);
}

.suggestion-secondary {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* Day filter pills */
#day-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.day-filter-btn {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 16px;
  border: 2px solid var(--pill-border);
  border-radius: 50px;
  background: transparent;
  color: rgb(38, 50, 56);
  cursor: pointer;
  white-space: nowrap;
}

.day-filter-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.day-filter-btn.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
}

.day-filter-btn.active:hover {
  background: var(--pill-active-bg);
}

/* Error banner */
#error-banner {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  background: #c0392b;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  text-align: center;
}

/* Modal overlay */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal card */
#modal {
  position: relative;
  background: #fdf5e6;
  border-radius: 12px;
  max-width: 480px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  padding-bottom: 1rem;
}

#modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #2c3851;
  z-index: 1;
}

#modal-close:hover {
  color: #111;
}

/* Trusted badge — temporarily hidden; restore display: inline-block to show again */
#modal-trusted {
  display: none !important;
  margin: 0.75rem 1rem 0;
  padding: 0.2rem 0.65rem;
  background: #d1fae5;
  color: #065f46;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: help;
}

/* Name */
#modal-name {
  margin: 0.5rem 1rem 0.25rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: #2c3851;
}

/* Address, phone, notes */
#modal-address {
  margin: 0.2rem 1rem 0;
  font-size: 0.9rem;
}

#modal-address a {
  color: #8b7355;
  text-decoration: underline;
}

#modal-address a:hover {
  color: #6d5a43;
}

#modal-phone {
  margin: 0.2rem 1rem 0;
  font-size: 0.9rem;
}

#modal-phone a {
  color: var(--link-color);
  text-decoration: underline;
}

#modal-phone a:hover {
  text-decoration: none;
}

#modal-notes {
  margin: 0.5rem 1rem 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* Events list */
#modal-events {
  margin: 1rem 1rem 0;
}

#modal-visit-website {
  display: block;
  margin: 1rem 1rem 0;
  padding: 0.85rem 1rem;
  background: #2c3851;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 10px;
}

#modal-visit-website:hover {
  background: #1e2536;
}

/* Promo popup overlay */
#promo-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#promo-popup {
  display: flex;
  flex-direction: column;
  width: 800px;
  height: 600px;
  background: #e7e3db;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: #000;
}

#promo-popup.promo-popup--embed {
  height: auto;
  max-height: 90vh;
  overflow-y: auto;
}

#promo-popup.promo-popup--embed #promo-popup-content {
  height: auto;
}

.promo-popup-media {
  flex-shrink: 0;
  width: 100%;
}

.promo-popup-media--mobile {
  display: none;
}

.promo-popup-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.promo-popup-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.promo-popup-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#promo-popup-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  height: 400px;
  padding: 24px 32px;
  text-align: center;
}

#promo-popup-title {
  font-weight: 700;
  font-size: 40px;
  line-height: 1.2;
  margin-bottom: 12px;
}

#promo-popup-subtitle {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 12px;
}

#promo-popup-body {
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 24px;
}

#promo-popup-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#promo-popup-cta1,
#promo-popup-cta2 {
  width: 272px;
  height: 42px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  border-radius: 0;
}

#promo-popup-cta1 {
  background: #000;
  color: #fff;
  border: none;
}

#promo-popup-cta2 {
  background: #e7e3db;
  color: #000;
  border: 3px solid #000;
}

.event-item {
  margin-bottom: 0;
  padding: 0.15rem 0;
}

.event-schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.event-day {
  font-size: 0.88rem;
  font-weight: 600;
  color: #222;
}

.event-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.event-notes {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.event-divider {
  display: block;
  width: 100%;
  height: 0;
  margin: 0.65rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Location pin markers (L.divIcon) */
.leaflet-marker-icon.location-pin-icon {
  background: none;
  border: none;
}

.leaflet-marker-icon.location-pin-icon svg {
  display: block;
}

/* User location indicator (geolocation) */
.leaflet-marker-icon.user-location-marker {
  background: none;
  border: none;
}

.user-location-marker-inner {
  position: relative;
  width: 40px;
  height: 40px;
}

.user-location-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.2);
}

.user-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Cluster bubbles — override MarkerCluster.Default.css */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(212, 183, 131, 0.45);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(212, 183, 131, 0.85);
}

/* Map toolbar (my location, zoom to fit, zoom in/out), bottom-right */
.map-aux-toolbar {
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

.map-aux-toolbar button {
  font-size: 1.2rem;
  line-height: 26px;
  width: 26px;
  text-align: center;
  cursor: pointer;
  background: #e8e4dc;
  color: #333;
  border: none;
  display: block;
}

.map-aux-toolbar button + button {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.map-aux-toolbar button:hover {
  background: #dedad2;
  color: #000;
}

/* Mobile: sidebar spans top, capped height */
@media (max-width: 640px) {
  #finder-sidebar {
    top: 0;
    left: 0;
    width: 100%;
    max-height: 45vh;
    padding: 8px 8px 0;
  }

  #finder-sidebar.sidebar-panel-collapsed {
    max-height: none;
  }

  #sidebar-panel {
    border-radius: 12px 12px 0 0;
  }

  #sidebar-panel.sidebar-panel-collapsed {
    padding-bottom: 8px;
  }

  #sidebar-panel.sidebar-panel-collapsed #sidebar-panel-content {
    display: none;
  }

  #sidebar-panel-toggle {
    display: flex;
  }

  #sidebar-logo {
    max-width: 200px;
  }

  #sidebar-title {
    font-size: 0.8125rem;
  }

  #day-filter {
    gap: 6px;
    margin-top: 12px;
  }

  .day-filter-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
    border-width: 1.5px;
  }

  .day-filter-btn sup {
    font-size: 0.65em;
    line-height: 0;
    vertical-align: super;
  }

  .promo-popup-image {
    height: auto;
  }

  .promo-popup-media--desktop {
    display: none;
  }

  .promo-popup-media--mobile {
    display: block;
  }

  #promo-popup {
    width: 350px;
    height: 600px;
  }

  #promo-popup-content {
    height: 460px;
    padding: 20px 16px;
  }

  #promo-popup-title {
    font-size: 28px;
  }
  #promo-popup-subtitle {
    font-size: 20px;
  }

  #promo-popup-body {
    font-size: 14px;
  }

  #promo-popup-actions {
    flex-direction: column;
    gap: 12px;
  }

  #promo-popup-cta1,
  #promo-popup-cta2 {
    font-size: 12.66px;
  }

  #promo-popup-cta2 {
    border-width: 2px;
  }
}

/* Utility */
.hidden {
  display: none !important;
}
