:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --secondary: #f1faee;
  --accent: #a8dadc;
  --dark: #1d3557;
  --light: #f8f9fa;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.18);
  --radius: 14px;
  --transition: all 0.25s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f4f4f6;
  color: #333;
  padding-bottom: 60px;
}

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.6rem 1rem;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
}
.navbar.navbar-hidden { transform: translateY(-100%); }
.logo-navbar { height: 36px; }

.navbar-search {
  flex: 1;
  position: relative;
  margin: 0 12px;
}
.search-input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  border: 2px solid #e0e0e0;
  border-radius: 24px;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 0.85rem;
}

/* ── Carrossel ── */
.carousel {
  max-width: 1200px;
  margin: 16px auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.carousel-item img {
  height: 260px;
  object-fit: cover;
}
.carousel-caption {
  background: rgba(0,0,0,0.45);
  border-radius: 8px;
  padding: 10px 16px;
  bottom: 20px;
}
.carousel-caption h5 { font-weight: 700; margin-bottom: 2px; }
.carousel-caption p { font-size: 0.85rem; margin: 0; }

/* ── Filtros ── */
.filter-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 12px auto;
  max-width: 1200px;
  box-shadow: var(--shadow);
}
.section-title {
  color: var(--dark);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--primary); }

.filter-carousel {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.filter-carousel::-webkit-scrollbar { display: none; }

.filter-btn {
  flex: 0 0 auto;
  border-radius: 22px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 2px solid #dde;
  color: var(--dark);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(230,57,70,0.3);
}

/* Filtros selecionados */
.selected-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.selected-filter {
  background: #fff0f0;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.selected-filter i { cursor: pointer; font-size: 0.75rem; }
.selected-filter i:hover { color: var(--primary-dark); }
.clear-filters {
  background: none;
  border: none;
  color: #888;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}
.clear-filters:hover { color: var(--primary); }

/* ── Título Top ── */
.top-10-title {
  text-align: center;
  color: var(--dark);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 24px 0 16px;
}
.top-10-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--primary);
  margin: 8px auto 0;
  border-radius: 2px;
}

/* ── Grid de Restaurantes ── */
.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.restaurant-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
}
.restaurant-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.restaurant-card:hover .card-img-wrapper img { transform: scale(1.05); }
.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: #ffd700;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.card-body-custom { padding: 14px 16px; }
.card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 2px;
}
.card-desc {
  font-size: 0.82rem;
  color: #777;
  margin-bottom: 6px;
}
.card-stars {
  color: #f4a924;
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.card-stars span { color: #999; margin-left: 4px; }

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
}
.info-badge {
  background: #f5f5f5;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.76rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 4px;
}
.info-badge i { color: var(--primary); font-size: 0.7rem; }

.card-actions { display: flex; gap: 8px; }
.action-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.wpp-btn { background: #25d366; color: #fff; }
.wpp-btn:hover { background: #1ebe5d; }
.book-btn { background: var(--primary); color: #fff; }
.book-btn:hover { background: var(--primary-dark); }

/* ── Sem resultados ── */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
}
.no-results i { font-size: 3rem; display: block; margin-bottom: 16px; }
.no-results h3 { color: #666; }

/* ── Responsivo ── */
@media (max-width: 600px) {
  .restaurants-grid { grid-template-columns: 1fr; padding: 0 10px; }
  .carousel-item img { height: 180px; }
  .top-10-title { font-size: 1.3rem; }
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 90;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px 8px;
  text-decoration: none;
  color: #bbb;
  font-size: 0.68rem;
  font-weight: 600;
  gap: 4px;
  transition: color 0.2s;
}
.bnav-item i { font-size: 1.15rem; }
.bnav-item.active { color: var(--primary); }
.bnav-item:hover { color: var(--primary); }

/* Garante que o conteúdo não fique embaixo da bottom nav */
body { padding-bottom: 70px; }

/* ── User menu ── */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 7px;
  background: #f8f8f8; border: 1.5px solid #eee;
  border-radius: 24px; padding: 5px 12px 5px 5px;
  cursor: pointer; transition: border-color 0.2s;
}
.user-btn:hover { border-color: var(--primary); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 0.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--dark);
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  min-width: 200px; padding: 6px;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.udrop-header { padding: 10px 12px 8px; border-bottom: 1px solid #f0f0f0; margin-bottom: 4px; }
.udrop-header strong { display: block; font-size: 0.88rem; color: var(--dark); }
.udrop-header span { font-size: 0.75rem; color: #aaa; }
.udrop-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; border-radius: 9px;
  font-size: 0.85rem; color: #444; text-decoration: none;
  cursor: pointer; width: 100%; background: none; border: none;
  transition: background 0.15s;
}
.udrop-item i { width: 14px; text-align: center; color: #aaa; font-size: 0.85rem; }
.udrop-item:hover { background: #f5f5f5; color: var(--dark); }
.udrop-item:hover i { color: var(--primary); }
.udrop-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }
.udrop-logout { color: var(--primary) !important; }
.udrop-logout i { color: var(--primary) !important; }
