/* ============================================
   menu.css — 모바일 앱 스타일 메뉴판
   ============================================ */

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

:root {
  --primary: #FF6B35;
  --primary-dark: #e85a26;
  --primary-light: rgba(255, 107, 53, .1);
  --bg: #F7F7F8;
  --surface: #FFFFFF;
  --text: #111111;
  --text-sub: #888899;
  --border: #EBEBEB;
  --header-h: 58px;
  --cat-h: 50px;
  --cart-bar-h: 72px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Noto Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── 앱 헤더 ── */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  font-size: 24px;
}

.header-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
}

.table-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  border: 1.5px solid rgba(255, 107, 53, .25);
  border-radius: 100px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}

.table-btn:active {
  background: rgba(255, 107, 53, .2);
}

.table-btn-icon {
  font-size: 15px;
}

.table-btn-arrow {
  font-size: 18px;
  opacity: .7;
}

/* ── 카테고리 탭 ── */
.category-bar {
  position: fixed;
  top: var(--header-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 90;
  height: var(--cat-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.category-scroll {
  display: flex;
  gap: 6px;
  padding: 0 14px;
  height: 100%;
  align-items: center;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.cat-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
}

.cat-chip:active {
  transform: scale(.95);
}

.cat-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(255, 107, 53, .35);
}

/* ── 메인 스크롤 콘텐츠 ── */
.app-main {
  position: fixed;
  top: calc(var(--header-h) + var(--cat-h));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--cart-bar-h) + var(--safe-bottom) + 8px);
}

.app-main::-webkit-scrollbar {
  display: none;
}

/* 섹션 헤더 */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

/* ── 메뉴 아이템 (리스트 카드) ── */
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  margin: 0 12px 10px;
  border-radius: var(--radius-md);
  padding: 14px;
  position: relative;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .06);
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.menu-item:active {
  transform: scale(.98);
}

.menu-emoji-box {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFF0E8, #FFE4D2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
}

.menu-item-body {
  flex: 1;
  min-width: 0;
}

.menu-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.menu-item-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item-price {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
}

/* 수량 컨트롤 */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  position: absolute;
  right: 14px;
  bottom: 14px;
}

.qty-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background .15s, border-color .15s;
  font-family: inherit;
}

.qty-btn-sm.plus {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qty-btn-sm:active {
  transform: scale(.88);
}

.qty-num-sm {
  font-size: 14px;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  color: var(--text);
}

/* 담기 버튼 (수량 0일 때) */
.add-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(255, 107, 53, .4);
  transition: transform .15s;
}

.add-btn:active {
  transform: scale(.88);
}

/* 카드 선택 배지 */
.item-selected-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
  border-radius: 14px 0 0 14px;
  opacity: 0;
  transition: opacity .2s;
}

.menu-item.has-qty .item-selected-bar {
  opacity: 1;
}

/* ── 하단 장바구니 바 ── */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 200;
  height: calc(var(--cart-bar-h) + var(--safe-bottom));
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px var(--safe-bottom);
  cursor: pointer;
  box-shadow: 0 -4px 20px rgba(255, 107, 53, .3);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(100%);
  transition: transform .3s cubic-bezier(.22, .61, .36, 1), opacity .3s ease;
}

.cart-bar.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.cart-bar:active {
  background: var(--primary-dark);
}

.cart-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-bar-count {
  background: rgba(255, 255, 255, .25);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  min-width: 28px;
  height: 28px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.cart-bar-text {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.cart-bar-total {
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

/* ── 바텀시트 ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  width: 100%;
  max-width: 480px;
  z-index: 400;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  transition: transform .4s cubic-bezier(.22, .61, .36, 1);
  padding-bottom: var(--safe-bottom);
}

.bottom-sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle-wrap {
  padding: 12px 0 4px;
  display: flex;
  justify-content: center;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 18px;
  font-weight: 800;
}

.sheet-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

/* 시트 빈 상태 */
.sheet-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.8;
}

/* 시트 아이템 */
.sheet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  animation: fadeUp .2s ease;
}

.sheet-item-emoji {
  font-size: 28px;
}

.sheet-item-info {
  flex: 1;
}

.sheet-item-name {
  font-size: 14px;
  font-weight: 700;
}

.sheet-item-price {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 2px;
}

.sheet-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 100px;
  padding: 4px 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

.sqty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}

.sqty-btn.plus {
  background: var(--primary);
  color: #fff;
}

.sqty-btn:active {
  transform: scale(.88);
}

.sqty-num {
  font-size: 14px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
}

.sheet-footer {
  padding: 16px 16px 0;
  border-top: 1px solid var(--border);
}

.sheet-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-sub);
}

.sheet-total-row strong {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
}

.btn-order {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(255, 107, 53, .4);
  transition: transform .15s;
}

.btn-order:active {
  transform: scale(.97);
}

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

/* ── 모달 (테이블 선택 + 주문 확인) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.app-modal {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 16px 20px calc(20px + var(--safe-bottom));
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.22, .61, .36, 1);
}

.modal-overlay.open .app-modal {
  transform: translateY(0);
}

.modal-drag {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--border);
  margin: 0 auto 18px;
}

.modal-title {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 18px;
}

/* 테이블 그리드 */
.table-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  padding-bottom: 8px;
}

.table-num-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-num-btn:active {
  transform: scale(.9);
}

.table-num-btn.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 주문 확인 모달 */
.confirm-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 8px;
}

.confirm-table {
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
  margin-bottom: 16px;
}

.confirm-table strong {
  color: var(--primary);
  font-size: 18px;
  font-weight: 900;
}

.confirm-items {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.confirm-item-row span:last-child {
  font-weight: 700;
  color: var(--primary);
}

.confirm-total {
  text-align: center;
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.confirm-total strong {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-left: 6px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-cancel {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-sub);
}

.btn-confirm {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.btn-confirm:active {
  transform: scale(.97);
}

/* 성공 모달 */
.success-modal {
  text-align: center;
}

.success-anim {
  font-size: 64px;
  margin-bottom: 14px;
  animation: bounce .6s ease;
}

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

.success-modal p {
  color: var(--text-sub);
  margin-bottom: 24px;
}

.success-modal .btn-confirm {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-md);
  font-size: 17px;
}

/* ── 데스크탑에서 앱처럼 보이기 ── */
@media (min-width: 480px) {

  .app-header,
  .category-bar,
  .app-main,
  .cart-bar,
  .bottom-sheet,
  .modal-overlay {
    max-width: 480px;
  }
}

/* ── 애니메이션 ── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-14px);
  }

  60% {
    transform: translateY(-6px);
  }
}