/* The frame every product page shares (ยู, 2026-11-21: "อยากให้ดูกับทุกหน้าสินค้าเลย ตอนนี้มันมีบางอย่างไม่เหมือนกัน",
   then "ทั้ง 6 หน้าให้เหมือนกันทุกจุด"). Loaded LAST on /, /griptok/, /bubble/, /tabien/, /letter-clicker/, /flexi/, after
   shop.css and the page's own sheets, so one file decides what the six have in common:

     1. the first screen is the piece and its first choice: the big heading, the 01-02-03 steps and the promotion strip no
        longer stand above the name field
     2. under the 3D: one strip of tools (.viewbar), on every page
     3. the choices are numbered cards, 1 2 3 ..., in the page's own order
     4. the price of the piece on show and ใส่ตะกร้า ride at the bottom of the window on every page (#acts)
     5. after the choices, the same blocks in the same order: the promotion, this piece's summary, delivery, what you get,
        the price list, shipping, the font credits, the company

   frame.js is its other half (the delivery date in the bar, the button's wording while the page shows an example). */

/* ---------- 1. the first screen ---------- */
#steps{display:none}
.ckp-big{display:none!important}                 /* promo.js's SALE sticker beside the heading: the bar carries the cut price */
@media (max-width:899px){
  /* the tab already names the page; the heading stays for a screen reader and a search engine */
  #deck > .hero{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media (min-width:900px){
  #deck > .hero{padding:2px 4px 0}
  #deck > .hero h2{margin:0;font-size:20px;line-height:1.3}
  #deck > .hero p{display:none}
}

/* ---------- 2. under the 3D: the tools strip ---------- */
.viewbar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 8px;padding:6px 10px;border-top:1px solid #0f172a0f}
.viewbar .pill button{min-height:36px;padding:0 13px}
.viewbar > button{min-height:36px;padding:0 12px;border:0;border-radius:999px;background:#0f172a0d;color:var(--ink2);font-size:12px;font-weight:600;
  white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.viewbar > button:hover{background:#0f172a17}
.viewbar > button[aria-checked="true"]{background:var(--ink);color:#fff}
.viewbar > button[aria-busy="true"]{opacity:.6}
.viewbar > button svg{width:15px;height:15px;flex:none}
/* an example on show (<html data-demo>, set by the page's script while no name is typed): a small mark on the 3D,
   the same on every page. The keychain's "this is what is made" line steps aside meanwhile. */
html[data-demo] #window::after{content:attr(data-mark);position:absolute;z-index:3;top:8px;right:8px;padding:3px 10px;border-radius:999px;
  background:#0f172ad9;color:#fff;font-size:11px;font-weight:600;line-height:1.5;pointer-events:none}
html[data-demo] #window .note{display:none}
.typing #window::after{display:none}
/* the "drag to turn" pill sat on the piece's lowest part for as long as the page was open: it goes once the 3D has
   been touched, or after a few seconds (frame.js). A failed load keeps its message, which is also the retry button. */
#hint{transition:opacity .35s ease}
#hint.seen:not([data-failed]){opacity:0;pointer-events:none}
@media (min-width:900px){
  /* the 3D fills the window's height less the header, the card's margins and this strip */
  #window{height:calc(100vh - var(--headh) - 24px - 50px)}
  @supports (height:100dvh){#window{height:calc(100dvh - var(--headh) - 24px - 50px)}}
}

/* ---------- 3. the choices: numbered cards ---------- */
#deck{counter-reset:ckstep}
#deck > .card:not(.info):not(#buyCard){counter-increment:ckstep}
#deck > .card:not(.info):not(#buyCard) > .rowtop:first-child > :first-child::before{content:counter(ckstep);display:inline-grid;place-items:center;
  width:20px;height:20px;margin-right:8px;border-radius:50%;background:var(--ink);color:#fff;
  font:600 11px/1 'IBM Plex Mono',ui-monospace,monospace;vertical-align:1px}
#togs{padding:14px;gap:6px}
#togs .tg{min-height:44px;padding:2px 0}
.sell h3{font-size:15px}
/* the name field's help and its message, on every page */
.gthelp{margin:-4px 2px 0;font-size:12px;line-height:1.55;color:var(--ink4)}
#nameMsg{margin:-4px 2px 0;font-size:12px;line-height:1.55;color:var(--ink3)}
#nameMsg:empty{display:none}
#nameMsg.warn{color:#b91c1c}
#nameMsg a{font-weight:600}
/* the cord's colours inside the cord card (as tabien.css .tbcords, for the pages that do not load it) */
.tbcords{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.tbcords[hidden],.tbcords .sw[hidden]{display:none}

/* ---------- 4. the bar: this piece's price and ใส่ตะกร้า, on every page ---------- */
#acts{position:sticky;bottom:0;z-index:25;order:99;margin:2px -12px -12px;padding:8px 12px calc(12px + env(safe-area-inset-bottom));
  background:#fff;border:0;border-top:1px solid #0f172a1a;transform:none;
  display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"note note" "price add";align-items:center;gap:6px 14px;
  transition:transform .25s var(--spring)}
#acts .barnote{grid-area:note;margin:0;min-height:17px;font-size:11.5px;line-height:1.45;color:var(--ink3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#acts .barnote b{font-weight:700;color:var(--green-ink)}
#acts .barnote .sep{margin:0 5px;color:var(--line)}
#acts .barprice{grid-area:price;min-width:74px;display:flex;flex-direction:column;justify-content:center;line-height:1.2}
#acts .barprice .barlbl{font-size:11px;color:var(--ink4)}
#acts .gtprice{font-size:22px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
#acts .gtprice .ckp-was{margin-right:6px;font-size:13px;font-weight:500;color:var(--ink4)}
#acts .gtprice.ckp-cut{color:#be123c}
#acts .gtprice.soon{font-size:14px;color:var(--ink3)}
#acts #addBtn{grid-area:add;order:0;flex:none;width:100%;min-width:0;min-height:52px;padding:0 10px;border:0;border-radius:13px;
  background:var(--blue);color:var(--on-accent);font-size:15px;font-weight:700;white-space:nowrap;
  display:flex;align-items:center;justify-content:center;gap:6px;overflow:hidden;text-overflow:ellipsis}
#acts #addBtn:hover{background:var(--blue-d)}
#acts #addBtn:active{transform:scale(.985)}
#acts #addBtn[aria-busy="true"]{background:#bbf7d0;color:var(--green-ink);opacity:1}
/* an example on show (no name typed yet): the button says what to do first and does not look ready */
html[data-demo] #acts #addBtn{background:#e2e8f0;color:var(--ink3)}
html[data-demo] #acts #addBtn:hover{background:#dbe2ea}
/* While a name is being typed (core.js body.typing) shop.css slid the bar away for the keyboard -- and the price with it,
   just when the letters decide it (ยู, 2026-11-21: "ตอนที่พิมพ์อยู่ ... แถบตะกร้ามันหายไปด้วย"). Now it steps aside only while
   a keyboard has really taken the room (body.kbd, frame.js), and the price rides in the typing strip at the top, which
   is in sight either way. */
@media (max-width:899px){
  .typing #acts{transform:none}
  .typing.kbd #acts{transform:translateY(110%)}
}
#typebar .typeprice{display:flex;align-items:baseline;gap:5px;font-size:13px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
#typebar .typeprice:empty{display:none}
#typebar .typeprice:not(:empty) + span{display:none}          /* the price takes the hint's line */
#typebar .typeprice em{font-style:normal;font-weight:500;font-size:11px;color:var(--ink3)}
#typebar .typeprice s{font-weight:500;font-size:11px;color:var(--ink4)}
#typebar .typeprice.cut{color:#be123c}
@media (min-width:900px){
  #acts{margin:2px 0 0;bottom:12px;padding:10px 14px 12px;border:0;border-radius:16px;box-shadow:0 0 0 1px #0f172a1a,0 14px 30px -18px #0f172a59}
}
#toast{bottom:calc(112px + env(safe-area-inset-bottom))}

/* ---------- 5. after the choices: the same blocks, the same order ---------- */
#deck > .ckp-ban{order:2;margin:0}
#deck > #buyCard{order:3}
#deck > .delivery{order:4}
#deck > .trust{order:5;margin-top:0}
#deck > .sell{order:6}
#deck > .shipcard{order:7}
#deck > #credits,#deck > #gtFoot{order:8}
#deck > #who{order:9}
/* this piece in words (the pages that had a buy card): the price and the button now live in the bar */
#buyCard{box-shadow:0 0 0 1px #0f172a1a}
#buyCard .gtprod{text-align:left}
#buyCard .gtprod:empty,#buyCard .gtsum:empty{display:none}
.card.info h3{margin:0;font-size:15px;font-weight:700}
.delivery{gap:8px}
.delivery .etaline{margin:0;font-size:13px;line-height:1.55;color:var(--green-ink);font-weight:500}
.delivery #etaLine b{font-weight:700}
.delivery #liveStat{margin:0;padding:8px 0 0;border-top:1px solid var(--line2);min-height:0}
.delivery #liveStat[data-empty],.delivery #liveStat:empty{display:none}
.shipcard{gap:6px}
.shipcard .rows{display:flex;flex-direction:column;font-size:13px;color:var(--ink2)}
.shipcard .rows div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--line2)}
.shipcard .rows div:first-child{border-top:0}
.shipcard .rows b{font-weight:600;color:var(--ink)}
.shipcard .rows .free{color:var(--green-ink)}
.shipcard .fine{margin:2px 0 0;font-size:12px;line-height:1.6;color:var(--ink4)}
.sell{gap:0}
#deck > #who{padding:6px 4px 4px;border-top:0;font-size:12px;line-height:1.7;color:var(--ink4)}

/* ---------- "ดูสินค้าทั้งหมด" (frame.js, 2026-12-01): the button that floats over a product page and opens the catalogue.
   A phone: bottom right, 12px above the order bar (--fab-b is the bar's height while it sits at the screen's foot);
   from 900px: bottom left, clear of the order column. Under the bar and the header (z 25 / 31), over the page. ---------- */
#ckfab,#ckfab:hover{position:fixed;right:12px;bottom:calc(var(--fab-b,0px) + 12px);z-index:24;display:inline-flex;flex-flow:row nowrap;align-items:center;justify-content:center;gap:8px;
  width:auto;height:auto;
  min-height:44px;padding:0 16px 0 13px;border-radius:999px;background:var(--ink);color:#fff;font-size:14px;font-weight:600;line-height:1;
  text-decoration:none;white-space:nowrap;box-shadow:0 6px 18px -6px #0f172a73,0 1px 3px #0f172a33;touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;transition:transform .15s var(--ease),padding .2s var(--ease),opacity .2s var(--ease)}
#ckfab svg{flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linejoin:round}
#ckfab span{display:inline-block;max-width:160px;overflow:hidden;transition:max-width .2s var(--ease),opacity .15s var(--ease)}
#ckfab.fold{padding:0 13px}
#ckfab.fold span{max-width:0;opacity:0;margin-left:-8px}
#ckfab:active{transform:scale(.96);transition-duration:.08s}
#ckfab:focus-visible{outline:3px solid var(--blue-d);outline-offset:3px}
body.kbd #ckfab,body.typing #ckfab{opacity:0;pointer-events:none}
@media (min-width:900px){#ckfab,#ckfab:hover{right:auto;left:24px;bottom:24px}}
@media (prefers-reduced-motion:reduce){#ckfab,#ckfab span{transition:none}}
