/* ============================================================
   QpayMoney 고객 모바일웹 — 깔끔/모던 (카페·분식)
   디자인 토큰
   - 배경: 따뜻한 화이트 #FBFBF9 / 카드 #FFFFFF
   - 먹색 텍스트: #1C1C1A
   - 포인트(브랜드): 선명한 코랄 #FF5A3C  (식욕을 돋우는 따뜻한 주황)
   - 보조 포인트: 딥그린 #1F7A55 (판매중/긍정)
   - 라인/회색: #ECEAE4
   타입: 제목은 두꺼운 산세리프, 본문은 시스템 한글 산세리프
   ============================================================ */

:root {
  --bg: #FBFBF9;
  --card: #FFFFFF;
  --ink: #1C1C1A;
  --ink-soft: #6B6B66;
  --brand: #FF5A3C;
  --brand-dark: #E8462B;
  --green: #1F7A55;
  --line: #ECEAE4;
  --sold: #B6B4AD;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(28, 28, 26, 0.06);
  --shadow-lg: 0 8px 30px rgba(28, 28, 26, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Pretendard', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ── 헤더 ── */
header.app-header {
  background: var(--card);
  padding: 18px 20px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}
header.app-header .store {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
header.app-header .table {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
header.app-header .table::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}

/* ── 카테고리 탭 ── */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 20px;
  position: sticky;
  top: 64px;
  background: var(--bg);
  z-index: 9;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  cursor: pointer;
}
.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── 메뉴 카드 ── */
.menu-list { padding: 4px 16px 0; }
.menu {
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.menu:active { transform: scale(0.99); }

.menu .thumb {
  width: 76px; height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFF1ED, #FFE3DB);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.menu .body { flex: 1; min-width: 0; }
.menu .name {
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu .badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  background: #FFF1ED;
  color: var(--brand-dark);
  letter-spacing: 0.02em;
}
.menu .desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.menu .price {
  font-size: 15px;
  font-weight: 800;
  margin-top: 8px;
}
.menu .price .won { font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-left: 1px; }

.menu .add {
  background: var(--brand);
  color: #fff;
  border: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  font-size: 22px;
  font-weight: 400;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: 0 2px 8px rgba(255, 90, 60, 0.3);
}
.menu .add:active { background: var(--brand-dark); transform: scale(0.92); }

/* 품절 */
.menu.sold { opacity: 0.85; }
.menu.sold .thumb { filter: grayscale(1); background: #F0EFEC; }
.menu.sold .name, .menu.sold .desc { color: var(--sold); }
.menu .sold-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--sold);
  margin-top: 8px;
}

/* ── 하단 장바구니 바 ── */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--ink);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.cart-bar.show { transform: translateY(0); }
.cart-bar .summary { font-size: 14px; }
.cart-bar .summary .count {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 999px;
  margin-right: 8px;
  padding: 0 6px;
}
.cart-bar .summary .total { font-weight: 800; font-size: 16px; }
.cart-bar .pay-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.cart-bar .pay-btn:active { background: var(--brand-dark); }

/* ── 옵션 선택 바텀시트 ── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 26, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 51;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
  max-height: 82vh;
  overflow-y: auto;
}
.sheet.show { transform: translateY(0); }
.sheet .grip {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 8px auto 16px;
}
.sheet .sheet-name { font-size: 20px; font-weight: 800; }
.sheet .sheet-desc { font-size: 13px; color: var(--ink-soft); margin: 6px 0 18px; line-height: 1.5; }

.opt-group { margin-bottom: 20px; }
.opt-group h4 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.opt-group h4 .req {
  font-size: 10px;
  font-weight: 800;
  color: var(--brand-dark);
  background: #FFF1ED;
  padding: 2px 6px;
  border-radius: 5px;
}
.opt-group h4 .opt-mark {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--line);
  padding: 2px 6px;
  border-radius: 5px;
}
.opt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.opt-row:last-child { border-bottom: none; }
.opt-row .opt-label { font-size: 15px; font-weight: 500; }
.opt-row .opt-right { display: flex; align-items: center; gap: 12px; }
.opt-row .opt-price { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.opt-row .mark {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}
.opt-row.checkbox .mark { border-radius: 7px; }
.opt-row.selected .mark {
  background: var(--brand);
  border-color: var(--brand);
}
.opt-row.selected .mark::after {
  content: '';
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px);
}
.opt-row.selected .opt-label { font-weight: 700; }

/* 수량 스테퍼 */
.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 20px;
}
.qty-row .qty-label { font-size: 15px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper button {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:active { background: var(--bg); }
.stepper .qty-val { font-size: 17px; font-weight: 800; min-width: 24px; text-align: center; }

.sheet .add-cart-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 90, 60, 0.3);
}
.sheet .add-cart-btn:active { background: var(--brand-dark); }
.sheet .add-cart-btn:disabled { background: var(--sold); box-shadow: none; }

/* ── 장바구니 바텀시트 ── */
.cart-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  z-index: 51;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.85, 0.2, 1);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.cart-sheet.show { transform: translateY(0); }
.cart-sheet .grip {
  width: 40px; height: 4px;
  background: var(--line);
  border-radius: 999px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.cart-sheet .cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-sheet .cart-head h3 { font-size: 18px; font-weight: 800; margin: 0; }
.cart-sheet .clear-btn {
  background: none; border: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.cart-items {
  overflow-y: auto;
  padding: 6px 20px;
  flex: 1;
}
.cart-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-item .ci-edit {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-dark);
  background: #FFF1ED;
  border: none;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.cart-item .ci-edit:active { background: #FFD9CE; }
.cart-item .ci-opts {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.5;
}
.cart-item .ci-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.cart-item .ci-price { font-size: 15px; font-weight: 800; }
.ci-stepper { display: flex; align-items: center; gap: 14px; }
.ci-stepper button {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ci-stepper button:active { background: var(--bg); }
.ci-stepper button.del { color: var(--brand); border-color: #FFD9CE; }
.ci-stepper .ci-qty { font-size: 16px; font-weight: 800; min-width: 22px; text-align: center; }
.cart-foot {
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-foot .ft-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.cart-foot .ft-total .lbl { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.cart-foot .ft-total .amt { font-size: 22px; font-weight: 800; }
.cart-foot .pay-btn-full {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 90, 60, 0.3);
}
.cart-foot .pay-btn-full:active { background: var(--brand-dark); }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 50px 0; font-size: 14px; }

/* ── 주문 현황판 ── */
.status-view { padding: 40px 24px; text-align: center; }
.status-view .status-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #FFF1ED;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.status-view h2 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.status-view .status-sub { font-size: 13px; color: var(--ink-soft); }

.progress {
  display: flex;
  justify-content: space-between;
  margin: 36px 8px 0;
  position: relative;
}
.progress::before {
  content: '';
  position: absolute;
  top: 13px; left: 14%; right: 14%;
  height: 2px;
  background: var(--line);
  z-index: 0;
}
.progress .step {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
}
.progress .step .dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--line);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--sold);
  transition: all 0.3s ease;
}
.progress .step .label { font-size: 12px; color: var(--sold); font-weight: 600; }
.progress .step.on .dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.progress .step.on .label { color: var(--ink); font-weight: 700; }

.reorder-btn {
  margin-top: 32px;
  padding: 14px 28px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.reorder-btn:active { background: var(--bg); }

/* 접근성: 모션 줄이기 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
