/* TST หน้าร้าน v2 — parts shared by the per-theme layouts (cart, promo, queue, FAQ, tracking, effects base).
   Theme files (t-<theme>.css) decide the layout and the look; this file only gives sane defaults. */
.v2 { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }
.v2 h2, .v2 h3 { font-weight: inherit; }
.v2 img { max-width: 100%; height: auto; } /* width/height attributes are for layout shift only; CSS decides the shape */
.k-muted { color: var(--muted); font-size: 14px; }
.k-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* status + logo */
.k-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; }
.k-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 0 var(--accent); animation: k-ping 2s infinite; }
.k-status.is-closed { color: var(--muted); } .k-status.is-closed .k-dot { background: var(--muted); animation: none; }
.k-hours { color: var(--muted); }
@keyframes k-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.k-logo { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none; display: inline-grid; place-items: center; background: var(--tint); font: var(--w-display) 22px/1 var(--f-display); }
.k-logo img { width: 100%; height: 100%; object-fit: cover; }

.k-contacts { display: flex; flex-wrap: wrap; gap: 8px; }
.k-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.k-trust div { display: flex; flex-direction: column; }
.k-trust dd { font: var(--w-display) 22px/1.25 var(--f-display); margin: 0; }
.k-trust dt { color: var(--muted); font-size: 12px; line-height: 1.4; }

/* promo bar */
.k-promo { position: relative; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 8px 16px; background: var(--text); color: var(--bg); font-size: 14px; line-height: 1.4; text-align: center; }
.k-promo-t { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.k-promo-code { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 6px 10px; border-radius: 999px; border: 1.5px dashed currentColor; background: transparent; color: inherit; cursor: pointer; }
.k-promo-left { opacity: .85; font-variant-numeric: tabular-nums; }

/* jump nav */
.k-jump { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 16px; position: sticky; top: 0; z-index: 4; -webkit-overflow-scrolling: touch; }
.k-jump::-webkit-scrollbar { display: none; }
.k-jump a { flex: none; padding: 6px 14px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* products */
.k-badge { position: absolute; z-index: 2; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--accent); color: var(--on); }
.k-badge-hot { background: #F59F00; color: #2B1A00; } .k-badge-pre { background: var(--text); color: var(--bg); }
.k-stock { font-size: 12px; font-weight: 600; color: var(--at); margin-left: 8px; } .k-stock.is-out { color: var(--muted); }
.k-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); opacity: .5; }
.k-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r-btn); border: 1.5px solid var(--accent); background: transparent; color: var(--at);
  font: 600 14px/1 var(--f-body); cursor: pointer; transition: transform .15s var(--spring), background .15s; }
.k-add:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.k-add:active { transform: scale(.94); }
.k-add.added { background: var(--text); border-color: var(--text); color: var(--bg); }
.k-add-on, .k-add.added .k-add-l { display: none; } .k-add.added .k-add-on { display: inline; }
.k-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 16px; }
.k-chips button { flex: none; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: 600 14px/1.3 var(--f-body); cursor: pointer; }
.k-chips button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
[data-cat].k-hide { display: none !important; }

/* FAQ */
.k-faq { display: grid; gap: 8px; }
.k-faq details { border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.k-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.k-faq summary::-webkit-details-marker { display: none; }
.k-faq summary .i { transition: transform .25s var(--spring); color: var(--at); }
.k-faq details[open] summary .i { transform: rotate(45deg); }
.k-faq details p { padding: 0 16px 14px; color: var(--muted); }

/* tracking */
.k-track label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.k-track-row { display: flex; gap: 8px; }
.k-track input { flex: 1; min-width: 0; font: 16px/1.4 var(--f-body); padding: 10px 14px; border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-transform: uppercase; }
.k-track .btn { flex: none; min-height: 46px; }
.track-card { padding: 20px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; }
.track-code { font-weight: 600; } .track-items { color: var(--muted); }
.track-steps { display: grid; gap: 0; margin: 8px 0; }
.track-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--muted); }
.track-steps li span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); flex: none; z-index: 1; }
.track-steps li:not(:last-child)::after { content: ''; position: absolute; left: 7px; top: 28px; bottom: -8px; width: 2px; background: var(--line); }
.track-steps li.done { color: var(--text); } .track-steps li.done span { background: var(--accent); border-color: var(--accent); }
.track-steps li.done:has(+ li.done)::after { background: var(--accent); }
.track-steps li.now { font-weight: 600; }
.track-steps li.now span { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); }
.track-no b { font-family: ui-monospace, Consolas, monospace; }

/* cart */
.k-cart-fab { position: fixed; z-index: 20; right: 16px; bottom: 16px; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform .3s var(--spring); }
.k-cart-fab:hover { transform: scale(1.06); }
.k-cart-fab.bump { animation: k-bump .5s var(--spring); }
@keyframes k-bump { 30% { transform: scale(1.22) rotate(-8deg); } 60% { transform: scale(.94) rotate(4deg); } }
.k-cart-n { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--text); color: var(--bg); font: 600 12px/22px var(--f-body); }
.k-cart-n:empty, .k-cart-n[data-zero] { display: none; }
.k-cart { width: min(440px, 100vw); height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; background: var(--surface); color: var(--text); display: none; flex-direction: column; }
.k-cart[open] { display: flex; animation: k-slide .35s var(--ease); }
.k-cart::backdrop { background: rgba(20, 10, 20, .45); backdrop-filter: blur(2px); }
@keyframes k-slide { from { transform: translateX(100%); } }
.k-cart-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.k-cart-head h2 { font: var(--w-display) 22px/1.3 var(--f-display); }
.k-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--tint); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.k-cart-list { flex: 1; overflow-y: auto; padding: 8px 20px; }
.k-cart-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.k-cart-list .nm { flex: 1; min-width: 0; } .k-cart-list .nm small { display: block; color: var(--muted); }
.k-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.k-qty button { width: 34px; height: 34px; border: 0; background: none; color: var(--text); font-size: 18px; cursor: pointer; }
.k-qty b { min-width: 20px; text-align: center; font-size: 15px; }
.k-cart-empty { padding: 32px 20px; color: var(--muted); text-align: center; }
.k-cart-foot { padding: 16px 20px 24px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.k-cart-total { display: flex; justify-content: space-between; font-size: 18px; } .k-cart-total b { font: var(--w-display) 24px/1 var(--f-display); color: var(--at); }
.k-cart-send { display: grid; gap: 8px; } .k-cart-send .btn { width: 100%; }

/* lightbox, toast, footer */
[data-full] { cursor: zoom-in; }
.k-toast { position: fixed; z-index: 40; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; transition: .3s var(--spring); }
.k-toast.show { opacity: 1; transform: translate(-50%, 0); }
.k-foot { padding: 48px 16px 110px; text-align: center; font-size: 12px; color: var(--muted); }
.k-foot a { color: inherit; text-decoration: none; }

/* ---------- effects base (fx.js adds .fx0/.fx1/.fx2 on <body>) ---------- */
.fx1 [data-reveal], .fx2 [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.fx1 [data-reveal].in, .fx2 [data-reveal].in { opacity: 1; transform: none; }
.fx0 *, .fx0 *::before, .fx0 *::after { animation: none !important; transition: none !important; }
.k-intro { display: none; }
.fx2 .k-intro.play { display: grid; position: fixed; inset: 0; z-index: 50; place-items: center; pointer-events: none; }
.k-burst { position: fixed; z-index: 45; left: 0; top: 0; pointer-events: none; }
.k-burst i { position: absolute; display: block; }
[data-drag] { touch-action: pan-y; }
.dragging { cursor: grabbing; z-index: 30 !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .k-dot { animation: none; } }
