/* SurePrice — สไตล์ทั้งเว็บในไฟล์เดียว (เบา โหลดเร็ว ไม่พึ่ง framework) */
:root {
  --ink: #0f172a; --ink2: #334155; --mute: #64748b; --line: #e2e8f0; --bg: #f5f7fb; --card: #fff;
  --brand: #d6114f; --brand-d: #a90c3e; --blue: #0a84c6; --blue-d: #076699; --navy: #0b2545;
  --green: #06c755; --green-d: #05a647; --amber: #f59e0b; --price: #d6114f;
  --r: 12px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif; }
a { color: var(--blue-d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--mute); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; line-height: 1.2; transition: background .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-line { background: var(--green); color: #fff; } .btn-line:hover { background: var(--green-d); }
.btn-blue { background: var(--blue); color: #fff; } .btn-blue:hover { background: var(--blue-d); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); } .btn-ghost:hover { border-color: var(--blue); color: var(--blue-d); }
.btn-lg { padding: 14px 22px; font-size: 1.05rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.ico { width: 20px; height: 20px; flex: none; fill: currentColor; }

/* ---------- หัวเว็บ ---------- */
.topbar { background: var(--navy); color: #cbd5e1; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 12px; padding-top: 6px; padding-bottom: 6px; }
.topbar a { color: #fff; font-weight: 600; }
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header .wrap { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; flex: none; }
.logo svg { height: 34px; width: auto; }
.search { position: relative; flex: 1; max-width: 640px; }
.search form { display: flex; border: 2px solid var(--blue); border-radius: 12px; overflow: hidden; background: #fff; }
.search input { flex: 1; min-width: 0; border: 0; padding: 10px 14px; font: inherit; outline: none; }
.search button { border: 0; background: var(--blue); color: #fff; padding: 0 16px; cursor: pointer; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: none; z-index: 50; }
.suggest.on { display: block; }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; color: var(--ink); text-decoration: none; }
.suggest a:hover, .suggest a.act { background: #eef6fc; }
.suggest img { width: 40px; height: 40px; object-fit: contain; background: #f8fafc; border-radius: 6px; flex: none; }
.suggest .t { flex: 1; font-size: 14px; line-height: 1.35; }
.suggest .p { color: var(--price); font-weight: 700; font-size: 14px; white-space: nowrap; }
.suggest .all { justify-content: center; font-weight: 700; color: var(--blue-d); border-top: 1px solid var(--line); }
.hdr-actions { display: flex; gap: 8px; align-items: center; }
.quote-ico { position: relative; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; padding: 8px 10px; border-radius: 10px; }
.quote-ico:hover { background: var(--bg); text-decoration: none; }
.quote-ico .cnt { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; line-height: 18px; text-align: center; display: none; }
.quote-ico .cnt.on { display: block; }
.nav { background: #fff; border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 4px; padding-bottom: 4px; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; color: var(--ink2); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.nav a:hover, .nav a.on { background: #eef6fc; color: var(--blue-d); text-decoration: none; }

/* ---------- ทั่วไป ---------- */
main { min-height: 50vh; }
.section { padding: 28px 0; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.crumb { font-size: 13px; color: var(--mute); padding: 14px 0 6px; }
.crumb a { color: var(--mute); } .crumb span { margin: 0 6px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink2); font-size: 14px; }
.chip:hover { border-color: var(--blue); color: var(--blue-d); text-decoration: none; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .n { color: var(--mute); font-size: 12px; } .chip.on .n { color: #dbeafe; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #eef6fc; color: var(--blue-d); }

/* ---------- การ์ดสินค้า ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 1150px) { .grid.g5 { grid-template-columns: repeat(5, 1fr); } }
.pcard { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; position: relative; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: 0 8px 28px rgba(15,23,42,.12); transform: translateY(-2px); }
.pcard .img { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 10px; border-bottom: 1px solid #f1f5f9; }
.pcard .img img { width: 100%; height: 100%; object-fit: contain; }
.pcard .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .brand { font-size: 12px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.pcard .name { color: var(--ink); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.pcard a.name:hover { color: var(--blue-d); text-decoration: none; }
.pcard .price { color: var(--price); font-weight: 800; font-size: 1.1rem; margin-top: auto; }
.pcard .price.ask { color: var(--blue-d); font-size: .95rem; }
.pcard .acts { display: flex; gap: 6px; margin-top: 6px; }
.pcard .acts .btn { padding: 8px 10px; font-size: 13px; flex: 1; }
.pcard .acts .q { flex: none; width: 38px; padding: 8px 0; }
.pcard .acts .q.added { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- หน้าแรก ---------- */
.hero { background: linear-gradient(135deg, var(--navy) 0%, #0b4f86 55%, var(--blue) 100%); color: #fff; }
.hero .wrap { padding-top: 36px; padding-bottom: 36px; display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.4fr 1fr; padding-top: 48px; padding-bottom: 48px; } }
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero h1 em { font-style: normal; color: #7dd3fc; }
.hero p { color: #dbeafe; margin: 0 0 18px; font-size: 1.05rem; }
.hero .search form { border-color: #fff; }
.hero .search input { padding: 14px 16px; font-size: 1.05rem; }
.hero .hot { margin-top: 12px; font-size: 14px; color: #bfdbfe; }
.hero .hot a { color: #fff; margin-right: 10px; border-bottom: 1px dashed rgba(255,255,255,.5); }
.hero .hot a:hover { text-decoration: none; border-bottom-style: solid; }
.hero-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 16px; padding: 20px; }
.hero-card h2 { font-size: 1.1rem; }
.hero-card ol { margin: 0 0 16px; padding-left: 20px; color: #e0f2fe; }
.hero-card li { margin: 4px 0; }
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .cats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .cats { grid-template-columns: repeat(5, 1fr); gap: 14px; } }
.cat { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; text-align: center; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cat:hover { text-decoration: none; box-shadow: 0 8px 24px rgba(15,23,42,.12); color: var(--blue-d); }
.cat img { width: 72px; height: 72px; object-fit: contain; }
.cat b { font-size: 14px; line-height: 1.35; }
.cat small { color: var(--mute); font-size: 12px; }
.usp { display: grid; gap: 12px; }
@media (min-width: 760px) { .usp { grid-template-columns: repeat(3, 1fr); } }
.usp .card { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.usp .ic { width: 44px; height: 44px; border-radius: 12px; background: #eef6fc; color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.usp h3 { margin: 0 0 4px; }
.usp p { margin: 0; color: var(--mute); font-size: 14px; }
.brands { display: flex; flex-wrap: wrap; gap: 8px; }
.brands a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 700; color: var(--ink2); font-size: 14px; }
.brands a:hover { border-color: var(--blue); color: var(--blue-d); text-decoration: none; }
.brands a small { color: var(--mute); font-weight: 400; }

/* ---------- หน้าหมวด / ค้นหา ---------- */
.list-layout { display: grid; gap: 20px; padding-bottom: 32px; }
@media (min-width: 960px) { .list-layout { grid-template-columns: 250px 1fr; } }
.side .card { padding: 16px; margin-bottom: 16px; }
.side h3 { font-size: 15px; margin-bottom: 8px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink2); font-size: 14px; }
.side li a:hover, .side li a.on { background: #eef6fc; color: var(--blue-d); text-decoration: none; }
.side li a .n { color: var(--mute); font-size: 12px; }
.page-head { padding: 4px 0 14px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .intro { color: var(--ink2); max-width: 820px; margin: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 24px 0 8px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; padding: 7px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-align: center; color: var(--ink2); }
.pager .on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.ptable th, .ptable td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ptable th { background: #f8fafc; font-weight: 700; color: var(--ink2); }
.ptable td.r, .ptable th.r { text-align: right; white-space: nowrap; }
.ptable tr:hover td { background: #fafcff; }
.tablewrap { overflow-x: auto; border-radius: var(--r); box-shadow: var(--shadow); }
.faq details { background: #fff; border-radius: 10px; box-shadow: var(--shadow); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; position: relative; padding-right: 40px; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 10px; font-size: 22px; color: var(--blue); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 16px 14px; color: var(--ink2); }
.seo-text { color: var(--ink2); font-size: 14px; }
.seo-text h2 { font-size: 1.1rem; color: var(--ink); }
.empty { text-align: center; padding: 48px 16px; }

/* ---------- หน้าสินค้า ---------- */
.pd { display: grid; gap: 20px; }
@media (min-width: 900px) { .pd { grid-template-columns: 1fr 1fr; gap: 28px; } }
.gallery .main { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gallery .main img { max-height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery .thumbs button { border: 2px solid transparent; background: #fff; border-radius: 8px; padding: 3px; width: 64px; height: 64px; flex: none; cursor: pointer; }
.gallery .thumbs button.on { border-color: var(--blue); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pinfo h1 { font-size: 1.45rem; }
.pmeta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--mute); margin-bottom: 14px; }
.pricebox { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.pricebox .lbl { font-size: 13px; color: var(--mute); }
.pricebox .big { font-size: 2rem; font-weight: 800; color: var(--price); line-height: 1.2; }
.pricebox .big.ask { font-size: 1.4rem; color: var(--blue-d); }
.pricebox .note { font-size: 13px; color: var(--mute); margin-top: 6px; }
.cta { display: grid; gap: 10px; margin-bottom: 14px; }
.trust { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 14px; color: var(--ink2); }
.trust li { display: flex; gap: 8px; align-items: center; }
.trust .ico { color: var(--green-d); width: 18px; height: 18px; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.specs th { width: 34%; color: var(--mute); font-weight: 600; }
.detail { overflow-wrap: anywhere; }
.detail img { display: block; margin: 10px auto; border-radius: 8px; }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; box-shadow: 0 -4px 16px rgba(15,23,42,.08); }
.sticky-cta .p { flex: 1; min-width: 0; }
.sticky-cta .p b { color: var(--price); display: block; font-size: 1.1rem; }
.sticky-cta .p small { color: var(--mute); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 900px) { .sticky-cta { display: none; } }
body.has-sticky { padding-bottom: 76px; }
@media (min-width: 900px) { body.has-sticky { padding-bottom: 0; } }

/* ---------- ปุ่ม LINE ลอย ---------- */
.fab-line { position: fixed; right: 16px; bottom: 16px; z-index: 44; width: 56px; height: 56px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(6,199,85,.45); }
.fab-line:hover { background: var(--green-d); text-decoration: none; }
.fab-line svg { width: 30px; height: 30px; fill: #fff; }
body.has-sticky .fab-line { bottom: 88px; }
@media (min-width: 900px) { body.has-sticky .fab-line { bottom: 16px; } }

/* ---------- กล่อง LINE (คอมพิวเตอร์) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.on { display: flex; }
.modal .bd { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.modal .box { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 440px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal .hd { background: var(--green); color: #fff; padding: 12px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.modal .hd button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.modal .bdy { padding: 18px; }
.modal .row { display: flex; gap: 16px; align-items: center; }
.modal .row img { width: 140px; height: 140px; border: 1px solid var(--line); border-radius: 10px; flex: none; }
.modal ol { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink2); }
.modal ol li { margin-bottom: 6px; }
.modal textarea { width: 100%; margin-top: 12px; font: inherit; font-size: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; resize: none; background: #f8fafc; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 70; display: none; }
.toast.on { display: block; }

/* ---------- ใบขอราคา ---------- */
.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.qlist img { width: 64px; height: 64px; object-fit: contain; flex: none; background: #fff; border-radius: 8px; }
.qlist .t { flex: 1; min-width: 0; }
.qlist .t a { color: var(--ink); font-weight: 600; }
.qlist input { width: 70px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; text-align: center; }
.qlist .rm { background: none; border: 0; color: var(--mute); cursor: pointer; font-size: 20px; }

/* ---------- ท้ายเว็บ ---------- */
.footer { background: var(--navy); color: #cbd5e1; margin-top: 40px; font-size: 14px; }
.footer .wrap { padding-top: 32px; padding-bottom: 20px; }
.footer .cols { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .footer .cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer h3 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 5px 0; }
.footer a { color: #cbd5e1; } .footer a:hover { color: #fff; }
.footer .line-box { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.footer .line-box img { width: 92px; height: 92px; background: #fff; border-radius: 8px; padding: 4px; }
.footer .copy { border-top: 1px solid rgba(255,255,255,.12); margin-top: 24px; padding-top: 14px; font-size: 12px; color: #94a3b8; text-align: center; }

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .hero h1 { font-size: 1.5rem; }
  .header .wrap { flex-wrap: wrap; gap: 10px; }
  .header .search { order: 3; flex-basis: 100%; max-width: none; }
  .home .header .search { display: none; }
  .logo svg { height: 28px; }
  .hdr-actions { margin-left: auto; }
  .hdr-actions .btn-line span { display: none; }
  .hdr-actions .btn-line { padding: 9px 11px; }
  .hide-m { display: none; }
  .pricebox .big { font-size: 1.7rem; }
  .modal .row { flex-direction: column; text-align: center; }
}
