/* === DISCOVER PAGE LAYOUT === */

.discover-body {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Nav becomes a link on discover page */
.discover-body .nav-logo {
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.discover-body .nav-logo:hover { opacity: 0.7; }

.discover-body .nav {
  flex-shrink: 0;
  position: relative; /* not sticky inside flex column */
}

.discover-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === SIDEBAR === */

.sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(61, 35, 20, 0.1);
  background: var(--off-white);
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.5rem 0;
  flex-shrink: 0;
}

.sidebar-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

/* === SEARCH FORM === */

.search-form { margin-bottom: 1rem; }

.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 1.5px solid rgba(61, 35, 20, 0.15);
  border-radius: 12px;
  padding: 0 0.5rem 0 0.75rem;
  gap: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input-wrap:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200, 98, 42, 0.12);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--charcoal);
  padding: 0.75rem 0;
}

.search-input::placeholder { color: var(--muted); }

.search-btn {
  flex-shrink: 0;
  background: var(--amber);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, transform 0.1s ease;
}

.search-btn:hover { background: #b5551f; }
.search-btn:active { transform: scale(0.97); }

/* === VIEW TOGGLE === */

.view-toggle {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid rgba(61, 35, 20, 0.12);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-btn:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.toggle-btn--active {
  background: var(--espresso);
  border-color: var(--espresso);
  color: var(--cream);
}

/* === RESULTS META === */

.results-meta {
  padding: 0 1.5rem 0.75rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--amber);
}

.results-city {
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === STATE MESSAGES === */

.results-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  gap: 1rem;
  flex: 1;
  text-align: center;
}

.state-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.results-state p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.5;
}

.results-state--error .state-icon { color: #c0392b; opacity: 0.6; }

/* Loading animation */
.loading-beans {
  display: flex;
  gap: 6px;
  align-items: center;
}

.loading-beans span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  animation: beanBounce 0.9s ease-in-out infinite;
}

.loading-beans span:nth-child(2) { animation-delay: 0.15s; background: var(--amber-light); }
.loading-beans span:nth-child(3) { animation-delay: 0.3s; background: var(--roast); }

@keyframes beanBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40% { transform: translateY(-8px); opacity: 1; }
}

/* === SHOP LIST === */

.shop-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 0 1rem 2rem;
  /* Subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(61,35,20,0.15) transparent;
}

.shop-list::-webkit-scrollbar { width: 4px; }
.shop-list::-webkit-scrollbar-track { background: transparent; }
.shop-list::-webkit-scrollbar-thumb { background: rgba(61,35,20,0.15); border-radius: 2px; }

.shop-card {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  border: 1.5px solid rgba(61, 35, 20, 0.08);
  background: var(--cream);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.shop-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 98, 42, 0.3);
  box-shadow: 0 4px 16px rgba(30, 15, 8, 0.08);
}

.shop-card--active {
  border-color: var(--amber);
  background: linear-gradient(135deg, var(--cream) 0%, rgba(200,98,42,0.05) 100%);
  box-shadow: 0 4px 20px rgba(200, 98, 42, 0.15);
}

.shop-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.shop-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--espresso);
  line-height: 1.3;
}

.shop-arrow {
  color: var(--amber);
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.shop-card:hover .shop-arrow,
.shop-card--active .shop-arrow {
  opacity: 1;
  transform: translateX(0);
}

.shop-address {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

/* === VIBE PILLS === */

.vibe-pill {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(200, 98, 42, 0.1);
  color: var(--amber);
  border: 1px solid rgba(200, 98, 42, 0.2);
  letter-spacing: 0.01em;
}

.vibe-pill--lg {
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
}

/* === MAP PANEL === */

.map-panel {
  flex: 1;
  position: relative;
  background: var(--cream-dark);

  /* Hidden on mobile by default; shown when map view active */
  display: none;
}

.map-panel--visible {
  display: block;
}

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

/* Custom Leaflet marker */
.bh-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bh-marker-dot {
  width: 14px;
  height: 14px;
  background: var(--amber);
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(30, 15, 8, 0.3);
  transition: transform 0.15s ease;
}

.bh-marker--active .bh-marker-dot {
  width: 18px;
  height: 18px;
  background: var(--espresso);
  box-shadow: 0 2px 12px rgba(30, 15, 8, 0.5);
}

/* Override Leaflet tile attribution */
.leaflet-control-attribution {
  font-size: 0.65rem !important;
  background: rgba(253, 250, 246, 0.8) !important;
}

/* === DRAWER === */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 15, 8, 0);
  pointer-events: none;
  z-index: 200;
  transition: background 0.25s ease;
}

.drawer-overlay--visible {
  background: rgba(30, 15, 8, 0.3);
  pointer-events: all;
}

.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--off-white);
  border-radius: 20px 20px 0 0;
  padding: 1.75rem 1.5rem 2.5rem;
  z-index: 300;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(30, 15, 8, 0.15);
  max-height: 70vh;
  overflow-y: auto;
}

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

.drawer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid rgba(61,35,20,0.15);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.drawer-close:hover {
  background: var(--cream-dark);
  color: var(--espresso);
}

.drawer-shop-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--espresso);
  margin-bottom: 0.4rem;
  padding-right: 2.5rem;
  line-height: 1.2;
}

.drawer-address {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.drawer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--amber);
  color: white;
  border: 1.5px solid var(--amber);
}

.drawer-action-btn:hover { background: #b5551f; border-color: #b5551f; }

.drawer-action-btn--outline {
  background: transparent;
  color: var(--roast);
  border-color: rgba(61,35,20,0.2);
}

.drawer-action-btn--outline:hover {
  background: var(--cream);
  border-color: var(--roast);
  color: var(--espresso);
}

.drawer-coords {
  font-size: 0.75rem;
  color: rgba(140,121,102,0.6);
  display: flex;
  gap: 1rem;
}

.drawer-coords a {
  color: var(--amber);
  text-decoration: none;
}

.drawer-coords a:hover { text-decoration: underline; }

/* === DESKTOP: side-by-side map always visible === */

@media (min-width: 768px) {
  .map-panel {
    display: block; /* always show map on desktop */
  }

  /* On desktop, list view still scrollable but map stays visible */
  .toggle-btn[data-view="map"] {
    /* Map is always visible on desktop — toggle just focuses the panel */
  }

  .drawer {
    left: 380px; /* offset for sidebar width */
    border-radius: 20px;
    bottom: 1.5rem;
    max-width: 380px;
    right: auto;
    padding: 1.5rem;
    max-height: calc(100vh - 120px);
  }
}

@media (max-width: 767px) {
  .sidebar {
    width: 100%;
  }

  /* On mobile, map panel slides over the sidebar */
  .map-panel--visible {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: block;
  }

  .discover-layout {
    position: relative;
  }
}
