/* ===== หน้าร้าน ===== */
body { padding-bottom: 96px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header */
.hero { background: linear-gradient(135deg, var(--red) 0%, var(--red-600) 70%, var(--red-700) 100%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--yellow); opacity: .14; }
.hero::before { content: ''; position: absolute; right: 70px; bottom: -90px; width: 160px; height: 160px; border-radius: 50%; background: var(--yellow); opacity: .1; }
.hero-in { display: flex; align-items: center; gap: 14px; padding: 18px 0 22px; position: relative; z-index: 1; }
.logo { width: 58px; height: 58px; border-radius: 16px; background: var(--yellow); display: grid; place-items: center; font-size: 1.8rem; flex: none; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { font-size: 1.35rem; letter-spacing: .2px; }
.hero p { opacity: .88; font-size: .9rem; }
.hero .status { margin-top: 6px; }
.hero .status .pill { background: rgba(255,255,255,.16); color: #fff; }
.hero .status .pill.open { background: var(--yellow); color: var(--ink); }
.hero .status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero .my-orders { margin-left: auto; background: rgba(255,255,255,.14); color: #fff; border-radius: 12px; padding: 8px 12px; font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.hero .my-orders:hover { background: rgba(255,255,255,.24); }
@media (max-width: 480px) { .hero .my-orders span { display: none; } .hero .my-orders { font-size: 1.15rem; padding: 8px 10px; align-self: flex-start; } }

.announce { background: var(--yellow-50); border-bottom: 1px solid var(--yellow-100); color: #6B4E00; font-size: .9rem; }
.announce .container { padding-top: 10px; padding-bottom: 10px; display: flex; gap: 8px; }
.closed-bar { background: var(--ink); color: #fff; text-align: center; padding: 10px 16px; font-size: .92rem; }

.active-order { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 12px 14px; background: #fff; border: 1.5px solid var(--yellow); border-radius: var(--r); box-shadow: var(--sh-2); width: 100%; text-align: left; }
.active-order .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--yellow-50); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.active-order b { display: block; font-size: .95rem; }
.active-order small { color: var(--muted); }
.active-order .go { margin-left: auto; color: var(--red); font-weight: 700; }

/* tabs */
.tabs { position: sticky; top: 0; z-index: 20; background: rgba(250, 247, 244, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs-in { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; }
.tabs-in::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 8px 16px; border-radius: 99px; font-weight: 600; font-size: .92rem; color: var(--ink-2); background: #fff; border: 1.5px solid var(--line); }
.tab.on { background: var(--red); color: #fff; border-color: var(--red); }

/* menu */
.cat { padding-top: 22px; scroll-margin-top: 64px; }
.cat h2 { font-size: 1.2rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.cat h2::before { content: ''; width: 5px; height: 20px; border-radius: 3px; background: var(--yellow); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.prod { background: #fff; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--sh-1); text-align: left; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s; position: relative; }
.prod:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.prod .ph { aspect-ratio: 4 / 3; background: var(--yellow-50); position: relative; overflow: hidden; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod .badge { position: absolute; top: 8px; left: 8px; background: var(--yellow); color: var(--ink); font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; box-shadow: var(--sh-1); }
.prod .body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.prod h3 { font-size: .98rem; font-weight: 600; }
.prod p { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.prod .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.prod .price { font-family: var(--font-h); font-weight: 700; color: var(--red); font-size: 1.08rem; }
.prod .add { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-size: 1.3rem; display: grid; place-items: center; line-height: 1; box-shadow: 0 3px 8px rgba(215,25,42,.3); }
.prod .incart { position: absolute; top: 8px; right: 8px; background: var(--red); color: #fff; min-width: 26px; height: 26px; border-radius: 99px; font-size: .8rem; font-weight: 700; display: grid; place-items: center; padding: 0 7px; border: 2px solid #fff; }
.prod.out { pointer-events: none; }
.prod.out .ph img { filter: grayscale(1); opacity: .55; }
.prod.out .ph::after { content: 'หมดชั่วคราว'; position: absolute; inset: auto 0 0; background: rgba(30,26,23,.78); color: #fff; text-align: center; padding: 6px; font-size: .82rem; font-weight: 600; }
.prod.out .add { background: #CFC7C0; box-shadow: none; }

/* cart bar */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.cartbar .btn { pointer-events: auto; width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; min-height: 58px; border-radius: 16px; padding: 0 18px; font-size: 1.02rem; }
.cartbar .count { background: var(--yellow); color: var(--ink); min-width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 700; padding: 0 6px; }
.cartbar .lbl { display: flex; align-items: center; gap: 10px; }

/* sheet / modal */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 15, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 94vh; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; transform: translateY(30px); transition: transform .25s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
.overlay.show .sheet { transform: none; }
@media (min-width: 720px) { .overlay { align-items: center; } .sheet { border-radius: 24px; max-height: 88vh; } }
.sheet-scroll { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.sheet-head { padding: 18px 20px 10px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.15rem; }
.sheet-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; display: flex; gap: 10px; align-items: center; }
.close-x { width: 36px; height: 36px; border-radius: 50%; background: #F3EFEC; font-size: 1.2rem; display: grid; place-items: center; }

.pd-img { aspect-ratio: 16 / 10; background: var(--yellow-50); position: relative; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-img .close-x { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.92); box-shadow: var(--sh-1); }
.pd-info { padding: 16px 20px 6px; }
.pd-info h2 { font-size: 1.3rem; }
.pd-info p { color: var(--muted); font-size: .92rem; margin-top: 4px; }
.pd-info .price { font-family: var(--font-h); color: var(--red); font-weight: 700; font-size: 1.15rem; margin-top: 6px; }
.og { padding: 14px 20px; border-top: 8px solid var(--bg); }
.og-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.og-head b { font-family: var(--font-h); font-weight: 600; font-size: 1.02rem; }
.og-head small { color: var(--muted); font-size: .8rem; display: block; font-weight: 400; font-family: var(--font); }
.og.missing .og-head .pill { background: var(--red); color: #fff; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.opt:last-child { border-bottom: 0; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .mark { width: 22px; height: 22px; border: 2px solid var(--line-2); border-radius: 50%; flex: none; display: grid; place-items: center; transition: .15s; }
.opt.multi .mark { border-radius: 7px; }
.opt input:checked + .mark { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 3px #fff; }
.opt.multi input:checked + .mark { box-shadow: none; }
.opt.multi input:checked + .mark::after { content: '✓'; color: #fff; font-size: .8rem; font-weight: 700; }
.opt input:focus-visible + .mark { outline: 3px solid var(--yellow); outline-offset: 2px; }
.opt .nm { flex: 1; }
.opt .pr { color: var(--ink-2); font-size: .9rem; }
.opt.off { opacity: .45; cursor: not-allowed; }
.opt.off .pr::after { content: ' · หมด'; color: var(--red); }

.stepper { display: inline-flex; align-items: center; background: #F5F1EE; border-radius: 12px; flex: none; }
.stepper button { width: 42px; height: 46px; font-size: 1.3rem; font-weight: 600; color: var(--red); }
.stepper b { min-width: 30px; text-align: center; font-size: 1.05rem; }
.stepper.sm button { width: 34px; height: 34px; font-size: 1.1rem; }

/* cart */
.ci { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ci img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--yellow-50); }
.ci .info { flex: 1; min-width: 0; }
.ci .info b { display: block; }
.ci .info small { display: block; color: var(--muted); font-size: .82rem; }
.ci .info .edit { color: var(--red); font-size: .82rem; font-weight: 600; margin-top: 4px; }
.ci .right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.ci .right .p { font-weight: 700; }
.ci.bad { background: var(--red-50); }
.sum { padding: 14px 20px; }
.sum .row { display: flex; justify-content: space-between; padding: 4px 0; color: var(--ink-2); }
.sum .row.total { color: var(--ink); font-weight: 700; font-size: 1.12rem; border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 10px; }
.warn { margin: 0 20px 14px; padding: 10px 14px; background: var(--yellow-50); border: 1px solid var(--yellow-100); color: #6B4E00; border-radius: 12px; font-size: .88rem; }

/* page views */
.page { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.topnav { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.topnav .page { display: flex; align-items: center; gap: 8px; height: 58px; }
.topnav h1 { font-size: 1.1rem; }
.back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; margin-left: -8px; }
.back:hover { background: #F3EFEC; }
.block { background: #fff; border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--sh-1); padding: 18px; margin-top: 14px; }
.block > h3 { font-size: 1.02rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.block > h3 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--red); color: #fff; font-size: .8rem; display: grid; place-items: center; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 600; min-width: 88px; }
.seg button.on { border-color: var(--red); background: var(--red-50); color: var(--red-600); }
.seg.invalid button { border-color: var(--red); background: var(--red-50); }
.room-input { font-family: var(--font-h); font-size: 1.6rem !important; font-weight: 600; letter-spacing: 2px; text-align: center; min-height: 60px !important; }
.addr-preview { margin-top: 4px; padding: 12px 14px; background: var(--yellow-50); border-radius: 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; }

.paym { display: grid; gap: 10px; }
.paym label { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line-2); border-radius: 14px; cursor: pointer; }
.paym label:has(input:checked) { border-color: var(--red); background: var(--red-50); }
.paym input { accent-color: var(--red); width: 18px; height: 18px; }
.paym .ic { width: 38px; height: 38px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 1.2rem; border: 1px solid var(--line); }
.paym small { display: block; color: var(--muted); font-size: .8rem; }
.slip-pick { margin-top: 12px; }
.slip-preview { max-height: 220px; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); }
.err-box { background: var(--red-50); color: var(--red-600); border: 1px solid var(--red-100); padding: 12px 14px; border-radius: 12px; margin-top: 14px; font-weight: 500; }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.sticky-cta .btn { max-width: 608px; margin: 0 auto; display: flex; width: 100%; justify-content: space-between; }

/* order tracking */
.st-hero { text-align: center; padding: 26px 18px 20px; }
.st-icon { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 2.4rem; background: var(--yellow-50); position: relative; }
.st-icon.pulse::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--yellow); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.st-hero h2 { font-size: 1.4rem; }
.st-hero .code { display: inline-block; margin-top: 8px; font-family: var(--font-h); background: var(--ink); color: var(--yellow); padding: 4px 14px; border-radius: 10px; font-weight: 700; letter-spacing: 1px; }
.st-hero p { color: var(--muted); margin-top: 6px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 22px; position: relative; }
.steps .s { text-align: center; font-size: .78rem; color: var(--muted); position: relative; }
.steps .s::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.steps .s:first-child::before { display: none; }
.steps .s .c { width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 3px solid var(--line); margin: 0 auto 6px; position: relative; z-index: 1; display: grid; place-items: center; font-size: .9rem; }
.steps .s.done { color: var(--ink); } .steps .s.done::before { background: var(--red); }
.steps .s.done .c { background: var(--red); border-color: var(--red); color: #fff; }
.steps .s.now { color: var(--red); font-weight: 700; } .steps .s.now::before { background: var(--red); }
.steps .s.now .c { border-color: var(--red); background: var(--yellow); }
.steps .s time { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.qr-box { text-align: center; }
.qr-box .qr { width: 230px; margin: 6px auto 10px; padding: 12px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.qr-box .qr svg { width: 100%; height: auto; display: block; }
.qr-box .pp { display: inline-block; background: #0E3A68; color: #fff; padding: 4px 12px; border-radius: 8px; font-weight: 700; font-size: .85rem; letter-spacing: .5px; }
.qr-box .amt { font-family: var(--font-h); font-size: 1.6rem; color: var(--red); font-weight: 700; }
.bank { white-space: pre-line; background: var(--bg); border-radius: 12px; padding: 12px 14px; font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); } .kv dd { font-weight: 500; }
.oi { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.oi:last-child { border-bottom: 0; }
.oi small { display: block; color: var(--muted); font-size: .82rem; }
.paid-box { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--ok-50); color: var(--ok); font-weight: 600; }
.verify-box { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--info-50); color: var(--info); font-weight: 600; }

.olist a { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.olist a:last-child { border-bottom: 0; }
.olist .code { font-family: var(--font-h); font-weight: 700; background: var(--yellow-50); border-radius: 10px; padding: 6px 10px; color: var(--red-600); }
.olist .mid { flex: 1; } .olist small { color: var(--muted); display: block; }

footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 30px 16px 10px; }
