/* ------------------------------------------------------------------
   응암동 맛집 — 따뜻한 동네 푸드 앱 톤
------------------------------------------------------------------ */
:root {
  --bg: #FFF8F3;
  --bg-soft: #FFF1E6;
  --surface: #FFFFFF;
  --primary: #FF6B4A;
  --primary-dark: #E55530;
  --primary-soft: #FFE3D9;
  --text: #2C2C2C;
  --text-soft: #6B6B6B;
  --text-mute: #9A9A9A;
  --line: #F0E5DC;
  --line-strong: #E2D5C9;
  --gold: #FFB800;
  --gold-soft: #FFE9A8;
  --danger: #D64545;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-1: 0 2px 6px rgba(60, 30, 10, 0.05);
  --shadow-2: 0 12px 28px -10px rgba(60, 30, 10, 0.18);
  --shadow-3: 0 22px 44px -16px rgba(60, 30, 10, 0.22);
  --duration: 220ms;
  --ease: cubic-bezier(.22, .9, .32, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 248, 243, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #FF8B5C);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 14px -4px rgba(255, 107, 74, 0.55);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-sub {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
}
.cta-add {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 6px 14px -4px rgba(255, 107, 74, 0.55);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), background var(--duration) var(--ease);
  white-space: nowrap;
}
.cta-add:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 10px 18px -4px rgba(255, 107, 74, 0.55); }
.cta-add:active { transform: translateY(0); }
.cta-ghost {
  background: transparent;
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line-strong);
}
.cta-ghost:hover { background: var(--bg-soft); color: var(--text); }

/* ---------- Filter bar ---------- */
.filter-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 0 16px;
  position: sticky;
  top: 70px;
  z-index: 20;
}
.filter-scroll {
  display: flex;
  gap: 8px;
  padding: 0 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
}
.chip:hover { background: var(--bg-soft); border-color: var(--primary-soft); }
.chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
  box-shadow: 0 6px 14px -6px rgba(44, 44, 44, 0.5);
}
.chip-count {
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ---------- Container ---------- */
.container {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 22px 80px;
  flex: 1;
}
.summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 4px 18px;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
}
.summary strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  transition: opacity 180ms var(--ease);
}
.grid.filtering { opacity: 0.35; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-3);
  border-color: var(--primary-soft);
}
.card-image {
  aspect-ratio: 4 / 3;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.card-image.fallback {
  background: linear-gradient(135deg, #FFD2BD, #FF8B5C);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.04em;
}
.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: -0.01em;
}
.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}
.card-tagline {
  color: var(--text-soft);
  font-size: 13.5px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.55em * 2);
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rating .stars-static {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}
.rating .stars-static .empty { color: var(--gold-soft); }
.rating-value { font-weight: 700; }
.rating-count { color: var(--text-mute); font-size: 12px; }
.card-address {
  font-size: 12px;
  color: var(--text-mute);
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 55%;
}

/* ---------- Empty / Loader ---------- */
.empty {
  text-align: center;
  padding: 64px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-soft);
}
.empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.empty-sub { margin: 0 0 18px; }
.empty-cta {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
}
.empty-cta:hover { background: var(--primary-dark); }
.loader {
  display: grid;
  place-items: center;
  padding: 60px 0;
  color: var(--text-mute);
  font-size: 13px;
  gap: 14px;
}
.loader p { margin: 0; }
.loader-pulse {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  box-shadow: 0 0 0 0 rgba(255, 107, 74, 0.45);
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(255,107,74,.45); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 18px rgba(255,107,74,0); }
  100% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(255,107,74,0); }
}

/* ---------- Detail page ---------- */
.detail-container { padding-top: 20px; }
.detail-hero {
  position: relative;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-lg);
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
  overflow: hidden;
  box-shadow: var(--shadow-2);
}
.detail-hero.fallback {
  background: linear-gradient(135deg, #FFD2BD, #FF8B5C);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 96px;
  letter-spacing: -0.04em;
}
.detail-hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 70%);
  padding: 22px 28px;
  color: #fff;
}
.detail-hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.detail-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.35);
}
.detail-tagline {
  margin-top: 4px;
  color: #fff;
  opacity: 0.95;
  font-size: 15px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}
.detail-body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 820px) {
  .detail-body { grid-template-columns: 1fr; }
  .detail-title { font-size: 24px; }
}
.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-1);
}
.detail-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.detail-meta-row:last-child { border-bottom: none; }
.detail-meta-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.detail-meta-value {
  color: var(--text);
  text-align: right;
  white-space: pre-wrap;
}
.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
  color: var(--text);
  white-space: pre-wrap;
}
.menu-list li:last-child { border-bottom: none; }

.detail-rating-overview {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.big-rating {
  font-size: 44px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.big-rating-side .stars-static { font-size: 18px; letter-spacing: 2px; }
.big-rating-count { font-size: 13px; color: var(--text-mute); margin-top: 4px; }

/* ---------- Review form ---------- */
.review-form { margin-top: 6px; }
.star-input {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 12px;
}
.star-input button {
  background: none;
  border: none;
  font-size: 30px;
  color: var(--gold-soft);
  padding: 0 2px;
  line-height: 1;
  transition: color 120ms var(--ease), transform 120ms var(--ease);
}
.star-input button:hover { transform: scale(1.08); }
.star-input button.filled {
  color: var(--gold);
  animation: starPop 280ms var(--ease) backwards;
}
@keyframes starPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.review-form textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
  min-height: 90px;
  background: var(--bg);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.review-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}
.review-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 12px;
}
.review-rating-label {
  font-size: 13px;
  color: var(--text-soft);
}

/* ---------- Review list ---------- */
.review-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.review-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.review-stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.review-stars .empty { color: var(--gold-soft); }
.review-date { font-size: 12px; color: var(--text-mute); }
.review-text { margin: 0; color: var(--text); font-size: 14px; white-space: pre-wrap; }
.no-reviews {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-mute);
  font-size: 13px;
}

/* ---------- Form (add restaurant) ---------- */
.page-head {
  margin: 8px 4px 22px;
}
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.page-sub { color: var(--text-soft); margin: 6px 0 0; font-size: 14px; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  background: var(--bg);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
}
.field-help { font-size: 12.5px; color: var(--text-mute); margin: 2px 0 0; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.chip-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-pick .chip { cursor: pointer; }
.chip-pick .chip.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.image-preview {
  margin-top: 4px;
  aspect-ratio: 4/3;
  max-width: 260px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--bg-soft);
  border: 1px solid var(--line);
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.btn {
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--duration) var(--ease);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(255, 107, 74, 0.55);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.form-error {
  background: #FFEAEA;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin: 0;
}

/* ---------- Footer ---------- */
.footer {
  padding: 22px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer p { margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 20px);
  background: var(--text);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Card entrance ---------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: cardIn 320ms var(--ease) backwards; }

@media (max-width: 540px) {
  .topbar { padding: 12px 16px; }
  .brand-sub { display: none; }
  .filter-bar { top: 64px; }
  .filter-scroll { padding: 0 16px; }
  .container { padding: 20px 16px 60px; }
  .form-card { padding: 22px 18px; border-radius: var(--radius); }
  .detail-hero-overlay { padding: 16px 18px; }
}
