/* มติ 851 — ร้านจำลอง «เดินดูร้าน AIC» · ทุกกฎอยู่ใต้ `.shop-tour` จึงไม่รั่วไปหน้าอื่น
   หน้าตายกจากตัวอย่างที่เจ้าของเห็นแล้ว (Artifact 7vbaKwbsXo4JiKhhaTRjCg) · ไม่มีส่วนเฟส 2–4 */
.shop-tour {
  --st-bg: #eef2f7; --st-surface: #fff; --st-ink: #17233a; --st-muted: #5d6b82; --st-line: #d5dce8;
  --st-accent: #f2b705; --st-mint: #1f9e80; --st-red: #dc2626; --st-outline: #17233a;
  background: var(--st-bg); color: var(--st-ink); font-size: 15px; line-height: 1.55;
}
.shop-tour * { box-sizing: border-box; }
.shop-tour .st-wrap { max-width: 1240px; margin: 0 auto; padding: 10px 16px 48px; display: grid; gap: 10px; }
.shop-tour .st-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.shop-tour h1 { font-weight: 600; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; margin: 0; }
.shop-tour .st-noscript { background: #fff4cc; padding: 10px 14px; border-radius: 12px; }
.shop-tour button { font-family: inherit; }
.shop-tour .st-basket { display: inline-flex; align-items: center; gap: 10px; border: 2.5px solid var(--st-ink); background: var(--st-surface); color: var(--st-ink); font-weight: 600; font-size: 15px; padding: 8px 16px; border-radius: 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--st-ink); }
.shop-tour .st-basket .n { min-width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--st-accent); font-variant-numeric: tabular-nums; padding: 0 6px; }
.shop-tour button:focus-visible, .shop-tour .spot:focus-visible, .shop-tour input:focus-visible, .shop-tour a:focus-visible { outline: 3px solid var(--st-mint); outline-offset: 2px; }

/* มติ 852 — ทั้งร้านอยู่ในจอแรก: กว้างไม่เกินที่ความสูงจอ (หักหัวเว็บ+หัวหน้า ~200px) รับได้ · มือถือยังเลื่อนข้างได้ (ขั้นต่ำ 640) */
.shop-tour .st-scroll { width: 100%; max-width: max(640px, calc((100svh - 200px) * 1586 / 992)); justify-self: center; }
.shop-tour .st-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; background: #f4f6f9; border: 1px solid var(--st-line); }
.shop-tour .st-scene { position: relative; min-width: 640px; }
.shop-tour .st-scene[hidden] { display: none; }
.shop-tour .st-scene > img { display: block; width: 100%; height: auto; }
.shop-tour .st-scene.enter { animation: st-room .35s ease; }
@keyframes st-room { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.shop-tour #st-spots, .shop-tour #st-lounge-spots { position: absolute; inset: 0; width: 100%; height: 100%; }
.shop-tour .spot { cursor: pointer; outline: none; }
.shop-tour .spot .area { fill: #f2b705; fill-opacity: 0; stroke: #f2b705; stroke-width: 0; transition: fill-opacity .15s; }
.shop-tour .spot:hover .area, .shop-tour .spot:focus-visible .area, .shop-tour .spot.on .area { fill-opacity: .22; stroke-width: 5; stroke-dasharray: 14 9; }
.shop-tour .pin rect, .shop-tour .pin .tail { fill: #fff; stroke: #17233a; stroke-width: 4; stroke-linejoin: round; }
.shop-tour .pin .pt { font-weight: 600; font-size: 30px; fill: #17233a; }
.shop-tour .spot.yellow .pin rect, .shop-tour .spot.yellow .pin .tail { fill: #f2b705; }
.shop-tour .spot .pin { transition: transform .15s; transform-box: fill-box; transform-origin: center bottom; }
.shop-tour .spot:hover .pin, .shop-tour .spot.on .pin { transform: translateY(-6px) scale(1.05); }
.shop-tour .spot .ping { fill: var(--st-red); stroke: #fff; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.shop-tour .spot.sold .ping { animation: st-ping 2.4s ease-out; }
@keyframes st-ping { 0% { opacity: 0; transform: scale(.4); } 15% { opacity: 1; transform: scale(1.2); } 30% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }

.shop-tour .st-depts { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-tour .st-depts button { border: 1.5px solid var(--st-line); background: var(--st-surface); color: var(--st-ink); font-weight: 500; font-size: 14px; padding: 8px 14px; border-radius: 12px; cursor: pointer; }
.shop-tour .st-depts button.yellow { border-color: var(--st-ink); font-weight: 600; background: var(--st-accent); }

/* กล่องคำพูดการ์ตูน */
.shop-tour .bubble { position: absolute; z-index: 10; width: min(440px, calc(100vw - 32px)); background: #fff; color: var(--st-ink);
  border: 3px solid var(--st-outline); border-radius: 26px; box-shadow: 6px 6px 0 var(--st-outline); padding: 16px 16px 14px; display: grid; gap: 10px;
  animation: st-pop .22s cubic-bezier(.3, 1.6, .5, 1); transform-origin: var(--ox, 50%) var(--oy, 100%); }
@keyframes st-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shop-tour .bubble .tail { position: absolute; width: 34px; height: 30px; left: var(--tx, 50%); margin-left: -17px; }
.shop-tour .bubble.above .tail { top: 100%; margin-top: -3px; }
.shop-tour .bubble.below .tail { bottom: 100%; margin-bottom: -3px; transform: scaleY(-1); }
.shop-tour .bubble .tail path { fill: #fff; stroke: var(--st-outline); stroke-width: 3; stroke-linejoin: round; }
.shop-tour .st-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.shop-tour .st-head h2 { font-weight: 600; font-size: 22px; line-height: 1.2; margin: 0; }
.shop-tour .st-head p { margin: 2px 0 0; font-size: 13px; color: var(--st-muted); }
.shop-tour .st-x { border: 2px solid var(--st-outline); background: var(--st-accent); color: #17233a; width: 34px; height: 34px; border-radius: 999px; font-size: 18px; font-weight: 700; cursor: pointer; flex: none; line-height: 1; }
.shop-tour .find { display: flex; align-items: center; gap: 8px; border: 2px solid var(--st-line); border-radius: 14px; padding: 6px 10px; background: #fff; }
.shop-tour .find svg { width: 18px; height: 18px; flex: none; stroke: var(--st-muted); fill: none; stroke-width: 2.4; }
.shop-tour .find input { border: 0; outline: 0; background: transparent; color: var(--st-ink); font: inherit; width: 100%; min-width: 0; }
.shop-tour .chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.shop-tour .chips button { flex: none; border: 2px solid var(--st-outline); background: #fff; color: var(--st-ink); font-weight: 500; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.shop-tour .chips button[aria-pressed="true"] { background: var(--st-accent); }
.shop-tour .list { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.shop-tour .item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1.5px dashed var(--st-line); }
.shop-tour .item .ph { width: 48px; height: 48px; border-radius: 10px; background: var(--st-bg); object-fit: contain; display: block; }
.shop-tour .item .name { font-weight: 500; line-height: 1.3; color: inherit; text-decoration: none; }
.shop-tour .item a.name:hover { text-decoration: underline; }
.shop-tour .item .meta { font-size: 13px; color: var(--st-muted); display: flex; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.shop-tour .item .badge { font-size: 11px; font-weight: 600; background: #fde2e2; color: #8a1c1c; padding: 0 6px; border-radius: 999px; }
.shop-tour .item .left { font-size: 12px; color: var(--st-muted); }
.shop-tour .item .left.over { color: var(--st-red); font-weight: 600; }
.shop-tour .add { border: 2px solid var(--st-outline); background: var(--st-accent); color: #17233a; font-weight: 600; font-size: 13px; padding: 5px 12px; border-radius: 12px; cursor: pointer; white-space: nowrap; box-shadow: 2px 2px 0 var(--st-outline); text-decoration: none; display: inline-block; }
.shop-tour .add.spec { background: #fff; }
.shop-tour .add[disabled] { opacity: .6; cursor: wait; }
.shop-tour .incart { display: block; font-size: 11px; color: var(--st-mint); font-weight: 600; text-align: center; margin-top: 2px; }
.shop-tour .more { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--st-muted); }
.shop-tour .more a { color: var(--st-ink); font-weight: 600; font-size: 14px; text-underline-offset: 3px; }
.shop-tour .empty { color: var(--st-muted); padding: 14px 0; text-align: center; margin: 0; }
.shop-tour .sum { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-variant-numeric: tabular-nums; }
.shop-tour .sum .total { font-size: 20px; font-weight: 600; }
.shop-tour .receipt { font-size: 13px; max-height: 220px; overflow-y: auto; }
.shop-tour .receipt .row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 5px 0; border-bottom: 1.5px dashed var(--st-line); }
.shop-tour .receipt .sku { font-family: ui-monospace, Menlo, monospace; }
.shop-tour .st-hint, .shop-tour .note { font-size: 13px; color: var(--st-muted); margin: 0; }
.shop-tour .st-cta { border: 2.5px solid var(--st-outline); background: var(--st-accent); color: #17233a; font-weight: 600; font-size: 16px; padding: 10px 16px; border-radius: 14px; cursor: pointer; box-shadow: 3px 3px 0 var(--st-outline); text-align: center; text-decoration: none; display: block; }
.shop-tour .st-links { display: grid; gap: 8px; }

/* ลูกค้าเดินในร้าน */
.shop-tour .walker { pointer-events: none; transition: opacity .6s; }
.shop-tour .walker .say rect, .shop-tour .walker .say path { fill: #fff; stroke: #17233a; stroke-width: 3; stroke-linejoin: round; }
.shop-tour .walker .say text { font-size: 22px; font-weight: 500; fill: #17233a; }

/* ป้ายโปรเจค + «มีคนเพิ่งซื้อ» */
.shop-tour .st-hud { position: absolute; left: 1.5%; top: 2.5%; z-index: 5; display: grid; gap: 5px; min-width: 190px; max-width: 46%; text-align: left; cursor: pointer;
  background: #fff; color: var(--st-ink); border: 2.5px solid var(--st-outline); border-radius: 14px; box-shadow: 3px 3px 0 var(--st-outline); padding: 8px 12px; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.shop-tour .st-hud-bar { display: block; height: 8px; border-radius: 999px; background: var(--st-bg); border: 1.5px solid var(--st-outline); overflow: hidden; }
.shop-tour .st-hud-bar i { display: block; height: 100%; width: 0; background: var(--st-mint); transition: width .35s; }
.shop-tour .st-hud.warn .st-hud-bar i { background: var(--st-accent); }
.shop-tour .st-hud.over .st-hud-bar i { background: var(--st-red); }
.shop-tour .st-buzz { position: absolute; left: 1.5%; bottom: 3%; z-index: 5; max-width: 320px; display: flex; gap: 10px; align-items: center; text-align: left;
  background: #fff; color: var(--st-ink); border: 2.5px solid var(--st-outline); border-radius: 16px; box-shadow: 4px 4px 0 var(--st-outline); padding: 10px 14px; cursor: pointer; font-size: 14px; line-height: 1.4;
  transition: opacity .35s, transform .35s; }
.shop-tour .st-buzz.hide { opacity: 0; transform: translateY(10px); pointer-events: none; }
.shop-tour .st-buzz .cart { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--st-accent); display: grid; place-items: center; }
.shop-tour .st-buzz .cart svg { width: 20px; height: 20px; }
.shop-tour .st-buzz b { font-weight: 600; }
.shop-tour .st-buzz small { display: block; color: var(--st-muted); font-size: 12px; }

/* โปรเจคของฉัน */
.shop-tour .st-project { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border: 3px solid var(--st-outline); border-radius: 22px; box-shadow: 6px 6px 0 var(--st-outline); padding: 0; background: var(--st-bg); color: var(--st-ink); }
.shop-tour .st-project::backdrop { background: rgba(10, 18, 32, .5); }
.shop-tour .st-project-in { padding: 16px; display: grid; gap: 14px; }
.shop-tour .st-pname { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.shop-tour .st-pname input, .shop-tour .st-card input { border: 2px solid var(--st-line); border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 600; color: var(--st-ink); background: #fff; min-width: 0; }
.shop-tour .st-pname input { flex: 1 1 200px; }
.shop-tour .st-card { background: #fff; border: 2.5px solid var(--st-outline); border-radius: 18px; box-shadow: 4px 4px 0 var(--st-outline); padding: 12px 16px; display: grid; gap: 8px; }
.shop-tour .st-card h2 { font-weight: 600; font-size: 18px; margin: 0; }
.shop-tour .st-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.shop-tour .st-row label, .shop-tour .st-check { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--st-muted); }
.shop-tour #st-budget-input { width: 120px; font-variant-numeric: tabular-nums; }
.shop-tour .st-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-tour .st-presets button { border: 1.5px solid var(--st-line); background: var(--st-bg); color: var(--st-ink); font-size: 13px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.shop-tour .st-meter { position: relative; height: 22px; border-radius: 999px; background: var(--st-bg); border: 2px solid var(--st-outline); overflow: hidden; }
.shop-tour .st-meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--st-mint); transition: width .35s ease, background .2s; }
.shop-tour .st-meter.warn i { background: var(--st-accent); }
.shop-tour .st-meter.over i { background: var(--st-red); }
.shop-tour .st-budget-text { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; font-size: 14px; font-variant-numeric: tabular-nums; }
.shop-tour .st-budget-text .over { color: var(--st-red); }
.shop-tour .st-due-out { border-radius: 14px; padding: 10px 12px; background: var(--st-bg); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.shop-tour .st-due-out b { font-weight: 600; font-size: 17px; }
.shop-tour .st-due-out.ok { background: #d9f5ec; color: #0f5f4b; }
.shop-tour .st-due-out.tight { background: #fff4cc; color: #6b4e00; }
.shop-tour .st-due-out.late { background: #fde2e2; color: #8a1c1c; }
.shop-tour .st-due-out ol { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }

.shop-tour .st-toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -160%); background: var(--st-ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 500; transition: transform .2s; z-index: 1000; max-width: calc(100vw - 32px); }
.shop-tour .st-toast.show { transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .shop-tour .bubble { position: fixed; left: 12px !important; right: 12px; top: auto !important; width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-height: 78vh; overflow-y: auto; z-index: 900; }
  .shop-tour .bubble .list { max-height: 36vh; }
  .shop-tour .bubble .tail { display: none; }
  .shop-tour .st-hud { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .shop-tour * { transition: none !important; animation: none !important; } }
