/* ============================
   기본 리셋 & 변수
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #e8390e;
  --primary-dark: #c0300b;
  --primary-light: #fff0ed;
  --text: #1a1a1a;
  --text-sub: #666;
  --border: #e8e8e8;
  --bg: #f8f8f6;
  --card-bg: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(232,57,14,0.18);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ============================
   헤더
   ============================ */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(232,57,14,0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon { font-size: 28px; }
.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 440px;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border: none;
  border-radius: 30px;
  font-size: 14px;
  background: rgba(255,255,255,0.22);
  color: #fff;
  outline: none;
  transition: background 0.2s;
}

.search-input::placeholder { color: rgba(255,255,255,0.75); }
.search-input:focus { background: rgba(255,255,255,0.32); }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}

/* ============================
   지역 탭
   ============================ */
.region-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.region-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.region-nav-inner::-webkit-scrollbar { display: none; }

.region-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.region-emoji { font-size: 22px; }

.region-btn:hover { color: var(--primary); }
.region-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============================
   광역시 서브필터
   ============================ */
.metro-filter {
  background: var(--primary-light);
  border-bottom: 1px solid #ffd5cc;
  display: none;
}

.metro-filter.visible { display: block; }

.metro-filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.metro-filter-inner::-webkit-scrollbar { display: none; }

.metro-btn {
  padding: 6px 16px;
  border: 1.5px solid #ffb8a8;
  border-radius: 20px;
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}

.metro-btn:hover, .metro-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================
   메인 콘텐츠
   ============================ */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}

#regionTitle {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.result-count {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 500;
}

/* ============================
   카드 그리드
   ============================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ============================
   맛집 카드
   ============================ */
.restaurant-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.restaurant-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: linear-gradient(135deg, #fff5f3, #ffe4de);
}

.card-body {
  padding: 16px;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.tag-region {
  background: var(--primary-light);
  color: var(--primary);
}

.tag-category {
  background: #f0f4ff;
  color: #4058e8;
}

.card-name {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
}

.card-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
}

.card-addr {
  font-size: 12px;
  color: #aaa;
  text-align: right;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================
   빈 상태
   ============================ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-sub);
}

.empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state p { font-size: 16px; }

/* ============================
   모달
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.22s ease;
}

@keyframes modalIn {
  from { transform: scale(0.93); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.08);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s;
}

.modal-close:hover { background: rgba(0,0,0,0.16); }

.modal-thumb {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  background: linear-gradient(135deg, #fff5f3, #ffe4de);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-info {
  padding: 24px;
}

.modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-name {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}

.modal-rating {
  font-size: 15px;
  color: #f59e0b;
  font-weight: 700;
  margin-bottom: 14px;
}

.modal-desc {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-details {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-detail-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
}

.modal-detail-icon { font-size: 16px; flex-shrink: 0; }
.modal-detail-label {
  font-weight: 700;
  color: var(--text-sub);
  min-width: 44px;
}

.modal-detail-value { color: var(--text); flex: 1; }

/* ============================
   푸터
   ============================ */
.site-footer {
  text-align: center;
  padding: 24px 20px;
  background: #fff;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-sub);
}

/* ============================
   카카오맵 링크
   ============================ */
.kakao-link {
  color: #3a86ff;
  text-decoration: none;
  font-weight: 600;
}
.kakao-link:hover { text-decoration: underline; }

/* ============================
   관리자 모드
   ============================ */
.admin-badge {
  background: #ffe066;
  color: #7a5c00;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.admin-edit-section {
  margin-top: 18px;
  padding: 14px 16px;
  background: #fffbe6;
  border: 1.5px dashed #f0c040;
  border-radius: 10px;
}
.admin-edit-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #7a5c00;
  margin-bottom: 8px;
}
.admin-edit-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.admin-rating-input {
  width: 90px;
  padding: 7px 10px;
  border: 1.5px solid #f0c040;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.admin-save-btn {
  background: #f0c040;
  color: #7a5c00;
  border: none;
  padding: 7px 16px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
.admin-save-btn:hover { background: #e0b020; }
.naver-check-link {
  font-size: 12px;
  color: #03c75a;
  text-decoration: none;
  font-weight: 600;
}
.naver-check-link:hover { text-decoration: underline; }

/* ============================
   반응형
   ============================ */
@media (max-width: 600px) {
  .logo-text { font-size: 17px; }
  .search-wrap { min-width: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .region-btn { padding: 12px 12px 8px; font-size: 12px; }
}
