/* =============================================
   테이블 오더 - 메인 스타일시트
   Font: Paperlogy | Icon: XEIcon
   Grid: PC 4col / Tablet 3col / Mobile 1col
   ============================================= */

/* ── CSS 변수 ── */
:root {
    --primary:       #e83030;
    --primary-dark:  #c22020;
    --primary-light: #ff5252;
    --primary-glow:  rgba(232, 48, 48, 0.18);

    --bg-base:       #0d0d0d;
    --bg-card:       rgba(22, 22, 22, 0.96);
    --bg-sidebar:    rgba(10, 10, 10, 0.98);
    --bg-modal:      #141414;
    --bg-overlay:    rgba(0, 0, 0, 0.78);

    --text-white:    #f5f5f5;
    /* 다크모드 보조 텍스트는 한 단계씩 밝게 — 기존 #cccccc/#999999/#666666 은
       어두운 배경에서 잘 읽히지 않아 전 페이지에서 상향 조정했다. */
    --text-light:    #dddddd;
    --text-gray:     #cccccc;
    --text-muted:    #bbbbbb;

    --border:        rgba(255, 255, 255, 0.07);
    --border-active: rgba(232, 48, 48, 0.45);

    --sidebar-width:  210px;
    --cart-width:     340px;
    --topbar-height:  58px;
    --bottombar-height: 64px;
    --radius:         14px;
    --radius-sm:      8px;
    --transition:     0.22s ease;
}

/* ── 리셋 ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-white);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    word-break: keep-all;
}

body {
    background-color: var(--bg-base);
    background-image: url('../img/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ── 배경 어둡게 덮는 베일 (가독성 유지) ── */
#full-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.5);
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* ── 앱 최상위 ── */
#app {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    max-width: 1920px;
    margin: 0 auto;
    overflow: hidden;
}


/* ═══════════════════════════════════════════
   상단 바
═══════════════════════════════════════════ */
#top-bar {
    position: relative;
    z-index: 20;
    height: var(--topbar-height);
    background: rgba(8, 8, 8, 0.3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px 0 20px;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.top-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#btn-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}
#btn-menu-toggle:hover { background: rgba(255,255,255,0.12); }

#btn-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 21px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    opacity: .7;
    transition: opacity .2s;
}
#btn-home:hover { opacity: 1; }

#container_title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#container_title span { color: inherit; }

.category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 10px;
}
.category-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 3px;
    flex-shrink: 0;
}

.table-badge {
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 30px;
    letter-spacing: 0.3px;
}

/* 웨이팅 상단 아이콘 버튼 */
.waiting-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.15);
    transition: background 0.15s;
    margin-right: 6px;
}
.waiting-icon-btn i { font-size: 14px; }
.waiting-icon-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* 사이드바 웨이팅 버튼 */
.waiting-sb-btn {
    width: 100%;
    grid-column: 1 / -1;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    background: rgba(99,179,237,0.18) !important;
    border-color: rgba(99,179,237,0.55) !important;
    color: #bfdcff !important;
    font-weight: 700;
}
.waiting-sb-btn i { color: #bfdcff !important; }
.waiting-sb-btn:hover {
    background: rgba(99,179,237,0.30) !important;
    color: #fff !important;
}
.waiting-sb-btn:hover i { color: #fff !important; }
html[data-theme="light"] .waiting-sb-btn {
    background: rgba(37,99,235,0.12) !important;
    border-color: rgba(37,99,235,0.45) !important;
    color: #1d4ed8 !important;
}
html[data-theme="light"] .waiting-sb-btn i { color: #1d4ed8 !important; }
html[data-theme="light"] .waiting-sb-btn:hover {
    background: rgba(37,99,235,0.80) !important;
    color: #fff !important;
}
html[data-theme="light"] .waiting-sb-btn:hover i { color: #fff !important; }


/* ═══════════════════════════════════════════
   메인 레이아웃
═══════════════════════════════════════════ */
#main-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}


/* ═══════════════════════════════════════════
   사이드바
═══════════════════════════════════════════ */
#sidebar {
    width: var(--sidebar-width);
    background: transparent;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 5;
    scrollbar-width: none;
}
#sidebar::-webkit-scrollbar { display: none; }

/* 모바일 사이드바 닫기 (PC에서는 숨김) */
.sidebar-close {
    display: none;
}

.logo-area {
    padding: 14px 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.store-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 15px;
    overflow: hidden;
    background: #1a1a1a;
    flex-shrink: 0;
}
.store-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.store-photo.no-photo { display: none; }

.logo-text {
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    color: var(--text-white);
    line-height: 1.4;
    letter-spacing: -0.2px;
}

/* 사이드바 내부를 세로 flex 로 → nav-list 가 늘어나며 계정영역을 하단 고정 */
.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.nav-list {
    list-style: none;
    padding: 12px 0;
    flex: 1;
}

/* ── 사이드바 계정 영역 (로그인/회원가입/정보수정/로그아웃) ── */
.sidebar-account {
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.sb-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    margin: 0 0 10px;
    padding: 0 2px;
}
.sb-user i { color: var(--primary); font-size: 15px; }
.sb-user strong { color: var(--text-white); font-weight: 700; }

/* 사이드바 게시판 메뉴 (공지/후기/상담) — 항상 표시 */
.sb-board-nav {
    margin: 0 0 12px;
}
.sb-board-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sb-board-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition);
}
.sb-board-link i {
    font-size: 15px;
    color: var(--primary);
    flex-shrink: 0;
}
.sb-board-link:hover,
.sb-board-link.on {
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.30);
    color: var(--text-white);
}
html[data-theme="light"] .sb-board-link {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.10);
    color: #333;
}
html[data-theme="light"] .sb-board-link:hover,
html[data-theme="light"] .sb-board-link.on {
    background: rgba(0, 0, 0, 0.08);
    color: #111;
}

.sb-acc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.sb-acc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 8px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
}
.sb-acc-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: var(--text-white);
}
html[data-theme="light"] .sb-acc-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.14);
    color: #333;
}
html[data-theme="light"] .sb-acc-btn:hover {
    background: rgba(0, 0, 0, 0.10);
    color: #111;
}
.sb-acc-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.sb-acc-btn.primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: #fff !important;
}

/* 관리자 전용 버튼 (메뉴관리 / 관리자) */
.sb-admin-grid { margin-top: 8px; }
.sb-acc-btn.admin {
    gap: 5px;
    background: rgba(232, 48, 48, 0.10);
    border-color: rgba(232, 48, 48, 0.35);
    color: var(--primary-light);
}
.sb-acc-btn.admin i { font-size: 14px; }
.sb-acc-btn.admin:hover {
    background: rgba(220, 38, 38, 0.85);
    color: #fff;
}
/* 매장 운영 버튼 — 대기관리 · 콜관리 (회원 레벨 5 이상) */
.sb-acc-btn.admin.staff {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.38);
    color: #22d3ee;
}
.sb-acc-btn.admin.staff i { color: #22d3ee !important; }
/* 짝이 없을 때(콜관리만 노출) 한 줄 전체 차지 */
.sb-acc-btn.admin.staff.wide { grid-column: 1 / -1; }
.sb-acc-btn.admin.staff:hover {
    background: #0e7490;
    border-color: #0e7490;
    color: #fff;
}
.sb-acc-btn.admin.staff:hover i { color: #fff !important; }
html[data-theme="light"] .sb-acc-btn.admin.staff {
    background: rgba(8, 145, 178, 0.10);
    border-color: rgba(8, 145, 178, 0.35);
    color: #0e7490;
}
html[data-theme="light"] .sb-acc-btn.admin.staff i { color: #0e7490 !important; }
html[data-theme="light"] .sb-acc-btn.admin.staff:hover {
    background: #164e63;
    border-color: #164e63;
    color: #fff;
}
html[data-theme="light"] .sb-acc-btn.admin.staff:hover i { color: #fff !important; }

/* 주방 관리 버튼 (회원 레벨 6 이상) */
.sb-acc-btn.admin.kitchen {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}
.sb-acc-btn.admin.kitchen i { color: #4ade80 !important; }
.sb-acc-btn.admin.kitchen:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}
.sb-acc-btn.admin.kitchen:hover i { color: #fff !important; }
html[data-theme="light"] .sb-acc-btn.admin.kitchen {
    background: rgba(22, 163, 74, 0.10);
    border-color: rgba(22, 163, 74, 0.35);
    color: #15803d;
}
html[data-theme="light"] .sb-acc-btn.admin.kitchen i { color: #15803d !important; }
/* 라이트모드 hover: 배경을 진한 그린으로 깔아야 흰 글자가 보인다
   (light 기본 규칙이 hover 규칙보다 우선순위가 높아 배경을 반드시 다시 지정) */
html[data-theme="light"] .sb-acc-btn.admin.kitchen:hover {
    background: #14532d;
    border-color: #14532d;
    color: #fff;
}
html[data-theme="light"] .sb-acc-btn.admin.kitchen:hover i { color: #fff !important; }

.sb-acc-btn.admin.dashboard {
    background: rgba(48, 120, 232, 0.10);
    border-color: rgba(48, 120, 232, 0.35);
    color: #5b9bd5;
    width: 100%;
    justify-content: center;
}
.sb-acc-btn.admin.dashboard:hover {
    background: rgba(29, 78, 216, 0.85);
    color: #fff;
}

.nav-list li {
    width: 100%;
    padding: 0 12px;
    margin-bottom: 9px;
}

.nav-btn {
    width: 100%;
    padding: 13px 14px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 12px;
    color: #222;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: all var(--transition);
}
.nav-btn i {
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.55;
}
.nav-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}
.nav-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 12px rgba(232, 48, 48, 0.5);
}
.nav-btn.active i { opacity: 1; color: #fff; }
.nav-btn.nav-link { text-decoration: none; }
.nav-btn.nav-link i { color: #e83030; opacity: 1; }
/* 다크모드 a 색상(#e0e0e0)이 밝은 버튼을 덮어쓰지 않도록 우선순위 고정 */
html[data-theme="dark"] .nav-list .nav-btn.nav-link,
html[data-theme="light"] .nav-list .nav-btn.nav-link { color: #222 !important; }


/* ═══════════════════════════════════════════
   메뉴 콘텐츠
═══════════════════════════════════════════ */
#content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 32px;
    padding-bottom: calc(var(--bottombar-height) + 24px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    min-width: 0;
}
#content::-webkit-scrollbar { width: 5px; }
#content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* 게시판 등 일반 페이지 스크롤 본문 (#content 와 동일하되 app.js 가 건드리지 않음) */
#board-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 36px;
    padding-bottom: calc(var(--bottombar-height) + 32px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    min-width: 0;
}
#board-content::-webkit-scrollbar { width: 5px; }
#board-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 4px;
}

/* 섹션 */
.menu-section { margin-bottom: 144px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    padding-left: 10px;
    padding-top: 14px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.55);
    border-radius: var(--radius);
}
.section-bar {
    display: block;
    width: 5px;
    height: 24px;
    background: var(--primary);
    border-radius: 3px;
    flex-shrink: 0;
}
.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.3px;
}

/* 라이트 모드 section-header */
html[data-theme="light"] .section-header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* ── 메뉴 그리드: PC 4열 ── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}


/* ═══════════════════════════════════════════
   메뉴 카드
═══════════════════════════════════════════ */
.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}
.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    border-color: var(--border-active);
}
.menu-card:active { transform: translateY(-1px); }

/* 카드 이미지 */
.card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/4;
    overflow: hidden;
    background: #1c1c1c;
    flex-shrink: 0;
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.menu-card:hover .card-img { transform: scale(1.04); }

.no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #272727 100%);
    color: var(--text-muted);
    font-size: 48px;
}

/* 태그 */
.tags {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 80%;
}
.tag {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 20px;
    line-height: 1;
    backdrop-filter: blur(4px);
}
.tag-대표  { background: var(--primary);            color: #fff; }
.tag-추천  { background: #e07020;                   color: #fff; }
.tag-인기  { background: #7b52ab;                   color: #fff; }
.tag-이벤트 { background: #1f9e5f;                  color: #fff; }
.tag-주류음료 { background: #b8860b;                color: #fff; }

/* 카드 본문 */
.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.2px;
}
.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.card-price {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-white);
    letter-spacing: -0.5px;
}
.card-price em {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-gray);
    font-style: normal;
    margin-left: 2px;
}
.card-add {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}
.card-add:hover { background: var(--primary-dark); transform: scale(1.1); }


/* ═══════════════════════════════════════════
   PC 장바구니 패널 (오른쪽)
═══════════════════════════════════════════ */
#cart-panel {
    width: var(--cart-width);
    flex-shrink: 0;
    background: rgba(10, 10, 10, 0.3);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.cp-header > i {
    font-size: 22px;
    color: var(--primary-light);
}
.cp-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-white);
    flex: 1;
}
.cp-badge {
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.cp-body::-webkit-scrollbar { width: 4px; }
.cp-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.cp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: rgba(255, 255, 255, 0.85);
    gap: 14px;
}
.cp-empty i { font-size: 52px; color: rgba(255, 255, 255, 0.7); }
.cp-empty p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

/* 패널 내 장바구니 아이템 */
.cp-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.cp-item-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: #222;
}
.cp-item-img-ph {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: #222;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 22px;
}
.cp-item-info { flex: 1; min-width: 0; }
.cp-item-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
    line-height: 1.3;
}
.cp-item-opts {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.5;
}
.cp-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cp-item-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-white);
}
.cp-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cp-qty button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.07);
    color: var(--text-white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.cp-qty button:hover { background: rgba(255,255,255,0.15); }
.cp-qty span {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.cp-item-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    transition: color var(--transition);
    align-self: flex-start;
}
.cp-item-del:hover { color: var(--primary); }

/* 패널 하단 */
.cp-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.cp-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding: 0 2px;
}
.cp-total-label {
    font-size: 14px;
    color: var(--text-light);
}
.cp-total-price {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-light);
    letter-spacing: -0.5px;
}
.btn-order-panel {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--transition);
    letter-spacing: -0.2px;
}
.btn-order-panel:hover { background: var(--primary-dark); }
.btn-order-panel:disabled { background: #333; color: #666; cursor: not-allowed; }


/* ═══════════════════════════════════════════
   하단 바
═══════════════════════════════════════════ */
#bottom-bar {
    position: relative;
    z-index: 20;
    height: var(--bottombar-height);
    background: rgba(6, 6, 6, 0.3);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-staff {
    height: 100%;
    min-width: 110px;
    background: var(--primary);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background var(--transition);
    padding: 0 18px;
    flex-shrink: 0;
}
.btn-staff i { font-size: 20px; }
.btn-staff:hover { background: var(--primary-dark); }

.store-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 12px;
}
.store-info strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
}
.store-info em {
    font-size: 12px;
    font-style: normal;
    color: rgba(255, 255, 255, 0.8);
}

.bottom-actions {
    display: flex;
    height: 100%;
    flex-shrink: 0;
}

.btn-orders,
.btn-cart {
    height: 100%;
    min-width: 100px;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background var(--transition);
    padding: 0 14px;
    position: relative;
}
.btn-orders i, .btn-cart i { font-size: 22px; }
.btn-orders:hover { background: rgba(255,255,255,0.06); }

.btn-cart {
    background: rgba(232, 48, 48, 0.12);
}
.btn-cart:hover { background: rgba(232, 48, 48, 0.22); }

.cart-count, .order-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes cartShake {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-14deg); }
    40% { transform: rotate(14deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
}
.cart-shake { animation: cartShake 0.5s ease; }


/* ═══════════════════════════════════════════
   모달 공통
═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--bg-overlay);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-sheet {
    width: 100%;
    max-width: 560px;
    max-height: min(92vh, 92dvh);
    background: var(--bg-modal);
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
    width: 44px;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    margin: 0 auto;
    padding: 14px 24px;
    box-sizing: content-box;
    flex-shrink: 0;
    cursor: grab;
    background-clip: content-box;
}
.modal-handle:active { cursor: grabbing; }

.modal-header {
    padding: 16px 22px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 19px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-white);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.15); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.modal-footer {
    padding: 0px 20px 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════
   메뉴 상세 모달
═══════════════════════════════════════════ */
.menu-detail-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #1c1c1c;
}
.menu-detail-img-ph {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a1a, #252525);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    color: #2a2a2a;
}

.menu-info {
    padding: 20px 22px 18px;
    border-bottom: 1px solid var(--border);
}
.menu-info h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.4px;
    line-height: 1.3;
}
.base-price {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-white);
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}
.base-price em {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-gray);
    font-style: normal;
    margin-left: 3px;
}
.description {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.7;
}
.menu-extra-images {
    margin-top: 14px;
}
.menu-extra-images .menu-extra-fig,
.description .menu-extra-fig {
    margin: 14px 0 0;
    padding: 0;
    text-align: center;
}
.menu-extra-images .menu-extra-fig:first-child {
    margin-top: 0;
}
.menu-extra-images .menu-extra-img,
.description .menu-extra-img {
    display: block;
    width: 100%;
    margin: 0 auto;
    border-radius: 10px;
    object-fit: cover;
    max-height: 280px;
}
.menu-extra-images .menu-extra-cap,
.description .menu-extra-cap {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
    text-align: center;
}

/* 옵션 */
.option-group {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.option-group h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}
.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
}
.option-item:last-child { border-bottom: none; }
.option-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}
.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.opt-name {
    font-size: 15px;
    color: var(--text-white);
    font-weight: 500;
}
.opt-price {
    font-size: 14px;
    color: var(--primary-light);
    font-weight: 700;
}

/* 수량 */
.qty-control {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.qty-control > span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
}
.qty-btns {
    display: flex;
    align-items: center;
    gap: 18px;
}
.qty-btns button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.08);
    color: var(--text-white);
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.qty-btns button:hover { background: rgba(255,255,255,0.16); }
.qty-num {
    font-size: 22px;
    font-weight: 800;
    min-width: 32px;
    text-align: center;
    color: var(--text-white);
    background: none;
    border: none;
    cursor: default;
}

/* 담기 버튼 */
.btn-add-cart {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background var(--transition);
    letter-spacing: -0.2px;
}
.btn-add-cart i { font-size: 20px; }
.btn-add-cart:hover { background: var(--primary-dark); }
.total-price { font-size: 16px; opacity: 0.92; }


/* ═══════════════════════════════════════════
   장바구니 모달 (모바일/태블릿)
═══════════════════════════════════════════ */
.cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.cart-empty .empty-icon { font-size: 56px; margin-bottom: 18px; opacity: 0.45; }
.cart-empty p { font-size: 16px; }

.cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.cart-item-img {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: #1c1c1c;
}
.cart-item-img-placeholder {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    background: #222;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #555;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-opts {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}
.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-item-price { font-size: 16px; font-weight: 800; }

.cart-qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-qty-control button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.07);
    color: var(--text-white);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.cart-qty-control button:hover { background: rgba(255,255,255,0.15); }
.cart-qty-control span {
    font-size: 16px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}
.cart-item-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color var(--transition);
}
.cart-item-del:hover { color: var(--primary); }

.cart-total {
    padding: 14px 0px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.cart-total span:first-child { font-size: 15px; color: var(--text-light); }
.total-amount {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary-light);
    letter-spacing: -0.5px;
}

.btn-order {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-order:hover { background: var(--primary-dark); }
.btn-order:disabled { background: #333; cursor: not-allowed; }

.btn-pay {
    width: 100%;
    padding: 16px;
    background: #2563eb;
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.btn-pay:hover { background: #1d4ed8; }
.btn-pay:disabled { background: #555; cursor: not-allowed; }

/* 주문자 이름 입력 */
.order-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.order-name-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}
.order-name-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-white);
}
.order-name-input {
    flex: 1;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    padding: 7px 11px;
    outline: none;
    transition: border-color var(--transition);
}
.order-name-input:focus { border-color: var(--primary); }
.order-name-input::placeholder { color: var(--text-muted); }


/* ═══════════════════════════════════════════
   주문내역 모달
═══════════════════════════════════════════ */
.order-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.order-item-left { flex: 1; }
.order-item-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.order-item-opts { font-size: 12px; color: var(--text-light); }
.order-status-badge {
    display: inline-block;
    background: rgba(31, 158, 95, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
}
.order-item-right { text-align: right; flex-shrink: 0; }
.order-item-qty { font-size: 12px; color: var(--text-light); margin-bottom: 2px; }
.order-item-price { font-size: 16px; font-weight: 800; }

/* 주문접수 배지 + 취소버튼 한 줄 정렬 */
.order-item-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.order-item-bottom .order-status-badge { margin-top: 0; }
.order-item-bottom .paid-badge {
    display: inline-block;
    line-height: 1.6;
    vertical-align: middle;
}

/* 주문취소 버튼 */
.btn-order-cancel {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    transition: background 0.15s, color 0.15s;
    line-height: 1.6;
}
.btn-order-cancel:hover { background: rgba(239, 68, 68, 0.35); color: #fff; }
.btn-order-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

/* 주방 상태별 배지 색상 */
.kitchen-주문접수  { background: rgba(255,193,7,.15);  color: #ffc107; border-color: rgba(255,193,7,.3); }
.kitchen-조리준비  { background: rgba(255,152,0,.15);  color: #ff9800; border-color: rgba(255,152,0,.3); }
.kitchen-조리시작  { background: rgba(33,150,243,.15); color: #2196f3; border-color: rgba(33,150,243,.3); }
.kitchen-조리완료  { background: rgba(76,175,80,.15);  color: #4caf50; border-color: rgba(76,175,80,.3); }
.kitchen-서빙중    { background: rgba(156,39,176,.15); color: #9c27b0; border-color: rgba(156,39,176,.3); }

/* 주문 그룹 */
.order-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 12px 16px;
    overflow: hidden;
}
.order-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid var(--border);
}
.order-group-no { font-size: 12px; color: var(--text-light); font-family: monospace; }
.order-group-time { font-size: 12px; color: var(--text-light); }
.paid-badge {
    font-size: 12px; font-weight: 700;
    /* 흰 글씨 대비를 위해 진한 그린 (기존 #2ecc71 은 너무 밝아 글자가 묻힘) */
    background: #15803d; color: #fff;
    padding: 2px 8px; border-radius: 20px;
}
html[data-theme="light"] .paid-badge { background: #166534; }
.order-group.paid { opacity: 0.96; }
.btn-pay:disabled { background: #2ecc71; cursor: default; opacity: 1; }
.order-group .order-item { border-bottom: 1px solid var(--border); padding: 12px 14px; }
.order-group .order-item:last-of-type { border-bottom: none; }
.order-group-subtotal {
    padding: 8px 14px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-light);
    background: rgba(255,255,255,0.03);
    border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════
   직원호출 모달
═══════════════════════════════════════════ */
.staff-desc {
    padding: 14px 22px 4px;
    font-size: 14px;
    color: var(--text-muted);
}
/* 다크모드에서는 조금 더 밝게 */
html[data-theme="dark"] .staff-desc { color: #bbb; }
.staff-call-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 20px 20px;
}
.btn-staff-item {
    padding: 16px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.4;
}
.btn-staff-item i { font-size: 18px; }
.btn-staff-item:hover,
.btn-staff-item.selected {
    background: var(--primary-glow);
    border-color: var(--border-active);
    color: var(--primary-light);
}
.btn-staff-confirm {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--transition);
}
.btn-staff-confirm:hover { background: var(--primary-dark); }


/* ═══════════════════════════════════════════
   토스트
═══════════════════════════════════════════ */
#toast-container {
    position: fixed;
    top: 74px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: rgba(20, 20, 20, 0.96);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f0f0f0;
    padding: 13px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.6);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
    white-space: nowrap;
    letter-spacing: -0.2px;
}
.toast.success { border-color: rgba(46, 204, 113, 0.45); }
.toast.error   { border-color: rgba(232, 48, 48, 0.45); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}


/* ═══════════════════════════════════════════
   반응형 - 태블릿 (768px ~ 1279px)
═══════════════════════════════════════════ */
@media (max-width: 1279px) {
    :root {
        --sidebar-width: 170px;
    }

    /* 태블릿에서 오른쪽 장바구니 패널 숨기기 */
    #cart-panel { display: none; }

    #top-bar { padding: 0 22px 0 16px; }
    #content { padding: 22px 22px; padding-bottom: calc(var(--bottombar-height) + 18px); }

    /* 태블릿 3열 */
    .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }

    .card-name { font-size: 14px; }
    .card-price { font-size: 16px; }
    .section-header h2 { font-size: 18px; }
}


/* ═══════════════════════════════════════════
   반응형 - 모바일 (최대 767px)
═══════════════════════════════════════════ */
@media (max-width: 767px) {
    :root {
        --topbar-height: 50px;
        --bottombar-height: 60px;
    }

    #btn-menu-toggle { display: flex; }

    /* 사이드바 → 오버레이 드로어 */
    #sidebar {
        position: fixed;
        left: -210px;
        top: 0;
        bottom: 0;
        width: 210px;
        z-index: 200;
        background: #121212;
        transition: left 0.3s ease;
        box-shadow: none;
        overflow: visible;
    }
    #sidebar.open { left: 0; }

    #sidebar .sidebar-inner {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
    }
    #sidebar .sidebar-inner::-webkit-scrollbar { display: none; }

    .sidebar-close {
        display: none;
        position: absolute;
        left: 100%;
        top: calc(14px + env(safe-area-inset-top, 0px));
        margin-left: 10px;
        z-index: 201;
        width: 36px;
        height: 36px;
        background: rgba(0, 0, 0, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        color: #fff;
        font-size: 18px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: background var(--transition);
        backdrop-filter: blur(4px);
    }
    #sidebar.open > .sidebar-close {
        display: flex;
    }
    .sidebar-close i { color: #fff; }
    .sidebar-close:hover { background: rgba(0, 0, 0, 0.75); }

    #sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 199;
        background: rgba(0,0,0,0.65);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    #sidebar-overlay.open { opacity: 1; pointer-events: all; }

    #content {
        padding: 14px 12px;
        padding-bottom: calc(var(--bottombar-height) + 16px);
    }

    /* 모바일 2열 - 세로형 카드 */
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .menu-card {
        flex-direction: column;
        align-items: stretch;
    }
    .card-img-wrap {
        width: 100%;
        aspect-ratio: 4 / 3;
        flex-shrink: 0;
    }
    .card-img {
        height: 100%;
        min-height: unset;
    }
    .no-img {
        height: 100%;
        min-height: unset;
        font-size: 30px;
    }
    .tags {
        top: 8px;
        left: 8px;
    }
    .tag { font-size: 12px; padding: 3px 7px; }

    .card-body {
        flex: 1;
        padding: 11px 12px 13px;
        gap: 8px;
    }
    .card-name { font-size: 14px; }
    .card-price { font-size: 17px; }

    /* 하단 바 모바일 */
    .btn-staff { min-width: 80px; font-size: 12px; padding: 0 12px; }
    .btn-staff i { font-size: 18px; }
    .store-info { padding: 0 6px; }
    .store-info strong { font-size: 12px; }
    .store-info em { font-size: 12px; }
    .btn-orders, .btn-cart { min-width: 80px; font-size: 12px; padding: 0 10px; }
    .btn-orders i, .btn-cart i { font-size: 20px; }

    .category-title { font-size: 15px; }
    .table-badge { font-size: 12px; padding: 5px 12px; }

    /* 모바일: vh 오차·노치로 모달 상단이 잘리는 현상 방지 */
    .modal-overlay {
        padding-top: env(safe-area-inset-top, 0px);
        align-items: flex-end;
    }
    .modal-sheet {
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
        max-height: calc(100svh - env(safe-area-inset-top, 0px) - 12px);
    }
    .modal-handle {
        margin-top: 10px;
    }
    .modal-header {
        padding-top: 14px;
    }
}


/* ═══════════════════════════════════════════
   가로모드 (landscape, 소형 기기)
═══════════════════════════════════════════ */
@media (orientation: landscape) and (max-width: 767px) {
    :root { --topbar-height: 44px; --bottombar-height: 52px; }
    #content { padding: 12px 16px; padding-bottom: calc(var(--bottombar-height) + 12px); }
    .menu-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .menu-card { flex-direction: column; }
    .card-img-wrap { width: 100%; aspect-ratio: 4/3; }
    .card-img { height: 100%; }
    .no-img { height: 100%; min-height: unset; }
}

/* ═══════════════════════════════════════════════════════════
   라이트 모드 — html[data-theme="light"]
   CSS 변수만 재정의. 나머지는 var() 참조로 자동 적용.
═══════════════════════════════════════════════════════════ */
html[data-theme="light"] {
    --primary:       #d42020;
    --primary-dark:  #b01a1a;
    --primary-light: #e63535;
    --primary-glow:  rgba(212, 32, 32, 0.12);

    --bg-base:       #ffffff;
    --bg-card:       rgba(255, 255, 255, 0.97);
    --bg-sidebar:    rgba(250, 250, 252, 0.98);
    --bg-modal:      #ffffff;
    --bg-overlay:    rgba(0, 0, 0, 0.45);

    --text-white:    #111111;
    --text-light:    #333333;
    --text-gray:     #666666;
    --text-muted:    #999999;

    --border:        rgba(0, 0, 0, 0.09);
    --border-active: rgba(212, 32, 32, 0.4);
}

/* 라이트 모드 배경 보정 */
html[data-theme="light"] body {
    background-color: var(--bg-base);
    background-image: none;
    color: var(--text-white);
}
html[data-theme="light"] #full-bg {
    background: rgba(255,255,255,0.0);
    mix-blend-mode: normal;
}

/* 상단 바 */
html[data-theme="light"] #top-bar {
    background: rgba(255,255,255,0.9);
    border-bottom-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] #top-bar .top-left button,
html[data-theme="light"] #top-bar .top-left a { color: #333; }
html[data-theme="light"] .category-title { color: #333; }
html[data-theme="light"] .table-badge {
    background: rgba(0,0,0,0.07);
    color: #333;
    border-color: rgba(0,0,0,0.12);
}

/* 사이드바 */
html[data-theme="light"] #sidebar {
    background: var(--bg-sidebar);
    border-right-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .logo-text { color: #222; }
html[data-theme="light"] .nav-btn { color: #444; }
html[data-theme="light"] .nav-btn:hover { color: var(--primary); }
html[data-theme="light"] .nav-btn.active { background: var(--primary); color: #fff !important; }
html[data-theme="light"] .nav-btn.active i { color: #fff !important; }

/* 메뉴 카드 */
html[data-theme="light"] .menu-card {
    background: rgba(255,255,255,0.95);
    border-color: rgba(0,0,0,0.08);
}
html[data-theme="light"] .menu-card:hover { border-color: var(--primary); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
html[data-theme="light"] .menu-card-name { color: #111; }
html[data-theme="light"] .menu-card-desc { color: #666; }

/* 장바구니 / 주문 */
html[data-theme="light"] #cart-panel {
    background: rgba(255,255,255,0.98);
    border-left-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .cart-item { border-bottom-color: rgba(0,0,0,0.07); }
html[data-theme="light"] .cart-item-name { color: #111; }
html[data-theme="light"] .cart-item-price { color: #333; }

/* 바텀바 */
html[data-theme="light"] #bottom-bar {
    background: rgba(255,255,255,0.95);
    border-top-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .store-info strong { color: #111; }
html[data-theme="light"] .store-info em { color: rgba(0,0,0,0.55); }

/* 모달 */
html[data-theme="light"] .modal-box {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
    color: #111;
}
html[data-theme="light"] .modal-box h2,
html[data-theme="light"] .modal-box h3 { color: #111; }

/* 폼 요소 */
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    background: #f8f8fa;
    border-color: rgba(0,0,0,0.18);
    color: #111;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #999; }

/* 메인 인덱스 버튼 (테이블 선택) */
html[data-theme="light"] .ts-btn {
    background: rgba(255,255,255,0.9);
    border-color: rgba(0,0,0,0.1);
}
html[data-theme="light"] .ts-btn .tt { color: #333; }
html[data-theme="light"] .ts-btn:hover { border-color: var(--primary); }

/* 웨이팅 버튼 */
html[data-theme="light"] .ts-waiting-btn,
html[data-theme="light"] .ts-auth-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.12);
    color: #333;
}
html[data-theme="light"] .ts-waiting-btn:hover,
html[data-theme="light"] .ts-auth-btn:hover { background: rgba(0,0,0,0.1); }

/* 게시판 본문 영역 */
html[data-theme="light"] #board-content { background: #fefefe; }

/* takeout 패널 */
html[data-theme="light"] .tp-header {
    background: rgba(255,255,255,.97);
    border-bottom-color: rgba(0,0,0,.1);
}
html[data-theme="light"] .tp-title { color: #b45309; }
html[data-theme="light"] .tp-close { color: rgba(0,0,0,.45); }
html[data-theme="light"] .tp-close:hover { color: #111; }
html[data-theme="light"] .tp-body { background: #f5f5f7; }
html[data-theme="light"] .tp-col { border-right-color: rgba(0,0,0,.08); }
html[data-theme="light"] .tp-col-title { border-bottom-color: rgba(0,0,0,.08); color: inherit; }
html[data-theme="light"] .tp-order-card {
    background: rgba(255,255,255,.9);
    border-color: rgba(0,0,0,.1);
}
html[data-theme="light"] .tp-order-card.wait { background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.25); }
html[data-theme="light"] .tp-order-card.done { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.25); }
html[data-theme="light"] .tp-no-item { color: rgba(0,0,0,.35); }
html[data-theme="light"] .tp-footer {
    background: rgba(255,255,255,.97);
    border-top-color: rgba(0,0,0,.1);
    color: rgba(0,0,0,.5);
}
html[data-theme="light"] .cp-empty { color: rgba(0,0,0,.45); }
html[data-theme="light"] .cp-empty i { color: rgba(0,0,0,.3); }
html[data-theme="light"] .cp-empty p { color: rgba(0,0,0,.45); }

/* ── time/date 입력 피커 아이콘(시계·달력) ── */
/* 다크모드(기본): 기본 아이콘이 어두워 안 보이므로 흰색으로 반전 */
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.3);
    opacity: .85;
    cursor: pointer;
}
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
/* 라이트모드: 기본(어두운) 아이콘 유지 */
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

/* ── 적립포인트 표시 (메뉴 상세 · 장바구니 · 주문내역) ── */
.base-point {
    display: inline-flex; align-items: center; gap: 5px;
    margin: 6px 0 2px;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(245, 158, 11, .12);
    color: #f59e0b; font-size: 14px; font-weight: 700;
}
.base-point i { color: #f59e0b !important; }

.cp-item-point, .cart-item-point, .order-item-point {
    display: inline-flex; align-items: center; gap: 4px;
    margin: 2px 0; font-size: 12px; font-weight: 700; color: #f59e0b;
}
.cp-item-point i, .cart-item-point i, .order-item-point i { color: #f59e0b !important; font-size: 12px; }
.order-item-point { margin-top: 4px; justify-content: flex-end; }

.cart-earn, .cp-earn {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 6px; padding: 6px 2px;
    font-size: 14px; font-weight: 700; color: #f59e0b;
}
.cart-earn .earn-amount, .cp-earn .cp-earn-point { color: #f59e0b; font-weight: 800; }
.cp-earn-label { color: var(--text-light); font-weight: 700; }

.card-point {
    display: inline-block; margin-left: 6px;
    padding: 1px 7px; border-radius: 6px;
    background: rgba(245, 158, 11, .12);
    color: #f59e0b; font-size: 12px; font-weight: 700;
    vertical-align: middle;
}

/* ── 사이드바 보유 포인트 버튼 (클릭 시 포인트 내역) ── */
.sb-acc-point {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-top: 8px; padding: 11px 14px; border-radius: 10px;
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .28);
    text-decoration: none; cursor: pointer; transition: background .15s;
}
.sb-acc-point:hover { background: rgba(245, 158, 11, .2); }
.sb-acc-point .sb-pt-l { font-size: 13px; font-weight: 700; color: var(--text-light); display: inline-flex; align-items: center; gap: 6px; }
.sb-acc-point .sb-pt-l i { color: #f59e0b !important; font-size: 15px; }
.sb-acc-point .sb-pt-v { font-size: 16px; font-weight: 900; color: #f59e0b; }

/* ── 포인트 사용 박스 (주문/테이크아웃 결제) ── */
.use-point-box {
    margin: 10px 0; padding: 12px 14px;
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: 12px; background: rgba(245, 158, 11, .06);
}
.use-point-box .up-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.use-point-box .up-label { font-size: 13px; font-weight: 700; color: var(--text-white, #fff); }

/* ── 포인트사용 체크박스 (적립 예정 줄에 표시) ── */
.up-toggle-inline {
    display: inline-flex; align-items: center; gap: 7px;
    cursor: pointer; user-select: none;
    font-size: 14px; font-weight: 700;
}
.up-check {
    width: 17px; height: 17px; margin: 0;
    accent-color: #f59e0b;
    cursor: pointer; flex-shrink: 0;
}
/* 포인트 사용 박스는 체크했을 때만 노출 */
#use-point-box { display: none; }
#use-point-box.open { display: block; }
.use-point-box .up-label small { color: #f59e0b; font-weight: 700; }
.use-point-box .up-input-wrap { display: inline-flex; align-items: center; gap: 6px; }
.use-point-box .up-input-wrap input {
    width: 110px; height: 38px; padding: 0 10px;
    border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
    background: rgba(0,0,0,.18); color: inherit;
    font-size: 15px; font-weight: 700; text-align: right;
}
.use-point-box .up-unit { font-size: 13px; font-weight: 700; color: #f59e0b; }
.use-point-box .up-allbtn {
    height: 38px; padding: 0 12px; border: none; border-radius: 8px;
    background: #f59e0b; color: #1c1c1e; font-size: 13px; font-weight: 800; cursor: pointer;
}
.use-point-box .up-charge {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.15);
    font-size: 14px; font-weight: 700;
}
.use-point-box .up-charge-amt { color: #f59e0b; font-weight: 900; font-size: 16px; }
.use-point-box .up-mininfo { margin-top: 8px; font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.use-point-box .up-mininfo i { color: #f59e0b !important; }
.use-point-box input:disabled,
#pay-overlay input:disabled { opacity: .45; cursor: not-allowed; }
.use-point-box .up-allbtn:disabled,
#pay-overlay .up-allbtn:disabled { opacity: .4; cursor: not-allowed; }
/* ── 모바일: 주문내역 모달 푸터가 화면을 너무 많이 차지하지 않도록 ── */
@media (max-width: 767px) {
    .use-point-box { margin: 8px 0; padding: 10px 12px; }
    .use-point-box .up-label { font-size: 12.5px; }
    .up-toggle-inline { font-size: 13px; }
    .use-point-box .up-input-wrap input { width: 96px; height: 34px; font-size: 14px; }
    .use-point-box .up-allbtn { height: 34px; padding: 0 10px; font-size: 12px; }
    .use-point-box .up-charge { margin-top: 8px; padding-top: 7px; font-size: 13px; }
    .use-point-box .up-charge-amt { font-size: 15px; }
    .use-point-box .up-mininfo { font-size: 12px; }

    /* 푸터가 커져도 주문 목록이 최소 높이를 확보하도록 */
    #modal-orders .modal-footer { max-height: 52vh; overflow-y: auto; }
    #modal-orders .modal-body   { min-height: 32vh; }
    #modal-orders .cart-total { padding-top: 10px; margin-bottom: 10px; }
    #modal-orders .cart-total span:first-child { font-size: 14px; }
    #modal-orders .total-amount { font-size: 20px; }
    #modal-orders .btn-pay { padding: 14px; font-size: 16px; }
}
