/* ===== WS3: เปลือกเว็บ — หน้าเนื้อหา, 404, skeleton, โหลดไม่สำเร็จ, สไลด์/ป๊อปอัป, ปุ่มลอยรวม, footer ติดต่อ, a11y ===== */
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* skip-link + วงโฟกัส :focus-visible = ของ sf-foundation ใน base.css (--ring) */

/* logo รูปจากหลังบ้าน (ui.js ตัดขอบขาวอัตโนมัติ) — ขนาดอยู่ใน base.css (.logo .logo-img) */
.logo.has-img{display:inline-flex;align-items:center}

/* skeleton การ์ดตอนโหลด */
.card.sk{cursor:default;pointer-events:none}
.card.sk:hover{transform:none;box-shadow:none;border-color:var(--line)}
.card.sk .imgwrap,.card.sk .cb i{background:linear-gradient(90deg,var(--soft) 0%,#EEECE9 50%,var(--soft) 100%);background-size:200% 100%;animation:adda-sk 1.3s linear infinite}
.card.sk .cb i{display:block;height:11px;border-radius:6px}
.card.sk .cb i+i{width:55%;height:14px}
@keyframes adda-sk{from{background-position:200% 0}to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.card.sk .imgwrap,.card.sk .cb i,.page-loading i{animation:none}}

/* โหลดไม่สำเร็จ + ปุ่มลองใหม่ */
.load-err{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:48px 16px;background:var(--soft);border-radius:var(--radius)}
.load-err b{font-size:16px}
.load-err span{color:var(--muted);font-size:14px;max-width:420px}
.load-err .btn{margin-top:8px}

/* หน้าเนื้อหา */
#pageView,#nfView{padding:28px 0 12px}
.page-body{max-width:820px;margin:0 auto;font-size:15.5px;line-height:1.75;color:#2E2A2B;overflow-wrap:anywhere}
.page-body h1{font-size:28px;line-height:1.4;margin:4px 0 14px;color:var(--ink)}
.page-body h2{font-size:20px;margin:28px 0 10px;color:var(--ink)}
.page-body h3{font-size:16.5px;margin:20px 0 8px;color:var(--ink)}
.page-body p{margin:0 0 12px}
.page-body ul,.page-body ol{margin:0 0 14px;padding-left:22px}
.page-body li{margin:4px 0}
.page-body a{color:var(--accent-ink);text-decoration:underline;text-underline-offset:2px}
.page-body img{max-width:100%;height:auto;border-radius:12px;display:block;margin:8px auto}
.page-body .pg-meta{color:var(--muted);font-size:13.5px}
.page-body .pg-note{background:var(--soft);border-left:4px solid var(--accent);padding:10px 14px;border-radius:8px;font-size:14.5px}
.pg-table{width:100%;border-collapse:collapse;margin:8px 0 14px;font-size:14.5px}
.pg-table th,.pg-table td{border:1px solid var(--line);padding:9px 11px;text-align:left;vertical-align:top}
.pg-table th{background:var(--soft);font-weight:600}
.pg-contact{list-style:none;padding:0!important;display:grid;gap:8px}
.pg-contact li{background:var(--soft);border-radius:10px;padding:10px 14px}
.pg-contact b{display:inline-block;min-width:76px}
.pg-steps li{margin:8px 0}
.pg-cards{list-style:none;padding:0!important;display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.pg-cards a{display:flex;flex-direction:column;gap:6px;color:inherit!important;text-decoration:none!important;border:1px solid var(--line);border-radius:14px;padding:10px}
.pg-cards a:hover{box-shadow:var(--shadow)}
.pg-cards span{color:var(--muted);font-size:13.5px}
.page-body .btn{text-decoration:none}
.page-loading{display:grid;gap:12px;padding:10px 0}
.page-loading i{display:block;height:16px;border-radius:8px;background:linear-gradient(90deg,var(--soft) 0%,#EEECE9 50%,var(--soft) 100%);background-size:200% 100%;animation:adda-sk 1.3s linear infinite}
.page-loading i:first-child{height:30px;width:60%}
@media(max-width:600px){.page-body{font-size:15px}.page-body h1{font-size:23px}.pg-table{font-size:13.5px}.pg-table th,.pg-table td{padding:7px 8px}}

/* 404 / 410 */
.nf{max-width:560px;margin:30px auto 10px;text-align:center}
.nf-ico{font-size:58px}
.nf h1{font-size:26px;margin:8px 0}
.nf p{color:var(--muted);margin-bottom:18px}
.nf .cta-row{justify-content:center}

/* สไลด์แบนเนอร์ */
.shop-slides{position:relative;max-width:var(--maxw);margin:14px auto 0;padding:0 18px}
.sl-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;border-radius:16px;-webkit-overflow-scrolling:touch}
.sl-track::-webkit-scrollbar{display:none}
.sl-item{flex:0 0 100%;scroll-snap-align:start;display:block}
.sl-item img{width:100%;height:auto;max-height:440px;object-fit:cover;display:block;background:var(--soft)}
.sl-dots{display:flex;justify-content:center;gap:6px;margin-top:8px}
.sl-dots button{width:8px;height:8px;border-radius:50%;border:none;background:#D3CFCB;padding:0;cursor:pointer}
.sl-dots button.on{background:var(--accent);width:22px;border-radius:4px}

/* ป๊อปอัปโปร */
.shop-pop{position:fixed;inset:0;z-index:120;background:rgba(15,17,20,.55);display:grid;place-items:center;padding:18px}
.shop-pop-card{position:relative;max-width:min(480px,100%);max-height:90vh}
.shop-pop-card img{display:block;max-width:100%;max-height:86vh;border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.35)}
.shop-pop-x{position:absolute;top:-14px;right:-10px;width:38px;height:38px;border-radius:50%;border:none;background:#fff;color:var(--ink);font-size:24px;line-height:1;cursor:pointer;box-shadow:var(--shadow-lg)}

/* ปุ่มลอย + แผงแชท/ผู้ช่วย AI = chat.css + ai.css (sf-chat) */

/* footer: ข้อมูลบริษัท/ติดต่อ = .fcompany / .fcl ใน base.css (sf-foundation) */

/* แถบความยินยอมคุกกี้ (js/analytics.js) — ไม่บังจอ ปุ่มยอมรับ/ปฏิเสธเด่นเท่ากัน */
.ck-bar{position:fixed;left:0;right:0;bottom:0;z-index:130;padding:0 12px calc(12px + env(safe-area-inset-bottom));pointer-events:none}
.ck-bar[hidden]{display:none}
.ck-in{position:relative;max-width:980px;margin:0 auto;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.22);padding:16px 18px;display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;pointer-events:auto}
.ck-txt{flex:1 1 420px;font-size:14px;line-height:1.6;color:#46403F}
.ck-txt b{color:var(--ink)}
.ck-txt a{color:var(--accent-ink);text-decoration:underline}
.ck-btns{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.ck-btns .btn{font-size:14px;padding:10px 18px}
.ck-btns [data-ck="reject"],.ck-btns [data-ck="accept"]{min-width:118px}
.ck-panel{flex:1 1 100%;display:flex;flex-direction:column;gap:8px;max-height:46vh;overflow:auto}
.ck-panel[hidden]{display:none}
.ck-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:12px;font-size:14px;cursor:pointer}
.ck-opt input{margin-top:4px;width:18px;height:18px;accent-color:var(--accent);flex:none}
.ck-opt small{display:block;color:var(--muted);font-size:12.5px;margin-top:2px}
.ck-x{position:absolute;top:6px;right:8px;border:none;background:none;font-size:22px;line-height:1;color:var(--muted);cursor:pointer;padding:4px 8px}
.ck-x[hidden],.ck-btns [hidden]{display:none}
body.ck-on .help-fab{visibility:hidden}
@media(max-width:760px){
  .ck-bar{padding:0 8px calc(8px + env(safe-area-inset-bottom))}
  .ck-in{padding:14px 14px 12px;gap:10px}
  .ck-txt{flex-basis:100%;font-size:13px}
  .ck-btns{width:100%}
  .ck-btns{flex-wrap:nowrap}
  .ck-btns .btn{flex:1 1 0;min-width:0;padding:10px 6px}
  .ck-btns [data-ck="reject"],.ck-btns [data-ck="accept"]{min-width:0}
}
.pdpa-note{font-size:12px;color:var(--muted);margin:8px 0 0;line-height:1.55}
.pdpa-note a{color:var(--accent-ink);text-decoration:underline}
.pg-ckbtn{font-size:14px;padding:8px 16px;margin:4px 0}
.page-body [id]{scroll-margin-top:84px}

/* ---------- เข้าหน้าสินค้า/หมวด/ค้นหาตรงๆ (server ใส่ <body data-route>) — ไม่โชว์หน้าแรกก่อนแล้วกระโดด (CLS) ---------- */
.route-skel{display:none}
body[data-route=product] #homeView{display:none}
body[data-route=product] #routeSkel{display:block}
body[data-route=category] #shopSlides,body[data-route=category] #homeView>.hero,body[data-route=category] #flashSec,
body[data-route=category] #promoSec,body[data-route=category] #forYouSec,
body[data-route=search] #shopSlides,body[data-route=search] #homeView>.hero,body[data-route=search] #flashSec,
body[data-route=search] #promoSec,body[data-route=search] #forYouSec{display:none!important}
.rs-pdp{padding-top:18px;padding-bottom:40px}
.rs-crumb{font-size:13px;color:var(--muted);margin-bottom:14px}
.rs-crumb a{color:inherit}
.rs-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:32px;align-items:start}
.rs-img{aspect-ratio:1/1;background:var(--soft,#F5F4F2);border-radius:18px;overflow:hidden}
.rs-img img{width:100%;height:100%;object-fit:contain;display:block}
.rs-info h1{font-size:26px;line-height:1.4;margin:4px 0 10px}
.rs-price{font-size:26px;font-weight:700;color:var(--ink);margin:0 0 12px}
.rs-out{display:inline-block;font-size:13px;font-weight:600;color:#fff;background:var(--ink);border-radius:20px;padding:2px 10px;vertical-align:middle}
.rs-desc{color:var(--muted);margin:0 0 10px}
.rs-sku{font-size:13px;color:var(--muted)}
.rs-bar{display:grid;gap:10px;margin-top:18px}
.rs-bar i{display:block;height:44px;border-radius:12px;background:linear-gradient(90deg,#EFEDEA 25%,#F7F6F4 50%,#EFEDEA 75%);background-size:200% 100%;animation:rsShimmer 1.2s linear infinite}
@keyframes rsShimmer{to{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.rs-bar i{animation:none}}
@media (max-width:760px){.rs-grid{grid-template-columns:1fr;gap:16px}.rs-info h1{font-size:21px}.rs-price{font-size:22px}}
/* ลิงก์ชื่อสินค้าในการ์ด (router.js ใส่ <a href> ให้ crawler) — หน้าตาเหมือนข้อความเดิม */
.card .nm a.card-link{color:inherit;text-decoration:none}
