* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2AC1BC;
  --primary-dark: #1fa8a3;
  --bg: #f5f5f5;
  --white: #ffffff;
  --text: #1a1a1a;
  --text-muted: #888;
  --border: #e8e8e8;
  --nav-height: 60px;
}

body {
  font-family: -apple-system, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

#app {
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
}

/* 바텀 네비 */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  padding: 8px 0;
}

.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 20px; }

.badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: #ff4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.hidden { display: none !important; }

/* 헤더 */
.page-header {
  background: var(--white);
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
}

.page-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 카테고리 필터 */
.category-scroll {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.category-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 가게 카드 */
.store-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }

.store-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.1s;
}

.store-card:active { transform: scale(0.98); }

.store-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.store-name { font-size: 16px; font-weight: 700; }
.store-category {
  font-size: 12px;
  color: var(--primary);
  background: #e8f9f8;
  padding: 2px 8px;
  border-radius: 10px;
}

.store-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.store-rating { color: #ff9500; font-weight: 600; }

/* 뒤로가기 헤더 */
.back-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.back-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.back-header h2 { font-size: 17px; font-weight: 700; }

/* 메뉴 섹션 */
.menu-section { padding: 0 16px 12px; }
.menu-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.menu-info { flex: 1; }
.menu-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.menu-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.menu-price { font-size: 15px; font-weight: 700; }

.menu-add-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
}

.menu-add-btn:active { background: var(--primary-dark); }

/* 장바구니 */
.cart-section { padding: 16px; }
.cart-empty { text-align: center; padding: 60px 0; color: var(--text-muted); font-size: 15px; }

.cart-item {
  background: var(--white);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border);
}

.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cart-item-price { font-size: 13px; color: var(--text-muted); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-num { font-size: 15px; font-weight: 700; min-width: 20px; text-align: center; }

.cart-summary {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-top: 12px;
  border: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.order-btn {
  width: 100%;
  margin-top: 16px;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.order-btn:disabled { background: #ccc; cursor: not-allowed; }

/* 주문내역 */
.order-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-status {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

.status-pending { background: #fff3e0; color: #e65100; }
.status-accepted { background: #e3f2fd; color: #1565c0; }
.status-preparing { background: #f3e5f5; color: #6a1b9a; }
.status-delivering { background: #e8f5e9; color: #2e7d32; }
.status-done { background: #f5f5f5; color: #616161; }

.order-code { font-size: 11px; color: var(--text-muted); }
.order-items-summary { font-size: 14px; margin-bottom: 6px; }
.order-total { font-size: 15px; font-weight: 700; }

/* 완료 페이지 */
.complete-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.complete-icon { font-size: 64px; margin-bottom: 20px; }
.complete-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.complete-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }

.home-btn {
  padding: 14px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* 로딩 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
}
