:root {
  /* 基底：黑底＋黃亮點 */
  --bg: #0a0d10;
  --panel: #111827;
  --card: #0f172a;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --yellow: #ffd400;
  --yellow-soft: #ffea80;
  --danger: #ff5757;
}

.ob-hero { padding: 18px 0 10px; background: var(--bg); border-bottom: 1px solid #1c2333; }
.ob-hero-text h1 { margin: 0 0 6px; font-size: 26px; color: var(--text); }
.ob-hero-text p { margin: 0; color: var(--muted); }

.ob-container { position: relative; }
.ob-spacer { height: 16px; }
.ob-bottom-safe { height: 68px; }

.ob-toolbar { position: sticky; top: 0; z-index: 10; background: var(--panel); padding: 10px; margin: 12px 0; border-radius: 12px; border: 1px solid #2a3347; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.tab { color: var(--text); text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid #303b52; white-space: nowrap; background: rgba(255,255,255,0.02); }
.tab:hover { background: rgba(255,212,0,0.07); border-color: #444d64; }
.tab.active { background: var(--yellow); color: #141414; border-color: var(--yellow); font-weight: 800; }
.actions { display: flex; gap: 8px; }
.btn-primary { background: var(--yellow); color: #141414; border: none; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 800; letter-spacing: .3px; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-full { width: 100%; }

.ob-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) {
  .ob-layout { grid-template-columns: 1fr 320px; align-items: start; }
}

.category { background: var(--panel); border:1px solid #2a3347; border-radius: 12px; padding: 10px; }
.category-title { margin: 2px 6px 8px; font-size: 18px; color: var(--text); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.card { background: var(--card); border:1px solid #1f2a44; border-radius: 12px; overflow: hidden; }
.card-body { padding: 12px; display: grid; gap: 8px; }
.card .name { font-weight: 600; color: var(--text); }
.card .price { color: var(--yellow); font-weight: 800; }
.card .qty { display: grid; gap: 4px; }
.card .qty span { color: var(--muted); font-size: 12px; }
.card select { width: 100%; background: #0d1524; color: var(--text); border: 1px solid #21324a; border-radius: 8px; padding: 6px; }

.summary { position: sticky; top: 72px; background: var(--panel); border: 1px solid #203049; border-radius: 12px; padding: 12px; height: fit-content; }
.summary h3 { margin: 0 0 8px; }
.summary ul { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.summary li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.summary .sp-name { color: var(--text); }
.summary .sp-qty { color: var(--muted); }
.summary .sp-sub { color: var(--yellow-soft); font-weight: 700; }
.summary .total { margin-top: 8px; font-size: 18px; }
.muted { color: var(--muted); }

.ob-form { display: contents; }

/* 行動底部合計條 */
.ob-bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(16,24,38,0.96); border-top: 1px solid #2a3347; display: block; }
.ob-bottom-bar-inner { max-width: 1200px; margin: 0 auto; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; }
@media (min-width: 900px) { .ob-bottom-bar { display: none; } .ob-bottom-safe { height: 0; } }

/* 搜尋列與 Chips */
.ob-searchbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 10px 0 6px; }
.ob-searchbar .input {
  background: #0d1524; border: 1px solid #2a3347; border-radius: 999px; color: var(--text);
  padding: 10px 14px; outline: none;
}
.ob-searchbar .input::placeholder { color: #77819a; }
.ob-searchbar .search-btn { background: var(--yellow); color: #141414; border: none; border-radius: 999px; padding: 10px 14px; font-weight: 800; }

.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 2px; }
.chip { border: 1px solid #303b52; color: var(--text); background: rgba(255,255,255,0.02); padding: 6px 10px; border-radius: 999px; white-space: nowrap; font-size: 13px; }
.chip.active, .chip:hover { border-color: #444d64; background: rgba(255,212,0,0.12); }

/* 卡片圖片占位 */
.thumb { width: 100%; aspect-ratio: 4/3; background: #11161f; border-bottom: 1px solid #1f2a44; display: grid; place-items: center; color: #5a6786; font-size: 12px; }

/* 產品卡片行為線 */
.actions-line { display: flex; justify-content: flex-end; }

/* 購物車面板 */
.ob-cart { position: fixed; right: 12px; bottom: 76px; width: 360px; max-height: 70vh; background: var(--panel); border: 1px solid #2a3347; border-radius: 12px; box-shadow: 0 12px 24px rgba(0,0,0,.4); display: grid; grid-template-rows: auto 1fr auto; z-index: 60; }
.ob-cart.hidden { display: none; }
.ob-cart-header { display:flex; align-items:center; justify-content: space-between; padding: 8px 12px; border-bottom:1px solid #2a3347; font-weight:700; }
.ob-cart-close { background:none; border:1px solid #444; color: var(--text); border-radius:8px; padding:2px 8px; cursor:pointer; }
.ob-cart-body { overflow:auto; padding: 8px 12px; }
.ob-cart-items { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.ob-cart-items li { display:grid; grid-template-columns: 1fr auto auto; gap:8px; align-items:center; background: var(--card); border:1px solid #1f2a44; border-radius:8px; padding:8px; }
.ob-cart-items .nm { color: var(--text); }
.ob-cart-items .qty { display:flex; gap:6px; align-items:center; }
.ob-cart-items button { background:#0d1524; color: var(--text); border:1px solid #21324a; border-radius:6px; padding:4px 8px; cursor:pointer; }
.ob-cart-items .price { color: var(--yellow); font-weight:800; }
.ob-cart-empty { color: var(--muted); text-align:center; padding: 8px 0; }
.ob-cart-footer { border-top:1px solid #2a3347; padding: 8px 12px; display:grid; gap:8px; }
.ob-cart-footer .ops { display:flex; gap:8px; }

/* 浮動購物車入口（桌機） */
.ob-cart-fab{ position:fixed; right:16px; bottom:16px; background:var(--yellow); color:#141414; border:none; border-radius:28px; padding:10px 14px; font-weight:800; cursor:pointer; box-shadow:0 8px 18px rgba(0,0,0,.35); display:none; }
.ob-cart-fab .fab-icon{ font-size:18px; margin-right:6px; }
.ob-cart-fab .fab-badge{ background:#111827; color:var(--yellow); border:1px solid #2a3347; border-radius:999px; padding:2px 8px; font-size:12px; margin-left:6px; }
@media (min-width: 900px){ .ob-cart-fab{ display:inline-flex; align-items:center; } }
.flash-ring{ box-shadow:0 0 0 3px rgba(255,212,0,.45), 0 0 18px rgba(255,212,0,.7) !important; transition: box-shadow .3s; }

/* --- 數量選擇彈層（新版） --- */
/* 隱藏卡片內的舊數量欄位 */
.card .qty{ display:none !important; }

.ob-qty-mask{ position:fixed; inset:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; z-index:110; }
.ob-qty-panel{ background:var(--panel); color:var(--text); border:1px solid #2a3347; border-radius:12px; padding:12px; width: 300px; box-shadow: 0 12px 24px rgba(0,0,0,.45); }
.ob-qty-title{ font-weight:800; margin:0 0 8px; }
.ob-qty-controls{ display:flex; align-items:center; gap:8px; margin: 8px 0; }
.ob-qty-controls button{ background:#0d1524; color:var(--text); border:1px solid #21324a; border-radius:8px; padding:6px 10px; cursor:pointer; font-weight:800; }
.ob-qty-controls input{ flex:1; background:#0d1524; color:var(--text); border:1px solid #21324a; border-radius:8px; padding:6px 10px; text-align:center; }
.ob-qty-quick{ display:flex; gap:8px; margin:6px 0 10px; flex-wrap: wrap; }
.ob-qty-quick button{ background:#0d1524; color:var(--text); border:1px solid #21324a; border-radius:999px; padding:4px 10px; cursor:pointer; }
.ob-qty-ops{ display:flex; gap:8px; justify-content:flex-end; }
.ob-qty-ops .primary{ background:var(--yellow); color:#141414; border:none; border-radius:10px; padding:8px 14px; font-weight:800; cursor:pointer; }

/* Hide search filter chips under the search bar */
.chips { display: none !important; }
