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

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #FFF8F5;
  height: 100vh;
  overflow: hidden;
}

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

/* ── Sidebar — bottom sheet on mobile ── */
#sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0 16px 32px;
  transform: translateY(calc(100% - 48px));
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

#sidebar.open {
  transform: translateY(0);
}

#panel-handle {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  cursor: pointer;
  flex-shrink: 0;
}

.handle-bar {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
}

#handle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  letter-spacing: 0.03em;
}

.logo-wrap {
  margin-bottom: 20px;
}

.controls label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  margin-top: 16px;
}

#keyword-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

#keyword-input:focus {
  border-color: #FF7043;
}

#location-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#location-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

#location-input:focus {
  border-color: #FF7043;
}


#gps-btn {
  padding: 8px 11px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s;
  flex-shrink: 0;
}

#gps-btn:hover {
  border-color: #FF7043;
  color: #FF7043;
}

#category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-btn {
  padding: 7px 13px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.cat-btn:hover {
  border-color: #FF7043;
  color: #FF7043;
}

.cat-btn.active {
  background: #FF7043;
  border-color: #FF7043;
  color: #fff;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

#radius-slider {
  flex: 1;
  accent-color: #FF7043;
}

#radius-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  min-width: 60px;
  text-align: right;
}

.walk-time {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  align-items: stretch;
}

#search-btn {
  flex: 1;
  padding: 12px;
  background: #FF7043;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

#search-btn:hover {
  background: #E53935;
}

#search-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.filter-btn {
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #444;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: #FF7043;
  color: #FF7043;
}

.filter-btn.active {
  background: #FFF0EE;
  border-color: #FF7043;
  color: #FF7043;
}

/* ── Results ── */
#results-header {
  margin-top: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

#results-count {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-bottom: 8px;
}

#sort-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sort-btn {
  padding: 4px 10px;
  border: 1.5px solid #ddd;
  border-radius: 12px;
  background: #fff;
  color: #555;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-btn:hover {
  border-color: #FF7043;
  color: #FF7043;
}

.sort-btn.active {
  background: #FF7043;
  border-color: #FF7043;
  color: #fff;
}

#results-header.hidden { display: none; }

#results-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.place-card {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.place-card:hover,
.place-card.active {
  box-shadow: 0 2px 10px rgba(255,112,67,0.15);
  border-color: #FF7043;
}

.place-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.place-card .address {
  font-size: 0.78rem;
  color: #777;
  margin-bottom: 6px;
}

.place-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rating {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f59e0b;
}

.rating-count {
  font-size: 0.75rem;
  color: #999;
}

.open-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.open-badge.open { background: #d1fae5; color: #065f46; }
.open-badge.closed { background: #fee2e2; color: #991b1b; }

.price {
  font-size: 0.82rem;
  color: #666;
}

/* ── Map ── */
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ── Info Card ── */
#info-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 100;
  transition: transform 0.2s, opacity 0.2s;
}

#info-card.hidden {
  display: none;
}

#info-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 0.8rem;
  z-index: 1;
}

#info-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #eee;
}

#info-body {
  padding: 12px 14px;
}

#info-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

#info-address {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}

#info-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

#info-maps-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: #FF7043;
  text-decoration: none;
  font-weight: 600;
}

#info-maps-link:hover {
  text-decoration: underline;
}

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

#loading-msg {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  padding: 20px 0;
}

.distance {
  font-size: 0.78rem;
  color: #888;
  margin-left: auto;
}

.rank-badge {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FF7043;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 22px;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ── Desktop layout ── */
@media (min-width: 768px) {
  #app {
    display: flex;
    flex-direction: row;
  }

  #map {
    position: relative;
    flex: 1;
    height: 100vh;
  }

  #sidebar {
    position: relative;
    width: 360px;
    min-width: 320px;
    max-height: none;
    border-radius: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    padding: 20px 16px;
    transform: none;
    transition: none;
    overflow-y: auto;
    flex-shrink: 0;
    order: -1;
  }

  #panel-handle {
    display: none;
  }

  #info-card {
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 320px;
    border-radius: 14px;
  }
}

/* ── Mobile info card ── */
@media (max-width: 767px) {
  #info-card {
    left: 12px;
    right: 12px;
    bottom: 64px;
    width: auto;
    border-radius: 14px;
  }
}
