:root { --primary: #FFD02C; --dark: #1a1a1a; --bg: #f5f5f5; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { margin:0; font-family:'Noto Sans TC',sans-serif; background:var(--bg); padding-bottom:100px; }

/* ── Header ── */
.header { background: var(--dark); color: #fff; height: 54px; display: flex; align-items: center; justify-content: center; position: sticky; top: 0; z-index: 999; font-weight: 500; font-size: 1rem; letter-spacing: .5px; }
.header-badge { position: absolute; left: 14px; background: var(--primary); color: var(--dark); font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }

/* ── Category Nav ── */
.cat-nav { display: flex; overflow-x: auto; gap: 8px; padding: 10px 14px; background: #fff; position: sticky; top: 54px; z-index: 998; border-bottom: 1px solid #f0f0f0; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; align-items: center; }
.cat-nav.liff-top { top: 0; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-pill { padding: 6px 16px; border-radius: 20px; background: #fff; color: #666; font-size: 0.88rem; font-weight: 500; flex-shrink: 0; cursor: pointer; border: 1.5px solid #e8e8e8; transition: 0.15s; user-select: none; }
.cat-pill.active { background: var(--dark); color: var(--primary); border-color: var(--dark); }

/* ── Menu List ── */
.category-section { scroll-margin-top: 110px; }
.category-title { padding: 18px 14px 8px; font-weight: 700; font-size: 0.78rem; color: #aaa; letter-spacing: 1px; text-transform: uppercase; }
.menu-list { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 4px; }
.menu-item { background: #fff; border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #f0f0f0; cursor: pointer; transition: background 0.12s; }
.menu-item:active { background: #fafafa; }
.menu-item-info { flex: 1; min-width: 0; }
.m-name { font-size: 0.98rem; font-weight: 500; color: var(--dark); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-price { font-size: 0.92rem; font-weight: 700; color: var(--dark); margin-top: 4px; }
.add-btn { width: 32px; height: 32px; background: var(--dark); border-radius: 9px; color: var(--primary); font-size: 1.3rem; font-weight: 400; display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }

/* ── Cart Bar (底部浮動列) ── */
.cart-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; border-top: 1px solid #f0f0f0; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; z-index: 1000; cursor: pointer; }
.cart-bar-left { display: flex; align-items: center; gap: 10px; }
.cart-icon-wrap { position: relative; }
.cart-icon-box { width: 38px; height: 38px; background: #f5f5f5; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.cart-icon-box svg { width: 20px; height: 20px; stroke: var(--dark); fill: none; stroke-width: 1.8; }
.cart-dot { position: absolute; top: -5px; right: -5px; background: var(--primary); color: var(--dark); font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.cart-bar-text { font-size: 0.82rem; color: #999; }
.cart-bar-text strong { display: block; font-size: 1rem; color: var(--dark); font-weight: 700; }
.cart-bar-btn { background: var(--dark); color: var(--primary); border: none; padding: 11px 20px; border-radius: 10px; font-size: 0.9rem; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ── Modals ── */
.modal { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); display:none; align-items:flex-end; justify-content:center; z-index:2000; }
.modal.active { display:flex; }
.modal-box { background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 20px 20px 32px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-handle { width: 36px; height: 4px; background: #e0e0e0; border-radius: 2px; margin: 0 auto 16px; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--dark); margin-bottom: 16px; }

/* 配料選項 */
.opt-group { margin-bottom: 14px; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
.opt-group-title { font-weight: 700; font-size: 0.85rem; color: #555; margin-bottom: 8px; }
.req-tag { background: #ff4757; color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; margin-left: 5px; }
.opt-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f8f8f8; }
.opt-row:last-child { border-bottom: none; }
.qty-btn { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid #e0e0e0; text-align:center; line-height:25px; cursor:pointer; font-weight:700; background:#fff; font-size:1rem; }
input.opt-checkbox { width:22px; height:22px; cursor:pointer; accent-color: var(--dark); }

/* 購物車 */
.cart-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.cart-row-info { flex: 1; }
.cart-row-name { font-size: 0.95rem; font-weight: 500; color: var(--dark); }
.cart-row-tops { font-size: 0.8rem; color: #aaa; margin-top: 2px; }
.cart-row-right { display: flex; align-items: center; gap: 8px; }
.cart-qty-ctrl { display: flex; align-items: center; gap: 6px; }
.cart-qty-btn { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid #e0e0e0; background: #fff; font-weight: 700; font-size: 0.95rem; cursor: pointer; display:flex; align-items:center; justify-content:center; }
.cart-qty-num { font-size: 0.95rem; font-weight: 600; min-width: 18px; text-align:center; }
.cart-del-btn { color: #ccc; background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 4px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 4px; margin-bottom: 20px;}
.cart-total-label { font-size: 0.9rem; color: #999; }
.cart-total-val { font-size: 1.2rem; font-weight: 700; color: var(--dark); }

/* 按鈕 */
.btn-main { width:100%; padding:14px; background:var(--dark); color:var(--primary); border:none; border-radius:12px; font-weight:700; margin-top:12px; font-size:1rem; cursor:pointer; font-family:inherit; transition: 0.15s; }
.btn-main:active { transform: scale(0.98); opacity: 0.9; }
.btn-sec { width:100%; padding:10px; background:transparent; border:none; color:#aaa; margin-top:6px; font-size:0.9rem; cursor:pointer; font-family:inherit; }

/* 時間選擇器 */
.time-select { width: 100%; padding: 12px; font-size: 1rem; border: 1.5px solid #e8e8e8; border-radius: 10px; margin: 5px 0 10px 0; font-family: inherit; }
.time-picker-wrapper { display: flex; align-items: center; justify-content: center; gap: 10px; background: #f8f8f8; padding: 10px; border-radius: 12px; border: 1.5px solid #e8e8e8; }
.time-wheel { flex: 1; border: none; background: transparent; font-size: 1.3rem; text-align: center; text-align-last: center; font-weight: 700; color: var(--dark); appearance: none; -webkit-appearance: none; padding: 5px; border-radius: 8px; font-family: inherit; }
.time-colon { font-size: 1.3rem; font-weight: 700; color: #999; margin-top: -5px; }

/* LIFF Specific */
#loadingMask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #fff; z-index: 9999; display: flex; justify-content: center; align-items: center; flex-direction: column; transition: opacity 0.6s, visibility 0.6s; opacity: 1; visibility: visible; }
#loadingMask.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.loader { border: 5px solid #f3f3f3; border-top: 5px solid var(--primary); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.fade-in-content { animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards; opacity: 0; }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(30px) scale(0.98); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.error-message { background: #fee; border: 1px solid #fcc; color: #c33; padding: 15px; border-radius: 8px; margin: 20px; text-align: center; }
#registerView { display: none; padding: 40px 20px; max-width: 400px; margin: 0 auto; min-height: 100vh; background: #fff; }
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: bold; margin-bottom: 5px; color: #333; font-size: 0.9rem;}
.input-group input { width: 100%; padding: 12px; border: 1.5px solid #e8e8e8; border-radius: 10px; font-size: 1rem; box-sizing: border-box; }
.profile-card { text-align: center; margin-bottom: 30px; }
.profile-img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--primary); margin-bottom: 10px; }
body.no-scroll { overflow: hidden !important; height: 100vh; }