/* =====================================================================
   Bright EngMath — Theme (styles.css)
   Warm orange • white • cream • rounded • mobile-first • cute-premium
   ===================================================================== */
:root{
  --orange:#FF8A3D;
  --orange-deep:#FF6B1A;
  --cream:#FFF7F0;
  --card:#FFFFFF;
  --ink:#26201B;             /* warm near-black (no harsh pure black) */
  --muted:#8A7A6D;
  --line:#F2E4D8;
  --soft:#FFEEDD;
  --ok:#1E9E5A;
  --line-green:#06C755;
  /* Supporting accents — soft purple + blue (premium, friendly) */
  --purple:#8B7CF6;
  --purple-soft:#EEEBFF;
  --blue:#4D8DF6;
  --blue-soft:#E6F0FF;
  --shadow:0 10px 30px rgba(255,107,26,.12);
  --shadow-sm:0 3px 12px rgba(17,17,17,.06);
  --shadow-card:0 6px 18px rgba(120,90,60,.08);
  --radius:20px;
  --radius-sm:14px;
  --maxw:480px;              /* mobile-first canvas width */
  --wide:1120px;             /* desktop content width */
  font-size:16px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:"Noto Sans Thai","Segoe UI",system-ui,-apple-system,sans-serif;
  color:var(--ink);
  background:var(--cream);
  line-height:1.55;
}

/* App shell centered like a phone frame on desktop */
.app{
  max-width:var(--maxw);
  margin:0 auto;
  min-height:100vh;
  background:var(--cream);
  position:relative;
  padding-bottom:78px;               /* room for sticky nav */
  box-shadow:0 0 40px rgba(0,0,0,.05);
}

/* ---- Top bar ------------------------------------------------------ */
.topbar{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;gap:12px;
  padding:14px 16px;
  background:rgba(255,247,240,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:1.1rem;color:var(--ink);text-decoration:none}
.brand .logo{
  width:38px;height:38px;border-radius:12px;flex:0 0 auto;
  background:linear-gradient(135deg,var(--orange),var(--orange-deep));
  display:grid;place-items:center;color:#fff;font-weight:900;font-size:1.05rem;
  overflow:hidden;
}
.brand .logo img{width:100%;height:100%;object-fit:cover}
.topbar .spacer{flex:1}
/* Desktop inline nav — hidden on mobile (hamburger used instead) */
.topnav{display:none}
.topnav a{
  color:var(--ink);text-decoration:none;font-weight:700;font-size:.95rem;
  padding:8px 12px;border-radius:10px;
}
.topnav a:hover{background:var(--soft);color:var(--orange-deep)}
.iconbtn{
  width:44px;height:44px;border-radius:12px;border:1px solid var(--line);
  background:var(--card);display:grid;place-items:center;cursor:pointer;font-size:1.2rem;
}
.iconbtn:hover{background:var(--soft)}

/* ---- Slide-in menu ----------------------------------------------- */
.menu-overlay{position:fixed;inset:0;background:rgba(17,17,17,.35);opacity:0;pointer-events:none;transition:.2s;z-index:50}
.menu-overlay.show{opacity:1;pointer-events:auto}
.menu{
  position:fixed;top:0;right:0;height:100%;width:78%;max-width:320px;
  background:var(--card);z-index:60;transform:translateX(105%);transition:.25s;
  padding:20px;box-shadow:-10px 0 30px rgba(0,0,0,.15);overflow:auto;
}
.menu.show{transform:translateX(0)}
.menu h3{margin:6px 0 14px;font-size:1rem;color:var(--muted)}
.menu a{
  display:flex;align-items:center;gap:12px;padding:14px 12px;border-radius:12px;
  text-decoration:none;color:var(--ink);font-weight:600;
}
.menu a:hover{background:var(--soft)}
.menu a .mi{font-size:1.2rem}

/* ---- Buttons ------------------------------------------------------ */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  border:none;border-radius:14px;padding:12px 18px;font-weight:700;font-size:1rem;
  min-height:44px;                              /* touch-friendly */
  cursor:pointer;text-decoration:none;font-family:inherit;line-height:1.2;
  transition:transform .06s ease, box-shadow .18s ease, background .18s ease;
}
.btn-primary{background:linear-gradient(135deg,var(--orange),var(--orange-deep));color:#fff;box-shadow:var(--shadow)}
.btn-primary:active{transform:translateY(1px)}
.btn-line{background:var(--line-green);color:#fff;box-shadow:0 8px 20px rgba(6,199,85,.25)}
/* Softer LINE support button (secondary / fallback) */
.btn-line-soft{background:#EAF9EF;color:#06955F;border:1px solid #BCE9CE}
.btn-line-soft:hover{background:#DFF6E8}
.btn-ghost{background:var(--card);border:1px solid var(--line);color:var(--ink)}
.btn-ghost:hover{background:var(--soft)}
.btn-block{width:100%}
.btn-lg{padding:15px 20px;font-size:1.06rem;border-radius:16px;min-height:52px}
/* Disabled / "payment coming soon" state — safe, obviously inactive */
.btn:disabled,.btn[aria-disabled="true"]{cursor:not-allowed;box-shadow:none}
.btn.is-soon{background:#F1E7DD;color:#A6907F;border:1px dashed #E2CDB9;
  background-image:none;font-weight:700}
/* Visible keyboard focus everywhere */
a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible,[tabindex]:focus-visible{
  outline:3px solid var(--blue);outline-offset:2px;border-radius:8px}

/* ---- Sections ---------------------------------------------------- */
.section{padding:18px 16px}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.section-head h2{font-size:1.12rem;margin:0}
.section-head a{color:var(--orange-deep);font-weight:700;text-decoration:none;font-size:.9rem}
.eyebrow{color:var(--orange-deep);font-weight:800;font-size:.78rem;letter-spacing:.04em;text-transform:uppercase}

/* ---- Hero -------------------------------------------------------- */
.hero{
  margin:14px 16px;padding:20px 20px;border-radius:22px;color:#fff;position:relative;overflow:hidden;
  background:linear-gradient(135deg,var(--orange),var(--orange-deep));
  box-shadow:var(--shadow);
}
.hero h1{font-size:1.5rem;margin:0 0 8px;line-height:1.3}
.hero p{margin:0 0 16px;opacity:.95;font-size:.98rem}
.hero .btn{background:#fff;color:var(--orange-deep)}
.hero .blob{position:absolute;border-radius:50%;background:rgba(255,255,255,.16)}
.hero .b1{width:150px;height:150px;top:-50px;right:-30px}
.hero .b2{width:90px;height:90px;bottom:-30px;right:60px}

/* Compact home hero (≈20–25% shorter than before) */
.hero-home{display:flex;align-items:center;gap:12px;padding:18px 20px}
.hero-home .hero-inner{flex:1;min-width:0;position:relative;z-index:1}
.hero-eyebrow{color:#fff;opacity:.92;letter-spacing:.08em}
.hero-home h1{font-size:1.32rem;margin:6px 0 6px;line-height:1.28}
.hero-formats{margin:0 0 4px;font-weight:700;font-size:.86rem;opacity:.98}
.hero-tag{margin:0 0 14px;font-size:.9rem;opacity:.92}
.hero-cta{display:flex;gap:10px;flex-wrap:wrap;margin:0}
.btn-hero-primary{background:#fff;color:var(--orange-deep);box-shadow:0 6px 16px rgba(0,0,0,.12)}
.btn-hero-ghost{background:rgba(255,255,255,.16);color:#fff;border:1px solid rgba(255,255,255,.5)}
.btn-hero-ghost:hover{background:rgba(255,255,255,.26)}
.hero-art{flex:0 0 auto;position:relative;z-index:1;display:grid;place-items:center}
.hero-art svg{width:104px;height:104px;display:block}
/* Slim hero for sub-pages (free / how / contact / lookup) */
.hero-slim{padding:18px 20px}
.hero-slim .hero-inner{position:relative;z-index:1}
.hero-slim h1{margin:0 0 4px}
.hero-slim p{margin:0;font-size:.92rem}

/* Tighter section spacing (trust row + search card sit close to hero) */
.section.pad-tight{padding:8px 16px}

/* ---- Category icons grid (equal-height cards) -------------------- */
.cats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.cat{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:14px 8px;text-align:center;text-decoration:none;color:var(--ink);
  box-shadow:var(--shadow-card);
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  min-height:120px;transition:transform .12s ease, box-shadow .18s ease;
}
.cat:hover{transform:translateY(-2px);box-shadow:var(--shadow)}
.cat .cico{
  width:52px;height:52px;margin:0 auto 8px;border-radius:14px;background:var(--soft);
  display:grid;place-items:center;font-size:1.5rem;flex:0 0 auto;
}
.cat .cname{font-weight:800;font-size:.84rem;display:block;line-height:1.2}
.cat .cth{font-size:.72rem;color:var(--muted);margin-top:2px}
/* Free-resources category card — soft purple accent */
.cat-free{background:var(--purple-soft);border-color:#DED7FF}
.cat-free .cico{background:#fff}
.cat-free .cname{color:#6B5AE0}

/* ---- Product cards ----------------------------------------------- */
.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  overflow:hidden;box-shadow:var(--shadow-sm);text-decoration:none;color:var(--ink);
  display:flex;flex-direction:column;
}
.card .thumb{aspect-ratio:1/1;background:var(--soft);position:relative;overflow:hidden}
.card .thumb img{width:100%;height:100%;object-fit:cover}
.card .ph,.detail .ph{width:100%;height:100%;display:grid;place-items:center;font-size:3rem;
  background:linear-gradient(135deg,#FFE6D2,#FFF3E9)}
.card .badges{position:absolute;top:8px;left:8px;display:flex;flex-direction:column;gap:5px}
.badge{font-size:.66rem;font-weight:800;padding:3px 8px;border-radius:999px;color:#fff}
.badge.rec{background:var(--orange)}
.badge.best{background:var(--orange-deep)}
.badge.off{background:#B9A99C}
.badge.new{background:#2F9E8F}
.badge.sale{background:#E14A3B}
.card{transition:transform .12s ease, box-shadow .18s ease}
.card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.card .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:3px;flex:1}
.card .cat-tag{font-size:.68rem;color:var(--orange-deep);font-weight:700}
.card .pname{font-weight:800;font-size:.9rem;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.34em}
.card .psub{font-size:.74rem;color:var(--muted);line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.card .card-meta{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px}
.card .lvl{font-size:.66rem;font-weight:700;color:#6B5AE0;background:var(--purple-soft);
  padding:2px 7px;border-radius:999px}
.card .price-row{margin-top:auto;padding-top:6px;display:flex;align-items:baseline;justify-content:space-between;gap:6px}
.card .price{font-weight:900;color:var(--orange-deep);font-size:1.05rem}
.card .code{font-size:.64rem;color:var(--muted);font-weight:600}
.card-link{display:flex;flex-direction:column;text-decoration:none;color:inherit;flex:1}
.card-actions{display:flex;gap:6px;padding:0 10px 12px;margin-top:auto}
.btn-sm{padding:9px 8px;font-size:.8rem;border-radius:11px;flex:1;line-height:1.15;min-height:40px}
.card-actions .btn-sm{flex:1}

/* ---- Hero banner product ----------------------------------------- */
.hero-product{display:flex;gap:14px;align-items:center;background:linear-gradient(135deg,#FFF3E9,#FFE6D2);
  border:1px solid var(--line);border-radius:var(--radius);padding:12px;text-decoration:none;color:var(--ink);box-shadow:var(--shadow-sm)}
.hero-product .hp-img{width:96px;height:96px;flex:0 0 auto;border-radius:14px;overflow:hidden;background:var(--soft)}
.hero-product .hp-img img{width:100%;height:100%;object-fit:cover}
.hero-product .hp-body{display:flex;flex-direction:column;gap:3px;min-width:0}
.hero-product .hp-tag{font-size:.72rem;font-weight:800;color:#b8860b}
.hero-product h3{margin:0;font-size:1rem;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hero-product .hp-price{font-weight:900;color:var(--orange-deep);font-size:1.15rem}
.hero-product .hp-cta{font-size:.8rem;color:var(--orange-deep);font-weight:700}

/* ---- Free resources banner --------------------------------------- */
.free-banner{display:flex;align-items:center;gap:12px;background:linear-gradient(135deg,var(--orange),var(--orange-deep));
  color:#fff;border-radius:var(--radius);padding:16px;text-decoration:none;box-shadow:var(--shadow)}
.free-banner .fb-ico{font-size:1.8rem}
.free-banner .fb-text{flex:1;display:flex;flex-direction:column}
.free-banner .fb-text b{font-size:1rem}
.free-banner .fb-text span{font-size:.82rem;opacity:.95}
.free-banner .fb-go{font-size:1.4rem;font-weight:900}

/* ---- Large home search ------------------------------------------- */
.big-search{padding:14px 16px 4px}
.big-search form{display:flex;align-items:center;gap:8px;background:var(--card);border:2px solid var(--soft);
  border-radius:16px;padding:6px 8px 6px 14px;box-shadow:var(--shadow-sm)}
.big-search form:focus-within{border-color:var(--orange)}
.big-search .bs-ico{font-size:1.1rem}
.big-search input{flex:1;border:none;outline:none;font-size:1rem;font-family:inherit;background:transparent;padding:10px 4px}
.big-search .btn{padding:11px 16px;border-radius:12px}

/* ---- Promotion banner -------------------------------------------- */
.promo-banner{display:flex;align-items:center;gap:12px;background:linear-gradient(135deg,#FFE1B0,#FFD0A0);
  border:1px solid #F6D9B0;border-radius:var(--radius-sm);padding:12px 16px;margin-bottom:14px}
.promo-banner .pb-ico{font-size:1.7rem}
.promo-banner .pb-text{display:flex;flex-direction:column}
.promo-banner .pb-text b{color:#B8620B}
.promo-banner .pb-text span{font-size:.82rem;color:#9A6A2E}

/* ---- Product specs + tags ---------------------------------------- */
.specs{display:flex;flex-direction:column;gap:8px}
.specs .spec{display:flex;justify-content:space-between;gap:12px;font-size:.9rem;
  padding-bottom:8px;border-bottom:1px dashed var(--line)}
.specs .spec:last-child{border-bottom:none;padding-bottom:0}
.specs .spec span{color:var(--muted)}
.taglist{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
.taglet{background:var(--soft);color:var(--orange-deep);font-size:.75rem;font-weight:700;padding:4px 10px;border-radius:999px}

/* ---- FAQ --------------------------------------------------------- */
.faq-list{display:flex;flex-direction:column;gap:10px}
.faq-item{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:4px 14px;box-shadow:var(--shadow-sm)}
.faq-item summary{cursor:pointer;font-weight:700;padding:12px 0;list-style:none}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary::before{content:"＋";color:var(--orange-deep);font-weight:900;margin-right:8px}
.faq-item[open] summary::before{content:"－"}
.faq-item .faq-a{color:var(--muted);padding:0 0 14px;font-size:.92rem}

/* ---- Rich footer ------------------------------------------------- */
.site-footer{padding:26px 16px calc(30px + env(safe-area-inset-bottom));background:var(--card);border-top:1px solid var(--line);margin-top:10px}
.site-footer .sf-links{display:flex;flex-wrap:wrap;gap:10px 18px;justify-content:center;margin-bottom:14px}
.site-footer .sf-links a{color:var(--ink);text-decoration:none;font-weight:700;font-size:.85rem}
.site-footer .sf-links a:hover{color:var(--orange-deep)}
.site-footer .sf-social{display:flex;gap:12px;justify-content:center;margin-bottom:14px}
.site-footer .sf-social a{width:40px;height:40px;border-radius:12px;background:var(--soft);display:grid;place-items:center;font-size:1.2rem;text-decoration:none}
.site-footer .sf-copy{text-align:center;color:var(--muted);font-size:.8rem}
.site-footer .sf-copy a{color:var(--muted)}

/* ---- Product code lookup ----------------------------------------- */
.lookup-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-sm)}
.lookup-card .lc-top{display:flex;gap:14px}
.lookup-card .lc-img{width:90px;height:90px;flex:0 0 auto;border-radius:14px;overflow:hidden;background:var(--soft)}
.lookup-card .lc-img img{width:100%;height:100%;object-fit:cover}
.lookup-card .lc-info h3{margin:4px 0;font-size:1.05rem}
.lookup-card .lc-qr{text-align:center;margin-top:14px}
.lookup-card .lc-qr h4{margin:0 0 8px;font-size:.9rem}
.lookup-card .lc-qr img{max-width:200px;width:100%;border-radius:12px;border:1px solid var(--line)}

/* ---- Product detail ---------------------------------------------- */
.detail .gallery{aspect-ratio:1/1;background:var(--soft);position:relative;overflow:hidden}
.detail .gallery img{width:100%;height:100%;object-fit:cover}
.detail .thumbs{display:flex;gap:8px;padding:10px 16px;overflow:auto}
.detail .thumbs img{width:56px;height:56px;border-radius:10px;object-fit:cover;border:2px solid transparent;cursor:pointer}
.detail .thumbs img.active{border-color:var(--orange)}
.detail-body{padding:16px}
.detail .p-code{color:var(--muted);font-weight:600;font-size:.82rem}
.detail h1{font-size:1.35rem;margin:6px 0}
.detail .p-price{font-size:1.6rem;font-weight:900;color:var(--orange-deep)}
.chip{display:inline-block;background:var(--soft);color:var(--orange-deep);font-weight:700;
  font-size:.78rem;padding:5px 12px;border-radius:999px}
.infobox{background:var(--card);border:1px solid var(--line);border-radius:var(--radius-sm);
  padding:14px;margin-top:14px}
.infobox h4{margin:0 0 6px;font-size:.9rem}
.delivery{display:flex;gap:10px;align-items:center;background:#EAF9F0;border:1px solid #CDEEDB;
  border-radius:var(--radius-sm);padding:12px 14px;margin-top:14px;color:#0E7A42;font-weight:600;font-size:.9rem}

/* Sticky order bar on detail */
.orderbar{
  position:fixed;left:0;right:0;bottom:0;z-index:45;max-width:var(--maxw);margin:0 auto;
  background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border-top:1px solid var(--line);
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));display:flex;gap:12px;align-items:center;
}
.orderbar .op{font-weight:900;color:var(--orange-deep);font-size:1.2rem;white-space:nowrap}

/* ---- Steps / how to order ---------------------------------------- */
.steps{display:flex;flex-direction:column;gap:12px}
.step{display:flex;gap:14px;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:14px;box-shadow:var(--shadow-sm)}
.step .num{flex:0 0 auto;width:34px;height:34px;border-radius:50%;
  background:linear-gradient(135deg,var(--orange),var(--orange-deep));color:#fff;
  font-weight:800;display:grid;place-items:center}
.step .stext b{display:block;margin-bottom:2px}
.step .stext span{color:var(--muted);font-size:.88rem}

/* ---- Contact channels -------------------------------------------- */
.channels{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.channel{display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:14px;text-decoration:none;color:var(--ink);font-weight:700;box-shadow:var(--shadow-sm)}
.channel .ci{width:40px;height:40px;border-radius:12px;background:var(--soft);display:grid;place-items:center;font-size:1.2rem}

/* ---- Search ------------------------------------------------------ */
.searchbar{display:flex;gap:10px;padding:14px 16px}
.searchbar input{flex:1;border:1px solid var(--line);border-radius:14px;padding:13px 14px;font-size:1rem;font-family:inherit;background:var(--card)}
.searchbar input:focus{outline:2px solid var(--orange);border-color:transparent}

/* ---- Filter pills ------------------------------------------------ */
.pills{display:flex;gap:8px;overflow:auto;padding:4px 16px 12px}
.pill{white-space:nowrap;border:1px solid var(--line);background:var(--card);color:var(--ink);
  padding:8px 14px;border-radius:999px;font-weight:700;font-size:.85rem;cursor:pointer}
.pill.active{background:var(--orange);color:#fff;border-color:var(--orange)}

/* ---- Sticky bottom nav ------------------------------------------- */
.bottomnav{
  position:fixed;left:0;right:0;bottom:0;z-index:40;max-width:var(--maxw);margin:0 auto;
  display:grid;grid-template-columns:repeat(5,1fr);
  background:rgba(255,255,255,.97);backdrop-filter:blur(8px);border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.bottomnav a{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 0;
  text-decoration:none;color:var(--muted);font-size:.64rem;font-weight:700}
.bottomnav a .ni{font-size:1.25rem}
.bottomnav a.active{color:var(--orange-deep)}

/* ---- Custom uploaded icons (replace emoji; emoji stays fallback) ----
   Sized with em so each icon automatically matches the emoji it replaces
   in every context (category grid, pills, nav, banners, chips). */
img.be-ico{width:1em;height:1em;object-fit:contain;border-radius:22%;
  vertical-align:-0.12em;display:inline-block}
.cico img.be-ico{width:1.5em;height:1.5em;border-radius:12px}
.channel .ci img.be-ico{width:1.4em;height:1.4em;border-radius:10px}
.ph img.be-ico{border-radius:18px}
.bottomnav a .ni img.be-ico{display:block;margin:0 auto}
.menu a .mi img.be-ico{width:1.2em;height:1.2em}

/* ---- Delivery info block (Admin → ตั้งค่าการจัดส่งไฟล์) ---------- */
.delivery-info{background:var(--soft);border:1px solid var(--line);border-radius:14px;
  padding:14px 16px;margin-top:12px;line-height:1.65}
.delivery-info .di-title{font-weight:800;font-size:.95rem;margin-bottom:4px}
.delivery-info .di-promise{font-weight:700;color:var(--orange-deep)}
.delivery-info .di-hours{color:var(--muted);font-size:.88rem}
.delivery-info .di-after{color:var(--muted);font-size:.85rem;margin-top:6px}
.delivery-info .di-note{color:var(--muted);font-size:.85rem;margin-top:6px;
  border-top:1px dashed var(--line);padding-top:6px}

/* ---- Shopping cart (additive feature) ---------------------------- */
.cart-btn{position:relative}
.cart-badge{position:absolute;top:-2px;right:-4px;min-width:16px;height:16px;padding:0 4px;
  border-radius:9px;background:var(--orange-deep);color:#fff;font-size:.62rem;font-weight:800;
  display:grid;place-items:center;line-height:1}
.card-cart{padding:0 10px 12px}
.cart-overlay{position:fixed;inset:0;background:rgba(17,17,17,.35);opacity:0;pointer-events:none;transition:.2s;z-index:70}
.cart-overlay.show{opacity:1;pointer-events:auto}
.cart-drawer{position:fixed;top:0;right:0;bottom:0;width:min(400px,100%);z-index:71;
  background:var(--card,#fff);transform:translateX(105%);transition:.25s;
  display:flex;flex-direction:column;box-shadow:-8px 0 30px rgba(0,0,0,.12)}
.cart-drawer.show{transform:translateX(0)}
.cart-head{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--line)}
.cart-head h3{margin:0;font-size:1.05rem}
.cart-x{border:0;background:var(--soft);width:32px;height:32px;border-radius:10px;cursor:pointer;font-size:.9rem}
.cart-list{flex:1;overflow-y:auto;padding:10px 16px}
.cart-item{display:flex;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line)}
.cart-item:last-child{border-bottom:none}
.cart-thumb{width:52px;height:52px;border-radius:12px;background:var(--soft);overflow:hidden;
  display:grid;place-items:center;flex:none}
.cart-thumb img{width:100%;height:100%;object-fit:cover}
.cart-ph{font-size:1.4rem}
.cart-info{flex:1;min-width:0}
.cart-name{font-weight:700;font-size:.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cart-code{color:var(--muted);font-size:.75rem}
.cart-price{color:var(--orange-deep);font-weight:800;font-size:.9rem}
.cart-rm{border:0;background:var(--soft);width:28px;height:28px;border-radius:9px;cursor:pointer;
  color:var(--muted);font-size:.8rem;flex:none}
.cart-foot{border-top:1px solid var(--line);padding:14px 16px calc(14px + env(safe-area-inset-bottom))}
.cart-row{display:flex;justify-content:space-between;font-size:.88rem;color:var(--muted);margin-bottom:6px}
.cart-row b{color:var(--ink)}
.cart-row.cart-total{font-size:1rem;margin:8px 0 12px}
.cart-row.cart-total b{color:var(--orange-deep);font-size:1.15rem;font-weight:900}
.cart-acts{display:flex;gap:8px;margin-top:10px}
.cart-acts .btn{flex:1}
.cart-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--muted);padding:30px;text-align:center}
.cart-empty-ico{font-size:2.6rem;margin-bottom:8px}

/* ---- Footer ------------------------------------------------------ */
.footer{padding:24px 16px 30px;text-align:center;color:var(--muted);font-size:.82rem}

/* ---- Empty state ------------------------------------------------- */
.empty{text-align:center;color:var(--muted);padding:50px 20px}
.empty .e-ico{font-size:2.6rem;margin-bottom:8px}

/* ---- Skeleton loading cards (first-visit, nothing cached yet) ----
   Reuses the real .grid/.card/.thumb layout so the loading state matches
   the loaded design instead of introducing a new one. */
.skeleton-status{text-align:center;color:var(--muted);font-size:.85rem;padding:14px 20px 0}
.skeleton-card{pointer-events:none}
.skeleton-card .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:8px}
.skeleton-line{display:block;height:10px;border-radius:6px}
.skeleton-fx{background:linear-gradient(90deg,var(--soft) 25%,#eee 37%,var(--soft) 63%);
  background-size:400% 100%;animation:skeleton-shimmer 1.4s ease infinite}
@keyframes skeleton-shimmer{0%{background-position:100% 50%}100%{background-position:0 50%}}
@media (prefers-reduced-motion: reduce){.skeleton-fx{animation:none}}

/* ---- Toast ------------------------------------------------------- */
.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);
  background:var(--ink);color:#fff;padding:12px 18px;border-radius:12px;font-weight:600;font-size:.9rem;
  opacity:0;pointer-events:none;transition:.25s;z-index:99;max-width:90%;text-align:center;white-space:pre-line}
.toast.show{opacity:.96;transform:translateX(-50%) translateY(0)}

/* =====================================================================
   Step 8 additions — trust row, combined search, buy actions,
   checkout modal, cart fallback, responsive desktop, accessibility
   ===================================================================== */

/* ---- Trust benefits row ------------------------------------------ */
.trust-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.trust{display:flex;align-items:center;gap:8px;background:var(--card);border:1px solid var(--line);
  border-radius:14px;padding:10px;box-shadow:var(--shadow-card)}
.trust .tico{width:34px;height:34px;flex:0 0 auto;border-radius:10px;background:var(--blue-soft);
  display:grid;place-items:center;font-size:1.05rem}
.trust .ttext{display:flex;flex-direction:column;min-width:0}
.trust .ttext b{font-size:.78rem;line-height:1.2}
.trust .ttext span{font-size:.68rem;color:var(--muted);line-height:1.2}

/* ---- Combined search card ---------------------------------------- */
.search-card{background:var(--card);border:1px solid var(--line);border-radius:18px;
  padding:12px;box-shadow:var(--shadow-card)}
.search-card form{display:flex;align-items:center;gap:8px;background:#fff;border:2px solid var(--soft);
  border-radius:14px;padding:4px 6px 4px 12px}
.search-card form:focus-within{border-color:var(--orange)}
.search-card .sc-ico{font-size:1.05rem;flex:0 0 auto}
.search-card input{flex:1;min-width:0;border:none;outline:none;font-size:1rem;font-family:inherit;
  background:transparent;padding:11px 4px}
.search-card .sc-clear{border:none;background:var(--soft);color:var(--muted);width:30px;height:30px;
  border-radius:9px;cursor:pointer;flex:0 0 auto;font-size:.8rem}
.search-card .sc-go{padding:11px 16px;border-radius:12px;min-height:auto;flex:0 0 auto}
.search-card .sc-hint{margin:8px 2px 0;font-size:.76rem;color:var(--muted)}
.search-card .sc-hint b{color:var(--orange-deep)}

/* ---- Product detail: purchase block ------------------------------ */
.buy-block{margin-top:14px;display:flex;flex-direction:column;gap:8px}
.buy-block .buy-sub{display:flex;gap:8px;flex-wrap:wrap}
.buy-block .buy-sub .btn{flex:1;min-width:130px}
.buy-block .buy-note{margin:2px 0 0;font-size:.78rem;color:var(--muted);
  background:var(--purple-soft);border-radius:10px;padding:8px 10px}
.buy-block .buy-share{align-self:flex-start;flex:0 0 auto;min-height:40px}
/* Sticky order bar — extra LINE support button stays compact */
.orderbar .orderbar-line{flex:0 0 auto;width:56px;padding:0}

/* ---- "Soft note" infobox (transition messaging) ------------------ */
.infobox.note-soft{background:var(--blue-soft);border-color:#CFE0FB}

/* ---- Cart: primary payment + secondary LINE fallback ------------- */
.cart-fallback{margin-top:14px;padding-top:12px;border-top:1px dashed var(--line)}
.cart-fallback-note{margin:6px 2px 0;text-align:center;font-size:.72rem;color:var(--muted)}
.cart-clear-link{width:100%;background:none;border:none;color:var(--muted);
  font-weight:700;font-size:.82rem;margin-top:8px;min-height:auto;padding:8px}
.cart-clear-link:hover{color:var(--orange-deep)}

/* ---- Checkout modal (checkout.js) -------------------------------- */
.co-overlay{position:fixed;inset:0;background:rgba(20,10,0,.5);z-index:90;
  display:none;align-items:center;justify-content:center;padding:20px}
.co-overlay.show{display:flex}
.co-modal{background:var(--card);border-radius:var(--radius);width:100%;max-width:420px;
  padding:20px;box-shadow:0 24px 60px rgba(0,0,0,.3)}
.co-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:6px}
.co-head h3{margin:0;font-size:1.1rem}
.co-x{border:none;background:var(--soft);width:32px;height:32px;border-radius:10px;cursor:pointer;
  font-size:.85rem;flex:0 0 auto}
.co-msg{color:var(--muted);font-size:.9rem;margin:6px 0 16px;line-height:1.6}
.co-note{text-align:center;font-size:.72rem;color:var(--muted);margin:10px 0 0}
.co-loading{display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px 6px;text-align:center}
.co-loading p{margin:0;color:var(--muted);font-weight:700}
.co-spinner{width:38px;height:38px;border-radius:50%;border:4px solid var(--soft);
  border-top-color:var(--orange-deep);animation:co-spin .8s linear infinite}
@keyframes co-spin{to{transform:rotate(360deg)}}

/* =====================================================================
   Responsive desktop / tablet — grow the phone frame into a real store
   ===================================================================== */
@media (min-width:760px){
  .app{max-width:var(--wide);padding-bottom:24px;box-shadow:none;background:transparent}
  .topbar{padding:14px 28px;gap:20px}
  .topnav{display:flex;align-items:center;gap:4px}
  #menuBtn{display:none}            /* full nav visible → hamburger not needed */
  .bottomnav{display:none}          /* mobile-only bottom nav */

  .section{padding:20px 28px}
  .section.pad-tight{padding:10px 28px}
  .hero{margin:20px 28px}
  .hero-home{padding:30px 34px;gap:24px}
  .hero-home h1{font-size:1.9rem}
  .hero-formats{font-size:1rem}
  .hero-tag{font-size:1.02rem}
  .hero-art svg{width:150px;height:150px}

  .trust-row{gap:14px}
  .trust{padding:14px}
  .trust .tico{width:42px;height:42px;font-size:1.25rem}
  .trust .ttext b{font-size:.9rem}
  .trust .ttext span{font-size:.78rem}

  .cats{grid-template-columns:repeat(4,1fr);gap:16px}
  .grid{grid-template-columns:repeat(3,1fr);gap:18px}

  /* Detail page: no fixed bottom bar on desktop → show inline actions */
  .orderbar{position:static;max-width:none;background:transparent;border-top:none;
    backdrop-filter:none;padding:14px 0 0;margin-top:8px}
  .orderbar .orderbar-line{width:auto;padding:0 18px}

  .site-footer{border-radius:20px;margin-top:20px}
}

@media (min-width:1000px){
  .grid{grid-template-columns:repeat(4,1fr)}
  .hero-art svg{width:180px;height:180px}
}

/* Very small phones — keep hero art from crowding the copy */
@media (max-width:359px){
  .hero-art{display:none}
  .trust .ttext span{display:none}
}

/* ---- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;
    transition-duration:.001ms!important;scroll-behavior:auto!important}
  .card:hover,.cat:hover{transform:none}
}
