@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Paleta VizinAqui — mesma base do petwise, mobile-first, dark por padrão */
  --primary: #1DB954;
  --primary-dark: #0F8C3B;
  --secondary: #FF6B35;
  --accent: #7C3AED;
  --bg: #0F1923;
  --card: #1A2535;
  --card-2: #243040;
  --text: #F0F4F8;
  --muted: #8899AA;
  --error: #EF4444;
  --success: #1DB954;
  --rating: #FBBF24;
  --divider: var(--card-2);
  --radius: 20px;
  --radius-btn: 14px;
  --radius-chip: 999px;
  --radius-input: 12px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow-green: 0 0 20px rgba(29,185,84,0.3);
  --shadow-glow-orange: 0 0 20px rgba(255,107,53,0.3);
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}

h1, h2, h3 { font-family: var(--font-display); margin: 0 0 4px; color: var(--text); }
p { margin: 0 0 8px; }
a { color: inherit; }

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

/* ===== Transição de página (estilo app nativo) ===== */
@supports (view-transition-name: root) {
  ::view-transition-old(root) { animation: pageOut 0.18s ease forwards; }
  ::view-transition-new(root) { animation: pageIn 0.22s ease forwards; }
}
@keyframes pageOut { to { opacity: 0; transform: translateX(-12px); } }
@keyframes pageIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  background: linear-gradient(135deg, #0F1923, #1A2535);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 900;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  font-size: 1rem;
  box-shadow: var(--shadow-glow-green);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-open span:nth-child(2) { opacity: 0; }
.nav-toggle-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  top: 60px;
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-2);
  border-radius: 0 0 0 var(--radius);
  padding: 8px;
  min-width: 200px;
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 0.2s ease both;
}
.nav.nav-open { display: flex; }
.nav a {
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav a:hover { background: var(--card-2); color: var(--primary); }
.nav a.btn-link {
  background: var(--primary);
  color: #fff !important;
  font-weight: 700;
  text-align: center;
}
.nav a.btn-link:hover { background: var(--primary-dark); }

@media (min-width: 640px) {
  .nav-toggle { display: none; }
  .nav {
    display: flex !important;
    flex-direction: row;
    position: static;
    border: none;
    box-shadow: none;
    background: none;
    padding: 0;
    animation: none;
  }
  .nav a:hover { background: transparent; }
}

.back-btn {
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);
}
.back-btn:hover { text-decoration: underline; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: fadeSlideUp 0.25s ease both;
}
.alert-success { background: rgba(29,185,84,0.15); color: #6FE39A; }
.alert-error { background: rgba(239,68,68,0.15); color: #FF9B9B; }
.alert-info { background: rgba(124,58,237,0.15); color: #C9A8FF; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  animation: fadeSlideUp 0.35s ease both;
}

.input-field, select.input-field, textarea.input-field {
  width: 100%;
  border: 1px solid var(--card-2);
  border-radius: var(--radius-input);
  padding: 13px 14px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--card-2);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-field::placeholder { color: var(--muted); }
.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.2);
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 18px;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-glow-green);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }
.btn-outline {
  border: 1px solid var(--card-2);
  background: var(--card-2);
  color: var(--text);
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  padding: 12px 8px;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(29,185,84,0.1); }
.btn-link-plain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0;
  font-size: 0.92rem;
}
.btn-link-plain:hover { color: var(--primary-dark); }

.search-form { display: flex; flex-direction: column; gap: 10px; }
.search-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.search-actions .btn-primary { flex: 1; min-width: 120px; }
.btn-location {
  flex: 1;
  min-width: 160px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--card-2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-location:hover { background: rgba(29,185,84,0.18); box-shadow: var(--shadow-glow-green); }
.btn-location:active { transform: scale(0.93); }
.btn-location:disabled { opacity: 0.6; cursor: default; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.category-chip .icon { font-size: 1.6rem; }
.category-chip:hover { border-color: var(--primary); background: rgba(29,185,84,0.1); }
.category-chip:active { transform: scale(0.96); }

.business-list { display: flex; flex-direction: column; gap: 12px; }
.business-card {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.business-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card), var(--shadow-glow-green); }
.business-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.business-directions {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 48px;
  padding: 6px 4px;
  border-radius: 12px;
  background: var(--card-2);
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.business-directions .icon { font-size: 1.1rem; line-height: 1; }
.business-directions .label { font-size: 0.6rem; font-weight: 700; color: var(--muted); }
.business-directions:hover { background: rgba(29,185,84,0.18); box-shadow: var(--shadow-glow-green); }
.business-directions:hover .label { color: var(--primary); }
.business-directions:active { transform: scale(0.9); }
.business-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  overflow: hidden;
}
.business-thumb img { width: 100%; height: 100%; object-fit: cover; }
.business-info { min-width: 0; flex: 1; }
.business-info h3 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.business-address {
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.85rem; }
.rating .stars { color: var(--rating); }
.rating .count { color: var(--muted); font-weight: 400; }
.distance {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(29,185,84,0.15);
  padding: 2px 8px;
  border-radius: var(--radius-chip);
  margin-left: 8px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}
.empty-state .icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.detail-photo {
  width: 100%;
  height: 180px;
  border-radius: var(--radius);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.review {
  padding: 14px 0;
  border-bottom: 1px solid var(--card-2);
}
.review:last-child { border-bottom: none; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.review-author { font-weight: 700; }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-2);
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s ease;
}
.history-item:hover { color: var(--primary); }
.history-item .meta { font-size: 0.78rem; color: var(--muted); }

#map { width: 100%; height: calc(100vh - 140px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }

.favorite-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  transition: transform 0.15s ease;
}
.favorite-toggle:active { transform: scale(1.3); }

/* ===== Overlay de carregamento (busca de comércios) ===== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.92);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.loading-overlay.loading-overlay-visible {
  display: flex;
  animation: fadeSlideUp 0.2s ease both;
}
.loading-box { text-align: center; }
.loading-text {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 16px;
}
.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.loading-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow-glow-green);
  animation: loadingBounce 1.1s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.15s; background: var(--secondary); box-shadow: var(--shadow-glow-orange); }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; background: var(--accent); box-shadow: 0 0 20px rgba(124,58,237,0.3); }
@keyframes loadingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-14px); opacity: 1; }
}
