/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #E8544A;
  --primary-dark: #c94540;
  --primary-light: #FFF0EE;
  --accent: #FF8A50;
  --bg: #F5F0EB;
  --card-bg: #FFFFFF;
  --text-primary: #1C1C1E;
  --text-secondary: #6C6C70;
  --border: #E5E5EA;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: inherit; text-decoration: none; }

/* ===== HEADER ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.search-wrap {
  flex: 1;
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background: #fafafa;
}
.search-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.search-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.2s;
}
.search-btn:hover { background: var(--primary-dark); }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 44px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.hero p {
  font-size: 0.95rem;
  opacity: 0.88;
}

/* ===== CATEGORY BAR ===== */
.category-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 90;
}

.category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* ===== MAIN CONTENT ===== */
.main-content { padding: 28px 16px 48px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.ai-badge {
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.count {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.ai-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 14px;
  margin-top: -6px;
}

/* ===== CARDS ROW (AI 추천 — horizontal scroll) ===== */
.cards-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cards-row::-webkit-scrollbar { height: 4px; }
.cards-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.cards-row .card { min-width: 190px; max-width: 190px; }

/* ===== CARDS GRID (전체 맛집) ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

/* ===== CARD ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: block;
  position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}

.card-img {
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  user-select: none;
}

/* Category gradient backgrounds */
.cat-한식  { background: linear-gradient(135deg, #FF6B6B 0%, #FFE0B2 100%); }
.cat-일식  { background: linear-gradient(135deg, #4ECDC4 0%, #C7EFCF 100%); }
.cat-중식  { background: linear-gradient(135deg, #E74C3C 0%, #FADBD8 100%); }
.cat-양식  { background: linear-gradient(135deg, #9B59B6 0%, #D2B4DE 100%); }
.cat-분식  { background: linear-gradient(135deg, #F39C12 0%, #FDEBD0 100%); }
.cat-카페  { background: linear-gradient(135deg, #795548 0%, #D7CCC8 100%); }
.cat-치킨  { background: linear-gradient(135deg, #E67E22 0%, #FDEBD0 100%); }
.cat-기타  { background: linear-gradient(135deg, #78909C 0%, #CFD8DC 100%); }

.card-body { padding: 10px 12px 12px; }

.card-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.card-addr {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

/* Badges on card image */
.featured-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(232, 84, 74, 0.92);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.ad-label {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* ===== SECTIONS ===== */
.ai-section   { margin-bottom: 36px; }
.all-section  { margin-bottom: 12px; }

/* ===== MAP SECTION ===== */
.map-section { margin-top: 32px; }
.map-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.map-container {
  height: 360px;
  background: #E8E8E8;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-placeholder {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 2.2;
}
.map-placeholder small {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ===== NO RESULT / LOADING ===== */
.loading {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.no-result {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

/* ===== DETAIL PAGE ===== */
.back-btn {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s;
}
.back-btn:hover { opacity: 0.75; }

.detail-main { padding: 24px 16px 56px; }

.detail-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
}

.detail-hero {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  user-select: none;
}

.detail-info { padding: 24px 24px 28px; }

.detail-name {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.detail-badge.featured {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.detail-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.7;
}

.detail-rows {
  border-top: 1px solid var(--border);
}
.detail-row {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.detail-label {
  min-width: 64px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding-top: 1px;
}
.detail-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
}
.detail-value a { color: var(--primary); }
.detail-value a:hover { text-decoration: underline; }

.detail-map-wrap { margin-top: 24px; }
.detail-map-wrap h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.detail-map {
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 260px;
  background: #E8E8E8;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #2C2C2E;
  color: #8E8E93;
  padding: 28px 0 20px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.9;
}
.footer-note {
  font-size: 0.72rem;
  opacity: 0.65;
}

.footer-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

/* 사업자 정보 블록 */
.biz-info {
  font-size: 0.72rem;
  color: #8E8E93;
  line-height: 1.95;
  text-align: center;
}
.biz-info p {
  word-break: keep-all;
}
.biz-label {
  color: #AEAEB2;
  font-weight: 600;
  margin-right: 3px;
}
.biz-sep {
  display: inline-block;
  width: 1px;
  height: 0.7em;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 10px;
  vertical-align: middle;
}

/* 저작권 + 링크 하단 줄 */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 0.72rem;
  color: #636366;
}
.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}
.footer-links a {
  color: #8E8E93;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: #C7C7CC;
  text-decoration: underline;
}
.footer-links span {
  color: rgba(255, 255, 255, 0.2);
  user-select: none;
}

/* ===== INTRO SECTION (홈 가이드 소개) ===== */
.intro-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.intro-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.intro-section p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 8px;
}
.intro-section p:last-child { margin-bottom: 0; }

/* ===== LEGAL PAGES (개인정보처리방침 · 이용약관 · 문의) ===== */
.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}
.legal-wrap > h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.legal-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  display: block;
}
.legal-wrap h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 28px 0 8px;
  color: var(--text-primary);
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.legal-wrap p, .legal-wrap li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 8px;
}
.legal-wrap ul, .legal-wrap ol {
  padding-left: 20px;
  margin-bottom: 10px;
}
.legal-wrap li { margin-bottom: 3px; }
.legal-wrap strong { color: var(--text-primary); font-weight: 700; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 10px 0 16px;
  overflow-x: auto;
  display: block;
}
.legal-table th, .legal-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
  white-space: normal;
}
.legal-table th {
  background: #F5F5F7;
  font-weight: 700;
  color: var(--text-primary);
}
.legal-highlight {
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 14px;
}
.legal-highlight p { margin-bottom: 0; color: var(--text-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.45rem; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cards-row .card { min-width: 156px; max-width: 156px; }
  .card-img { height: 100px; font-size: 2rem; }
  .detail-name { font-size: 1.35rem; }
  .detail-info { padding: 18px 18px 24px; }
  .detail-hero { height: 180px; font-size: 3.5rem; }
}

@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (min-width: 768px) {
  .main-content { padding: 36px 0 56px; }
  .hero h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
