/* =========================================================
   Partdo TH — Design System
   ========================================================= */
/* Inter สำหรับอังกฤษ/ตัวเลข + Noto Sans Thai สำหรับภาษาไทย (Inter ไม่มีอักขระไทย) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #EF233C;
  --primary-dark: #D01B32;
  --primary-soft: #FFF5F5;
  --primary-rgb: 239, 35, 60;
  --dark-rgb: 33, 37, 41;
  --i3d-hi: #FF6E80;
  --i3d-mid: #EF233C;
  --i3d-lo: #C4162C;
  --i3d-edge: #98101F;
  --i3d-glyph-shadow: #8E0F1E;
  --deep-1: #454B52;
  --deep-2: #2A3037;
  --deep-3: #1E2328;
  --dark: #212529;
  --body: #212529;
  --muted: #868E96;
  --muted-2: #ADB5BD;
  --border: #DEE2E6;
  --border-soft: #E9ECEF;
  --light: #F1F3F5;
  --page: #F6F7F9;
  --white: #FFFFFF;
  --sale: #F03E3E;
  --success: #099268;
  --success-soft: #EBFBEE;
  --warning: #F59F00;
  --warning-soft: #FFF9DB;
  --info: #1C7ED6;
  --info-soft: #E7F5FF;
  --star: #FFD43B;
  --amber: #FCC419;
  --cyan: #3BC9DB;
  --violet: #6741D9;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(33, 37, 41, .06);
  --shadow: 0 4px 16px rgba(33, 37, 41, .08);
  --shadow-lg: 0 14px 40px rgba(33, 37, 41, .12);
  --container: 1400px;
  --dept-w: 268px;
  --head-gap: 26px;      /* ระยะห่างในแถบหัวเว็บ ใช้คำนวณแนวขอบให้ตรงกัน */
  --topbar-h: 36px;
  --headmain-h: 76px;
  --header-h: 148px;
  --font: 'Inter', 'Noto Sans Thai', 'Leelawadee UI', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --t: .18s ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.65;
  color: var(--body); background: var(--white); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 24px 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary); color: #fff; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 16px; }
.container-narrow { max-width: 980px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acenter { display: flex; align-items: center; gap: 8px; }
.mt-0 { margin-top: 0 } .mb-0 { margin-bottom: 0 }
/* display:inline-block ทับ reset ของ svg ไม่ให้ไอคอนตกบรรทัดเมื่ออยู่ปนกับข้อความ */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -.2em; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 26px; height: 26px; }

/* ---------------- ปุ่ม ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
  background: var(--light); color: var(--dark); transition: all var(--t); white-space: nowrap;
}
.btn:hover { background: var(--border); color: var(--dark); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; box-shadow: 0 6px 18px rgba(var(--primary-rgb), .28); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
/* ปุ่มโปร่ง เส้นขอบสีแบรนด์ — เติมสีทึบเมื่อชี้เมาส์ */
.btn-soft {
  background: transparent; border: 1.5px solid var(--primary); color: var(--primary);
}
.btn-soft:hover { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(var(--primary-rgb), .26); }
.btn-soft:disabled { border-color: var(--border); color: var(--muted); }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--primary); background: var(--primary-soft); }
/* ปุ่มโปร่งบนพื้นสีเข้ม/สีแบรนด์ — ชี้เมาส์แล้วกลับสีเป็นพื้นขาวตัวอักษรสีแบรนด์ ให้อ่านออกทุกสถานะ */
.btn-on-color {
  background: rgba(255, 255, 255, .12); border: 1.5px solid rgba(255, 255, 255, .65); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 0 rgba(0, 0, 0, .16);
}
.btn-on-color:hover {
  background: #fff; border-color: #fff; color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 0 rgba(0, 0, 0, .2), 0 10px 20px rgba(0, 0, 0, .22);
}
.btn-on-color:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 rgba(0, 0, 0, .18); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #0b7a58; color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---------------- ฟอร์ม ---------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; transition: border-color var(--t), box-shadow var(--t); font-size: 14px;
}
.textarea { height: auto; padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23868E96' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 14px; padding: 4px 0; }
.check input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }

/* ---------------- แถบสถานะ / ป้าย ---------------- */
/* ป้ายสถานะ: ไม่ตัดคำ และสูงตามเนื้อหา ข้อความยาวจึงไม่ล้นออกนอกกรอบ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.35;
  background: var(--light); color: var(--dark); white-space: nowrap;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-sale { background: var(--sale); color: #fff; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: #B54708; }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: var(--light); color: var(--muted); }
.badge-dark { background: var(--dark); color: #fff; }
.badge-amber { background: var(--amber); color: var(--dark); }

/* =========================================================
   HEADER
   ========================================================= */
/* เลื่อนหน้าลงแล้วแถบบน+แถบแดงเลื่อนพ้นไป เหลือเฉพาะแถวเมนูค้างไว้
   (ใช้ sticky แทน fixed จึงไม่ลอยทับแถบแดงและไม่ทำให้เนื้อหากระโดด) */
.site-header {
  position: sticky; top: calc(-1 * (var(--topbar-h) + var(--headmain-h)));
  z-index: 90; background: #fff;
}
.site-header.is-stuck { box-shadow: var(--shadow); }

.header-row { border-bottom: 1px solid var(--border-soft); }
.header-inner { display: flex; align-items: center; gap: 20px; }

/* แถบบนสุด (พื้นเข้ม) */
.header-topbar { background: #1B2026; border-bottom: 0; font-size: 12.5px; color: #ADB5BD; }
.header-topbar .header-inner { height: var(--topbar-h); justify-content: space-between; }
.header-topbar a { color: #ADB5BD; }
.header-topbar a:hover { color: #fff; }
.topbar-menu { display: flex; align-items: center; gap: 22px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-notice strong { color: #fff; font-weight: 600; }
.topbar-switch { display: flex; align-items: center; gap: 14px; }
.topbar-switch .sw { display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* แถวหลัก (พื้นแดงเต็มแถบ) */
.header-main { background: var(--primary); border-bottom: 0; }
.header-main .header-inner { height: var(--headmain-h); gap: var(--head-gap); }
/* บล็อกโลโก้กว้างเท่าคอลัมน์หมวดหมู่ — ขอบซ้ายของช่องค้นหาจึงตรงกับขอบขวาของปุ่ม "เลือกซื้อตามหมวดหมู่" พอดี */
.header-main .site-brand { width: calc(var(--dept-w) - var(--head-gap)); }
.site-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--primary); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 1.8; }
.brand-text { line-height: 1.05; }
.brand-name { font-size: 25px; font-weight: 700; letter-spacing: -.02em; color: var(--logo-color, var(--dark)); }
.brand-name span { color: var(--logo-accent, var(--primary)); }
.brand-tag { font-size: 10px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* โลโก้เมื่ออยู่บนพื้นแดง */
.header-main .brand-mark, .header-mobile .brand-mark { background: rgba(255, 255, 255, .18); }
.header-main .brand-name, .header-mobile .brand-name { color: var(--logo-color, #fff); }
.header-main .brand-name span, .header-mobile .brand-name span { color: var(--logo-accent, rgba(255, 255, 255, .8)); }
.header-main .brand-tag, .header-mobile .brand-tag { color: rgba(255, 255, 255, .7); }

/* ช่องค้นหา — ยืดเต็มพื้นที่ว่างระหว่างโลโก้กับปุ่มด้านขวา */
.search-form-wrapper { flex: 1 1 auto; min-width: 220px; position: relative; }
.search-form {
  display: flex; align-items: center; height: 46px; border: 0; border-radius: var(--radius-pill);
  overflow: hidden; background: #fff; padding: 0 6px 0 20px;
}
.search-input { flex: 1; height: 100%; border: 0; padding: 0; font-size: 14px; min-width: 60px; background: transparent; }
.search-input:focus { outline: 0; }
.search-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%; padding: 0; background: var(--primary);
  color: #fff; display: grid; place-items: center; transition: background var(--t);
}
.search-btn:hover { background: var(--primary-dark); }
.search-btn .icon { width: 18px; height: 18px; }

.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; z-index: 70; max-height: 420px; overflow: auto;
}
.suggest-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 6px; }
.suggest-item:hover { background: var(--light); }
.suggest-item img { width: 44px; height: 44px; border-radius: 6px; background: var(--light); flex: none; }
.suggest-item .nm { font-size: 13.5px; font-weight: 500; }
.suggest-item .pr { font-size: 13px; color: var(--primary); font-weight: 700; }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.quick-button {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: var(--radius-pill);
  position: relative; transition: background var(--t); color: #fff;
}
.quick-button:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.qb-icon { position: relative; display: grid; place-items: center; }
.qb-icon .icon { width: 23px; height: 23px; }
.qb-text { line-height: 1.15; }
.qb-label { font-size: 11px; color: rgba(255, 255, 255, .75); display: block; }
.qb-value { font-size: 13.5px; font-weight: 600; }
.qb-account { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.qb-count {
  position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill); background: #fff; color: var(--primary); font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* แถวเมนู */
.header-nav { background: #fff; border-bottom: 1px solid var(--border-soft); }
.header-nav .header-inner { height: 66px; gap: 24px; }

.dept-menu { position: relative; flex: none; }
/* ปุ่มลอยอยู่กลางแถวขาว มีช่องว่างคั่นจากแถบแดงด้านบน จึงใช้สีธีมได้โดยไม่กลืนกัน */
.dept-toggle {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb), .22);
  font-weight: 600; font-size: 14.5px; border-radius: var(--radius); width: var(--dept-w);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(var(--primary-rgb), .10), 0 6px 14px rgba(33, 37, 41, .07);
  transition: background var(--t), box-shadow var(--t), border-color var(--t);
}
.dept-toggle:hover {
  background: #fff; color: var(--primary); border-color: var(--primary);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(var(--primary-rgb), .14), 0 9px 18px rgba(var(--primary-rgb), .16);
}
.dept-toggle .icon { color: var(--primary); }
.dept-toggle .chev { margin-left: auto; transition: transform var(--t); }
.dept-menu.open .dept-toggle .chev { transform: rotate(180deg); }
.dept-list {
  position: absolute; top: calc(100% + 8px); left: 0; width: 300px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 8px 0;
  display: none; z-index: 75;
}
.dept-menu.open .dept-list, .dept-menu.always-open .dept-list { display: block; }

/* ---- เมนูหมวดหมู่ 3 ระดับ (ใช้ร่วมกับ .dept-panel บนหน้าแรก) ---- */
/* แถวไม่เป็นจุดอ้างอิงตำแหน่ง แผงหมวดย่อยจึงยึดกับกรอบเมนูและเริ่มจากด้านบนเสมอ
   (ถ้ายึดกับแถว หมวดล่าง ๆ จะกางห้อยลงไปทับเนื้อหาข้างล่าง) */
.dept-row { position: static; }
.dept-row > a { display: flex; align-items: center; gap: 12px; padding: 9px 18px; font-size: 14px; }
.dept-row > a:hover { background: var(--primary-soft); color: var(--primary); }
/* ชื่อหมวดต้องอยู่บรรทัดเดียวเสมอ ถ้ายาวเกินให้ตัดด้วย … */
.dept-row > a .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-row .icon { width: 19px; height: 19px; color: var(--muted); }
.dept-row > a:hover .icon { color: var(--primary); }
.dept-row .arw, .dept-row .cnt { margin-left: auto; font-size: 12px; color: var(--muted-2); flex: none; }
.dept-list .sep, .dept-panel .sep { height: 1px; background: var(--border-soft); margin: 8px 0; }

.dept-flyout {
  position: absolute; left: 100%; top: 0; margin-left: 6px; width: 660px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 20px 22px; display: none; grid-template-columns: repeat(3, 1fr); gap: 18px 26px;
  min-height: 100%; max-height: 78vh; overflow-y: auto; z-index: 85;
  align-content: start;
}
.dept-row:hover > .dept-flyout { display: grid; }
.dept-col-head { display: block; font-weight: 600; font-size: 13.5px; color: var(--dark); margin-bottom: 7px; padding: 0; }
.dept-col-head:hover { color: var(--primary); }
.dept-col-item { display: block; font-size: 13px; color: var(--muted); padding: 3px 0; }
.dept-col-item:hover { color: var(--primary); }

/* จอไม่กว้างพอให้แผงกางออกด้านข้าง — ย่อขนาดลง */
@media (max-width: 1400px) { .dept-flyout { width: 560px; grid-template-columns: repeat(2, 1fr); } }

/* หน้าแรก: ปุ่มหมวดหมู่ไม่ใช่ดรอปดาวน์ เพราะกางรายการค้างไว้ด้านล่างแล้ว */
.dept-menu.pinned .dept-toggle { cursor: default; }
.dept-menu.pinned .dept-toggle .chev { display: none; }
.dept-menu.pinned .dept-list { display: none !important; }

/* รายการหมวดหมู่แบบกางค้าง (การ์ดของตัวเอง แยกจากปุ่มด้านบน) */
.dept-panel {
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 8px 0;
  align-self: start; box-shadow: var(--shadow-sm);
  overflow: visible;          /* ต้องมองเห็นแผงกลุ่มย่อยที่กางออกด้านข้าง */
  position: relative;         /* เป็นจุดอ้างอิงให้แผงหมวดย่อยเริ่มจากขอบบน */
}







.main-menu { display: flex; align-items: center; gap: 2px; }
.main-menu > li > a { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: 66px; font-size: 14.5px; font-weight: 500; }
.main-menu > li > a:hover, .main-menu > li.active > a { color: var(--primary); }
.main-menu .tag {
  font-size: 9.5px; font-weight: 700; background: var(--cyan); color: #fff; padding: 1px 6px;
  border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: .04em;
}
.main-menu .tag.hot { background: var(--primary); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13.5px; }
.nav-right .hot-link { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--primary); }

/* หัวเว็บบนมือถือ (พื้นแดงเช่นกัน) */
.header-mobile { display: none; background: var(--primary); border-bottom: 0; }
.header-mobile .header-inner { height: 60px; justify-content: space-between; }
.header-mobile .icon-btn { color: #fff; }
.header-mobile .icon-btn:hover { background: rgba(255, 255, 255, .16); }
.header-mobile .brand-name { font-size: 21px; }
.header-mobile .brand-tag { display: none; }
.icon-btn { width: 42px; height: 42px; border-radius: var(--radius); display: grid; place-items: center; position: relative; transition: background var(--t); }
.icon-btn:hover { background: var(--light); }
.mobile-search { padding: 0 0 12px; }
.mobile-search .search-form { height: 42px; }

/* ออฟแคนวาส */
.offcanvas { position: fixed; inset: 0 auto 0 0; width: 320px; max-width: 88vw; background: #fff; z-index: 120;
  transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.offcanvas.open { transform: none; }
.offcanvas-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border-soft); }
.offcanvas-body { overflow-y: auto; padding: 8px 0 40px; flex: 1; }
.offcanvas-body a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; font-size: 14.5px; border-bottom: 1px solid var(--border-soft); }
.offcanvas-body .grp { padding: 16px 18px 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.backdrop { position: fixed; inset: 0; background: rgba(33, 37, 41, .5); z-index: 110; opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.show { opacity: 1; pointer-events: auto; }

/* แถบล่างมือถือ */
.mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: #fff; border-top: 1px solid var(--border);
  display: none; z-index: 90; padding-bottom: env(safe-area-inset-bottom);
}
.mobile-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted); position: relative; }
.mobile-bar a.active, .mobile-bar a:hover { color: var(--primary); }
.mobile-bar .qb-count { top: 2px; right: 50%; margin-right: -22px; }

/* =========================================================
   ส่วนประกอบทั่วไป
   ========================================================= */
.section { padding: 46px 0; }
.section-tight { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.section-title { font-size: 24px; margin: 0; }
.section-sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.section-link { font-size: 13.5px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 6px; }
.section-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.section-tabs button { padding: 7px 15px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 500; color: var(--muted); transition: all var(--t); }
.section-tabs button:hover { color: var(--dark); background: var(--light); }
.section-tabs button.active { background: var(--dark); color: #fff; }

.title-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.title-bar h2 { font-size: 21px; margin: 0; }
.title-bar::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }

.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); padding: 14px 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--muted-2); }
.page-head { background: var(--page); border-bottom: 1px solid var(--border-soft); padding: 26px 0; margin-bottom: 34px; }
.page-head h1 { font-size: 28px; margin: 0 0 4px; }

/* ---------------- การ์ดสินค้า ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.product-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.product-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.pcard {
  position: relative; background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px; transition: box-shadow var(--t), border-color var(--t), transform var(--t); display: flex; flex-direction: column;
}
.pcard:hover { border-color: transparent; box-shadow: var(--shadow-lg); z-index: 5; }
.pcard-media { position: relative; border-radius: 6px; overflow: hidden; background: var(--white); }
.pcard-media img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; transition: transform .4s ease; }
.pcard:hover .pcard-media img { transform: scale(1.05); }
.pcard-labels { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 5px; z-index: 2; }
.plabel { min-height: 22px; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; }
.plabel.off { background: var(--sale); color: #fff; }
.plabel.txt { background: var(--dark); color: #fff; }
.plabel.flash { background: linear-gradient(135deg, #FF922B, #F03E3E); color: #fff; }
.plabel.boost { background: var(--violet); color: #fff; }

.pcard-tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 3;
  opacity: 0; transform: translateX(8px); transition: all var(--t); }
.pcard:hover .pcard-tools { opacity: 1; transform: none; }
.ptool { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--dark); }
.ptool:hover { background: var(--primary); color: #fff; }
.ptool.on { background: var(--primary); color: #fff; }
.ptool .icon { width: 17px; height: 17px; }

.pcard-body { padding-top: 12px; display: flex; flex-direction: column; flex: 1; }
.pcard-cat { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.pcard-title { font-size: 14px; font-weight: 500; line-height: 1.45; margin: 0 0 7px; min-height: 40px; }
.pcard-title a:hover { color: var(--primary); }
.stars { display: inline-flex; align-items: center; gap: 1px; }
.stars svg { width: 13px; height: 13px; fill: var(--star); }
.stars svg.off { fill: var(--border); }
.pcard-rating { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.price-now { font-size: 17px; font-weight: 700; color: var(--dark); }
.price-old { font-size: 13.5px; color: var(--muted-2); text-decoration: line-through; }
.pcard-stock { font-size: 12px; display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.pcard-stock.in { color: var(--success); }
.pcard-stock.low { color: var(--warning); }
.pcard-stock.out { color: var(--muted); }
.pcard-store { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 5px; }
.pcard-store a:hover { color: var(--primary); }
.pcard-foot { margin-top: auto; }
.pcard-features { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.pcard-features li { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 3px; }
.pcard-features li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--muted-2); margin-top: 7px; flex: none; }

.stock-bar { height: 5px; border-radius: 3px; background: var(--border-soft); overflow: hidden; margin: 8px 0 6px; }
.stock-bar span { display: block; height: 100%; background: linear-gradient(90deg, #FF922B, var(--primary)); }
.stock-info { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }

/* การ์ดแนวนอน */
.pcard-h { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: #fff; transition: box-shadow var(--t); }
.pcard-h:hover { box-shadow: var(--shadow); }
.pcard-h img { width: 82px; height: 82px; border-radius: 6px; flex: none; }
.pcard-h .nm { font-size: 13.5px; font-weight: 500; margin-bottom: 5px; }

/* =========================================================
   ฮีโร่ / สไลด์
   ========================================================= */
.hero-wrap { padding-top: 20px; }
.hero-layout { display: grid; grid-template-columns: var(--dept-w) 1fr 300px; gap: 20px; align-items: stretch; }

.hero-slider { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--light); min-height: 440px; }
.hero-slide { position: absolute; inset: 0; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 10px;
  padding: 40px 44px; opacity: 0; visibility: hidden; transition: opacity .5s ease; }
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--primary);
  background: #fff; padding: 5px 13px; border-radius: var(--radius-pill); margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.hero-slide h2 { font-size: 40px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.025em; }
.hero-slide p { color: #55595E; font-size: 14.5px; max-width: 420px; margin-bottom: 18px; }
.hero-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.hero-price .old { font-size: 17px; color: var(--muted); text-decoration: line-through; }
.hero-price .new { font-size: 32px; font-weight: 700; color: var(--primary); }
.hero-art { display: grid; place-items: center; height: 100%; }
.hero-art img { max-height: 380px; width: auto; }
.hero-dots { position: absolute; bottom: 20px; left: 44px; display: flex; gap: 8px; z-index: 4; }
.hero-dots button { width: 9px; height: 9px; border-radius: 50%; background: rgba(33, 37, 41, .22); transition: all var(--t); }
.hero-dots button.active { width: 26px; border-radius: var(--radius-pill); background: var(--primary); }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; z-index: 4; opacity: 0; transition: opacity var(--t); }
.hero-slider:hover .hero-arrow { opacity: 1; }
.hero-arrow.prev { left: 16px; } .hero-arrow.next { right: 16px; }
.hero-arrow:hover { background: var(--primary); color: #fff; }

/* คอลัมน์การ์ดข้างสไลด์ — จอใหญ่เรียงลงมา 3 ใบ สไลด์จะยืดสูงตามให้เท่ากันเอง */
.hero-side-right { display: grid; gap: 16px; min-width: 0; }
.hero-side-right .side-banner { min-height: 148px; }

/* แบนเนอร์ข้าง — นูน 3D เช่นกัน (ชั้นบางกว่าเพราะการ์ดเล็ก) */
.side-banner {
  border-radius: var(--radius-lg); overflow: hidden; position: relative; background: var(--light);
  padding: 22px; min-height: 168px;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(96px, 44%, 190px);
  align-items: center; gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 3px 0 rgba(33, 37, 41, .09), 0 8px 18px rgba(33, 37, 41, .12);
  transition: transform var(--t), box-shadow var(--t);
}
.side-banner .sb-body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.side-banner:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 5px 0 rgba(33, 37, 41, .09), 0 13px 26px rgba(33, 37, 41, .16);
}
.side-banner .eyebrow {
  font-size: 11px; font-weight: 700; color: var(--primary); margin-bottom: 7px;
  letter-spacing: .4px; text-transform: uppercase;
}
.side-banner h4 { font-size: 16px; margin: 0 0 14px; line-height: 1.35; }
/* ปุ่มบนแบนเนอร์ — พื้นโปร่ง เส้นขอบและตัวอักษรใช้สีเน้นที่ตั้งจากระบบแอดมิน
   ชี้เมาส์แล้วจึงเติมสีทึบ ว่างไว้ก็ใช้สีแบรนด์ */
.side-banner .sb-btn {
  --sb-btn-bg: var(--primary);   /* สีเน้น: เส้นขอบ + ตัวอักษร */
  --sb-btn-fg: #fff;             /* สีตัวอักษรตอนพื้นทึบ */
  font-size: 12.5px; font-weight: 600; margin-top: auto; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 15px;
  border-radius: var(--radius-pill); border: 1.5px solid var(--sb-btn-bg);
  background: transparent; color: var(--sb-btn-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 rgba(33, 37, 41, .10);
  transition: background var(--t), color var(--t), transform var(--t), box-shadow var(--t);
}
.side-banner:hover .sb-btn {
  background: var(--sb-btn-bg); color: var(--sb-btn-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 0 rgba(0, 0, 0, .16), 0 7px 15px rgba(33, 37, 41, .2);
}
.side-banner:active .sb-btn { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 rgba(0, 0, 0, .16); }
/* พื้นการ์ดเข้ม: สีเน้นอัตโนมัติเป็นขาว จะได้ยังอ่านออก (แอดมินตั้งสีเองก็ทับค่านี้ได้) */
.side-banner.on-dark .sb-btn { --sb-btn-bg: #fff; --sb-btn-fg: var(--dark); }
/* ภาพสินค้าเต็มสีอยู่คอลัมน์ขวา ไม่จางและไม่ทับตัวหนังสือ */
.side-banner .sb-art {
  width: 100%; max-height: 142px; object-fit: contain; object-position: center right;
  opacity: 1; justify-self: end;
}

/* จอแคบ: ย่อภาพลงแต่ยังอยู่ข้างข้อความ ไม่ตัดทิ้ง */
@media (max-width: 480px) {
  .side-banner { grid-template-columns: minmax(0, 1fr) 38%; padding: 18px; min-height: 148px; }
  .side-banner .sb-art { max-height: 112px; }
  .side-banner h4 { font-size: 15px; }
}

/* ฟีเจอร์บริการ */
/* แถบบริการ — พื้นทึบไล่ 2 สี + กรอบนูนแบบ 3D
   ใช้โทนเข้มเพื่อให้ไอคอน 3D สีแบรนด์เด่นขึ้นมาบนพื้น */
/* พื้นธรรมดา + กรอบนูน 3D สีจาง */
.feature-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background-image: linear-gradient(180deg, #fff 0%, #FCFDFD 100%);
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  margin-bottom: 6px;
  box-shadow:
    inset 0 1px 0 #fff,                        /* ไฮไลต์ขอบบน */
    0 4px 0 rgba(33, 37, 41, .05),             /* ความหนาแบบจาง */
    0 10px 20px rgba(33, 37, 41, .07);         /* เงาตกกระทบอ่อน ๆ */
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.feature-strip:hover {
  transform: translateY(-2px); border-color: var(--border);
  box-shadow: inset 0 1px 0 #fff, 0 6px 0 rgba(33, 37, 41, .06), 0 15px 28px rgba(33, 37, 41, .10);
}
.feature-item { background: transparent; padding: 20px 18px; display: flex; align-items: center; gap: 16px; position: relative; color: var(--body); }
/* เส้นแบ่งช่องบาง ๆ */
.feature-item + .feature-item::before {
  content: ''; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px;
  background: var(--border-soft);
}
/* ไอคอนเส้นขนาดใหญ่ ไม่มีพื้นหลัง */
.fs-ic { flex: none; display: grid; place-items: center; color: var(--primary); }
.fs-ic .icon { width: 40px; height: 40px; stroke-width: 1.5; }
/* วงกลมไอคอนนูนขึ้นมาอีกชั้น */
.feature-item .ic {
  width: 46px; height: 46px; border-radius: 50%; background: var(--primary-soft);
  display: grid; place-items: center; color: var(--primary); flex: none;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 5px rgba(var(--primary-rgb), .12), 0 2px 5px rgba(33, 37, 41, .09);
}
/* ไอคอน 3D วาดเป็น SVG เต็มใบ จึงไม่ต้องมีวงกลมพื้นหลังซ้อน */
.feature-item .ic-3d { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; }
.ic3d { display: block; transition: transform var(--t); }
.feature-strip:hover .ic3d { transform: translateY(-1px) scale(1.03); }
.feature-item h4 { font-size: 15px; margin: 0 0 3px; color: var(--primary); font-weight: 700; }
.feature-item p { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ตัวย่อยพื้นอ่อน — ใช้ในกล่องเล็กบนหน้าสินค้าที่อยู่ติดกับราคา */
.feature-strip.light { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.feature-strip.light:hover { transform: none; box-shadow: var(--shadow-sm); }
.feature-strip.light .feature-item { color: var(--body); }
.feature-strip.light .feature-item h4 { color: var(--body); }
.feature-strip.light .feature-item p { color: var(--muted); }
.feature-strip.light .feature-item + .feature-item::before {
  background: linear-gradient(90deg, var(--border-soft) 0 1px, #fff 1px 2px);
}

/* หมวดหมู่ */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat-card { background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 14px; text-align: center; transition: all var(--t); }
.cat-card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.cat-card img { width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 50%; }
.cat-card h4 { font-size: 13.5px; margin: 0 0 3px; }
.cat-card span { font-size: 12px; color: var(--muted); }

/* แบนเนอร์โปรโมชัน */
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* สไลด์/แบนเนอร์ที่ตั้งพื้นหลังเข้ม — สลับสีตัวอักษรเป็นขาว */
.hero-slide.on-dark h2, .promo-card.on-dark h3, .side-banner.on-dark h4 { color: #fff; }
.hero-slide.on-dark p, .promo-card.on-dark p { color: rgba(255, 255, 255, .78); }
.hero-slide.on-dark .eyebrow { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.side-banner.on-dark .eyebrow { color: var(--amber); }
.hero-slide.on-dark .hero-price .old { color: rgba(255, 255, 255, .6); }
.hero-slide.on-dark .hero-price .new { color: #fff; }
.promo-card.on-dark .btn-dark { background: #fff; color: var(--dark); }

/* แบนเนอร์โปรโมชัน — กรอบนูน 3D แบบเดียวกับแถบบริการ */
.promo-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 30px; min-height: 190px;
  display: flex; flex-direction: column; justify-content: center; background: var(--light);
  margin-bottom: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .38),   /* ไฮไลต์ขอบบน (เห็นชัดบนแบนเนอร์พื้นเข้ม) */
    0 4px 0 rgba(33, 37, 41, .11),            /* ชั้นหนาของการ์ด */
    0 10px 22px rgba(33, 37, 41, .13);        /* เงาตกกระทบ */
  transition: transform var(--t), box-shadow var(--t);
}
.promo-card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 7px 0 rgba(33, 37, 41, .11), 0 16px 30px rgba(33, 37, 41, .17);
}
/* ภาพกินพื้นที่ถึงขอบการ์ด แล้วไล่จางขอบซ้ายให้กลืนกับพื้นการ์ด
   ใช้ mask แทนการทาบสีทับ พื้นการ์ดจึงเป็นสีอะไรก็ได้ตามที่แอดมินตั้ง */
/* ภาพวางชิดขวา สูงเต็มการ์ด และใช้ contain เพื่อให้เห็น "เต็มภาพ" เสมอ
   ไม่ว่าจะอัปโหลดมาเป็นสี่เหลี่ยมจัตุรัสหรือแนวนอน ก็ไม่มีส่วนไหนถูกตัดทิ้ง
   width:auto ทำให้กล่องภาพกว้างตามสัดส่วนจริง แล้วค่อยจำกัดด้วย max-width */
/* ภาพลอยอยู่ในการ์ด เว้นระยะจากขอบขวาและขอบบน-ล่าง ไม่ชนขอบ
   ใช้ contain + width:auto ให้เห็นเต็มภาพเสมอ ไม่ว่าจะอัปโหลดสัดส่วนไหนก็ไม่ถูกตัด */
.promo-card .pc-art {
  position: absolute; right: 34px; bottom: auto; left: auto; z-index: 0;
  top: 50%; transform: translateY(-50%);
  /* กำหนดความสูงชัดเจน แล้วปล่อยความกว้างไหลตามสัดส่วนภาพ
     (ถ้าใช้คู่ top+bottom กับ height:auto เบราว์เซอร์จะไม่ยืดให้ ภาพจะทะลุการ์ด) */
  height: calc(100% - 60px); width: auto; max-width: 32%;
  object-fit: contain; object-position: center;
}
.promo-card .pc-body { position: relative; z-index: 2; max-width: 60%; }

/* ข้อความนำเป็นป้ายเม็ดยา อ่านออกทั้งบนพื้นอ่อนและพื้นเข้ม */
.promo-card .eyebrow {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; white-space: nowrap;
  padding: 4px 11px; border-radius: var(--radius-pill); margin-bottom: 11px;
  background: var(--primary); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 0 rgba(0, 0, 0, .16);
}
.promo-card h3 { font-size: 24px; line-height: 1.28; margin: 0 0 8px; letter-spacing: -.015em; }
.promo-card p { margin: 0 0 16px; }
.promo-card .btn { align-self: flex-start; }

/* แถบโปรโมชันมี 2 ใบ กว้างกว่าการ์ดทั่วไป จึงลงมาเรียงทีละใบเร็วกว่า .promo-grid ปกติ */
#strip-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 992px) { #strip-grid { grid-template-columns: 1fr; } }

/* การ์ดแคบลง ภาพต้องเล็กลงเพื่อเหลือที่ให้ตัวหนังสือ ไม่ใช่ใหญ่ขึ้น */
@media (max-width: 560px) {
  .promo-card { padding: 22px; min-height: 172px; }
  .promo-card .pc-body { max-width: 72%; }
  .promo-card .pc-art { width: 44%; }
  .promo-card h3 { font-size: 19px; }
}

/* ดีลพิเศษ + นับถอยหลัง */
.deal-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
/* กล่องนับถอยหลังแบบ 3D */
.countdown { display: flex; align-items: flex-start; gap: 7px; }
.cd-box {
  width: 56px; padding: 8px 4px 7px; border-radius: 10px; text-align: center; color: #fff;
  background: linear-gradient(180deg, var(--deep-1) 0%, var(--deep-2) 55%, var(--deep-3) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),      /* ไฮไลต์ขอบบน */
    inset 0 -3px 6px rgba(0, 0, 0, .4),          /* เงาโค้งด้านใน */
    0 3px 0 #14181C,                             /* ความหนาของกล่อง */
    0 6px 13px rgba(0, 0, 0, .38);               /* เงาตกกระทบ */
}
.cd-box b {
  display: block; font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;   /* เลขกว้างเท่ากัน ไม่กระตุกทุกวินาที */
  color: var(--primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.cd-box span { display: block; font-size: 10px; line-height: 1.5; color: rgba(255, 255, 255, .58); }
.cd-sep { font-weight: 700; font-size: 15px; color: rgba(255, 255, 255, .3); line-height: 1; padding-top: 14px; }

/* แถบดีลเด็ด — สีทึบตามเทมเพลต */
.flash-band {
  background: var(--dark); color: #fff; border-radius: var(--radius-lg); padding: 22px 26px;
  margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.flash-band h2 { margin: 0; font-size: 23px; display: flex; align-items: center; gap: 10px; color: #fff; }
.flash-band .muted { color: rgba(255, 255, 255, .72); }
.flash-band .countdown-label { align-self: center; }

/* คูปอง */
.coupon-band { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.coupon-card { display: flex; align-items: center; gap: 18px; border: 1.5px dashed var(--primary); border-radius: var(--radius-lg); padding: 20px 24px; background: var(--primary-soft); }
.coupon-off { font-size: 34px; font-weight: 700; color: var(--primary); line-height: 1; flex: none; }
.coupon-card h4 { font-size: 15.5px; margin: 0 0 3px; }
.coupon-card p { font-size: 12.5px; color: var(--muted); margin: 0; }
.coupon-code { margin-left: auto; background: #fff; border: 1px dashed var(--primary); border-radius: 6px; padding: 9px 15px; font-weight: 700; font-size: 14px; color: var(--primary); cursor: pointer; flex: none; }
.coupon-code:hover { background: var(--primary); color: #fff; }

/* ร้านค้า */
.store-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; grid-auto-rows: 1fr; }
/* กริดที่บังคับให้ทุกใบสูงเท่ากันทุกแถว */
.grid-even { grid-auto-rows: 1fr; }

/* การ์ดร้านค้า — กรอบนูน 3D ความสูงเท่ากันทุกใบ */
.store-card {
  --sc-tone: var(--primary);
  position: relative; overflow: hidden;
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 19px 16px 13px; margin-bottom: 7px;
  background: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
  display: flex; flex-direction: column;
  box-shadow:
    inset 0 1px 0 #fff,                       /* ไฮไลต์ขอบบน */
    0 5px 0 rgba(33, 37, 41, .10),            /* ความหนาของการ์ด */
    0 12px 24px rgba(33, 37, 41, .13);        /* เงาตกกระทบ */
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
/* แถบสีประจำร้านด้านบน — ทำให้แต่ละกรอบเด่นและแยกจากกันชัดเจน */
.store-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background-color: var(--sc-tone);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .5) 100%);
}
.store-card:hover {
  transform: translateY(-4px); border-color: transparent;
  box-shadow: inset 0 1px 0 #fff, 0 9px 0 rgba(33, 37, 41, .11), 0 20px 34px rgba(33, 37, 41, .18);
}
.sc-link { display: block; color: inherit; }
.sc-link:hover { color: inherit; }
.store-logo { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; font-weight: 700; color: #fff; flex: none; }

.sc-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 13px; }
.sc-title { flex: 1; min-width: 0; }
.sc-title h4 {
  font-size: 15px; margin: 0 0 3px; display: flex; align-items: center; gap: 5px;
  line-height: 1.35; min-width: 0;
}
.sc-title h4 .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sc-title .meta {
  display: block; font-size: 12.5px; color: var(--muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-plan { flex: none; height: 20px; padding: 0 8px; font-size: 10.5px; letter-spacing: .03em; }

/* แถบตัวเลข 3 ช่อง จัดกึ่งกลางเท่า ๆ กัน */
.sc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
}
.sc-stats > div { padding: 9px 4px; text-align: center; border-right: 1px solid var(--border-soft); }
.sc-stats > div:last-child { border-right: 0; }
.sc-stats b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.sc-stats span { font-size: 10.5px; color: var(--muted); }
.sc-stats .rt { color: var(--amber); }

.sc-foot {
  display: flex; align-items: center; gap: 6px; padding-top: 10px; margin-top: auto;
  font-size: 12.5px; color: var(--muted); min-width: 0;
}
.sc-foot .icon { width: 15px; height: 15px; flex: none; }
.sc-foot .pv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-foot .go { margin-left: auto; color: var(--primary); font-weight: 600; flex: none; }

/* ปุ่มติดตาม / แชทกับร้านค้า */
.sc-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.sc-act .btn { width: 100%; height: 34px; padding: 0 6px; font-size: 12.5px; gap: 5px; min-width: 0; }
.sc-btn .icon { width: 15px; height: 15px; flex: none; }
.sc-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-btn.is-following { background: var(--primary); border-color: var(--primary); color: #fff; }
.follow-btn.is-following:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- ส่วนหัวหน้าร้านค้า ---- */
.store-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.store-hero .store-logo { width: 84px; height: 84px; border-radius: 18px; font-size: 33px; }
.sh-main { flex: 1; min-width: 260px; }
.sh-name {
  font-size: 25px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; line-height: 1.3;
}
.sh-name .verified { width: 19px; height: 19px; }
.sh-tagline { color: var(--muted); font-size: 14px; margin: 0 0 12px; }

/* แถบตัวเลข — ตัวเลขบน ป้ายกำกับล่าง จัดชิดกันเป็นระเบียบ */
.sh-stats { display: flex; flex-wrap: wrap; }
.sh-stats > div { padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--border); line-height: 1.3; }
.sh-stats > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.sh-stats b { display: block; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sh-stats span { font-size: 11.5px; color: var(--muted); }
.sh-stats .rt { color: var(--amber); }
.sh-actions { display: flex; align-items: center; gap: 10px; flex: none; }

@media (max-width: 768px) {
  .store-hero { gap: 16px; }
  .store-hero .store-logo { width: 62px; height: 62px; border-radius: 14px; font-size: 25px; }
  .sh-name { font-size: 20px; }
  .sh-stats > div { padding-right: 14px; margin-right: 14px; margin-bottom: 8px; }
  /* ปุ่มติดตาม/แชท เรียง 2 ช่อง ปุ่มโทรกินเต็มแถวล่าง */
  .sh-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .sh-actions > * { width: 100%; }
  .sh-actions > :last-child { grid-column: 1 / -1; }
}

/* การ์ดร้านแบบแถวยาว (ใช้ในหน้าสินค้า) */
/* กล่องร้านค้าในหน้าสินค้า — กรอบนูน 3D แบบเดียวกับการ์ดร้าน */
.store-inline {
  --sc-tone: var(--primary);
  position: relative; overflow: hidden;
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 18px 16px 14px; margin-bottom: 7px;
  background: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 5px 0 rgba(33, 37, 41, .10),
    0 12px 24px rgba(33, 37, 41, .13);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.store-inline::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background-color: var(--sc-tone);
  background-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .5) 100%);
}
.store-inline:hover {
  transform: translateY(-3px); border-color: transparent;
  box-shadow: inset 0 1px 0 #fff, 0 9px 0 rgba(33, 37, 41, .11), 0 20px 34px rgba(33, 37, 41, .18);
}
.si-main { display: flex; gap: 14px; align-items: center; }
.si-link { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 0; color: inherit; }
.si-link:hover { color: inherit; }
.si-info { min-width: 0; }
.si-visit { flex: none; align-self: center; }
.si-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.si-act .btn { width: 100%; min-width: 0; }
.store-inline h4 { font-size: 15px; margin: 0 0 2px; display: flex; align-items: center; gap: 5px; }
.store-inline .meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.verified { width: 16px; height: 16px; color: var(--info); flex: none; }

/* รีวิวลูกค้า */
.testi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.testi-card { background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 22px; }
.testi-card p { font-size: 13.5px; color: #495057; }
.testi-who { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }

/* บทความ */
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.post-card { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: #fff; transition: all var(--t); }
.post-card:hover { box-shadow: var(--shadow-lg); border-color: transparent; }
.post-card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.post-body { padding: 18px; }
.post-body .cat { font-size: 11.5px; font-weight: 600; color: var(--primary); }
.post-body h4 { font-size: 15px; margin: 6px 0 8px; line-height: 1.45; }
.post-meta { font-size: 12px; color: var(--muted); display: flex; gap: 14px; }

/* แบรนด์ */
.brand-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.brand-item { border: 1px solid var(--border-soft); border-radius: var(--radius); height: 78px; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: .01em; transition: all var(--t); background: #fff; }
.brand-item:hover { color: var(--primary); border-color: var(--primary); }

/* ขนส่งที่รองรับ */
.courier-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.courier-item {
  display: grid; place-items: center; padding: 12px 14px; background: #fff;
  border: 1px solid var(--border-soft); border-radius: var(--radius); min-height: 66px;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
/* โลโก้ขนส่งจริง — ย่อให้พอดีกล่องโดยไม่บิดสัดส่วน */
.courier-item img { max-width: 100%; max-height: 38px; width: auto; object-fit: contain; }
.courier-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: transparent; }
.courier-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.courier-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.courier-text b { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.courier-text span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* จดหมายข่าว */
.newsletter { background: var(--dark); border-radius: var(--radius-lg); padding: 38px 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; color: #fff; }
.newsletter h3 { font-size: 24px; color: #fff; margin: 0 0 6px; }
.newsletter p { color: #ADB5BD; font-size: 14px; margin: 0; }
.newsletter form { display: flex; gap: 10px; }
.newsletter .input { height: 50px; border: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--page); border-top: 1px solid var(--border-soft); margin-top: 60px; }
.footer-main { padding: 48px 0 34px; display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr 1.15fr; gap: 34px; }
.footer-col h4 { font-size: 14.5px; margin: 0 0 16px; }
.footer-col li { margin-bottom: 9px; font-size: 13.5px; color: var(--muted); }
.footer-col li a:hover { color: var(--primary); }
.footer-about p { font-size: 13.5px; color: var(--muted); }
.footer-contact { font-size: 13.5px; }
.footer-contact div { display: flex; gap: 10px; margin-bottom: 11px; color: var(--muted); }
.footer-contact .icon { color: var(--primary); }
.footer-phone { font-size: 21px; font-weight: 700; color: var(--primary); }
.social-row { display: flex; gap: 8px; margin-top: 16px; }
.social-row a { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); }
.social-row a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pay-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pay-chip { height: 28px; padding: 0 11px; border-radius: 5px; background: #fff; border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--muted); display: grid; place-items: center; letter-spacing: .02em; }

/* =========================================================
   หน้าสินค้า / รายการ
   ========================================================= */
.shop-layout { display: grid; grid-template-columns: 272px 1fr; gap: 30px; align-items: start; }
.sidebar { position: sticky; top: 20px; }
.filter-box { border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; background: #fff; }
.filter-box h4 { font-size: 14.5px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.filter-list li { margin-bottom: 3px; }
.filter-list a { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 6px; font-size: 13.5px; color: #495057; }
.filter-list a:hover { background: var(--light); color: var(--primary); }
.filter-list a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.filter-list .cnt { margin-left: auto; font-size: 12px; color: var(--muted-2); }
.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs .input { height: 40px; text-align: center; padding: 0 6px; }

.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 22px; background: #fff; flex-wrap: wrap; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.view-toggle button.active { background: var(--dark); color: #fff; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--light); font-size: 12.5px; white-space: nowrap; }
.chip button { color: var(--muted); display: grid; place-items: center; }
.chip button:hover { color: var(--sale); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination button { min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; font-weight: 500; background: #fff; }
.pagination button:hover { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: .45; pointer-events: none; }

/* หน้ารายละเอียดสินค้า */
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.gallery-main { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumbs img { border: 1px solid var(--border-soft); border-radius: 6px; cursor: pointer; transition: border-color var(--t); }
.gallery-thumbs img.active, .gallery-thumbs img:hover { border-color: var(--primary); }
.product-title { font-size: 27px; line-height: 1.3; margin: 6px 0 12px; }
.product-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); margin-bottom: 16px; }
.price-block { display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; }
.price-block .now { font-size: 34px; font-weight: 700; color: var(--primary); }
.price-block .old { font-size: 18px; color: var(--muted-2); text-decoration: line-through; }
.save-note { font-size: 13px; color: var(--success); font-weight: 600; margin-bottom: 18px; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); height: 50px; overflow: hidden; }
.qty-box button { width: 44px; height: 100%; display: grid; place-items: center; color: var(--muted); }
.qty-box button:hover { color: var(--primary); background: var(--light); }
.qty-box input { width: 52px; height: 100%; border: 0; text-align: center; font-weight: 600; }
.qty-box input:focus { outline: 0; }
.buy-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.buy-row .btn-lg { flex: 1; min-width: 180px; }
.meta-list { font-size: 13.5px; }
.meta-list div { display: flex; gap: 10px; padding: 6px 0; }
.meta-list dt { color: var(--muted); min-width: 96px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 24px; overflow-x: auto; }
.tabs button { padding: 13px 20px; font-size: 14.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--primary); border-color: var(--primary); }
.tab-panel { display: none; } .tab-panel.active { display: block; }
.review-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border-soft); }
.sticky-buy { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--border); padding: 10px 0; z-index: 85; transform: translateY(110%); transition: transform .25s; }
.sticky-buy.show { transform: none; }

/* ตะกร้า / เช็คเอาต์ */
.cart-layout { display: grid; grid-template-columns: 1fr 372px; gap: 30px; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 12px 12px; border-bottom: 1px solid var(--border-soft); text-transform: uppercase; letter-spacing: .04em; }
.cart-table td { padding: 16px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.cart-prod { display: flex; gap: 14px; align-items: center; }
.cart-prod img { width: 74px; height: 74px; border-radius: 6px; flex: none; }
.summary-box { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 22px; position: sticky; top: 20px; background: #fff; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.summary-row.total { border-top: 1px solid var(--border-soft); margin-top: 8px; padding-top: 16px; font-size: 19px; font-weight: 700; }
.summary-row.total .v { color: var(--primary); }
.coupon-row { display: flex; gap: 8px; margin: 14px 0; }
.ship-note { background: var(--success-soft); color: var(--success); border-radius: var(--radius); padding: 11px 14px; font-size: 12.5px; margin-bottom: 16px; }
.ship-note.warn { background: var(--warning-soft); color: #B54708; }
.pay-option { display: flex; gap: 12px; align-items: flex-start; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; transition: all var(--t); }
.pay-option:hover { border-color: var(--primary); }
.pay-option.active { border-color: var(--primary); background: var(--primary-soft); }
.pay-option input { margin-top: 3px; accent-color: var(--primary); }
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); }
.step b { width: 27px; height: 27px; border-radius: 50%; background: var(--light); display: grid; place-items: center; font-size: 12.5px; }
.step.active { color: var(--dark); font-weight: 600; }
.step.active b { background: var(--primary); color: #fff; }
.step-line { flex: 1; height: 1px; background: var(--border); min-width: 20px; }

/* ตะกร้าลอย */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; background: #fff; z-index: 120;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px; }
.drawer-foot { padding: 18px 20px; border-top: 1px solid var(--border-soft); }
.mini-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.mini-item img { width: 62px; height: 62px; border-radius: 6px; flex: none; }
.mini-item .nm { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }

/* บัญชี */
.account-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 30px; align-items: start; }
/* ยอมให้คอลัมน์ย่อได้ และตัดคำอีเมลยาว ๆ ไม่ให้ดันหน้าจนล้นบนมือถือ */
.account-layout > * { min-width: 0; }
.account-layout aside .card { overflow-wrap: anywhere; }
/* เมนูระบบสมาชิก — พื้นเข้ม รายการที่เลือกเป็นแถบสีเหลืองอำพัน */
.account-nav {
  background: var(--dark); border: 0; border-radius: var(--radius-lg);
  overflow: hidden; padding: 10px; box-shadow: var(--shadow);
}
.account-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; font-size: 14px;
  color: #C3CAD2; border: 0; border-radius: 8px; margin-bottom: 2px; transition: all var(--t);
}
.account-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.account-nav a .icon { width: 19px; height: 19px; color: #868E96; flex: none; }
.account-nav a:hover .icon { color: #fff; }
.account-nav a.active { background: var(--amber); color: var(--dark); font-weight: 600; box-shadow: none; }
.account-nav a.active .icon { color: var(--dark); }
.account-nav a.hi { color: var(--amber); font-weight: 600; }
.account-nav a.hi .icon { color: var(--amber); }
.account-nav a.hi:hover { background: rgba(252, 196, 25, .14); color: var(--amber); }
.account-nav .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 9px 8px; }
.account-nav .badge-n { margin-left: auto; background: var(--primary); color: #fff; font-size: 11px;
  font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; }
.card { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 24px; background: #fff; }
.card + .card { margin-top: 20px; }
/* การ์ดที่วางเรียงในกริดไม่ต้องมีระยะห่างบน — กริดจัดระยะให้อยู่แล้ว */
.promo-grid > .card + .card, .grid-2 > .card + .card, .stat-grid > .card + .card { margin-top: 0; }

/* การ์ดกรอบนูน 3D — สูงเท่ากันทุกใบในแถว ใช้ได้ทุกหน้า */
.card-3d {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 24px 22px; margin-bottom: 7px;
  background: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
  box-shadow:
    inset 0 1px 0 #fff,
    0 5px 0 rgba(33, 37, 41, .10),
    0 12px 24px rgba(33, 37, 41, .13);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card-3d:hover {
  transform: translateY(-4px); border-color: transparent;
  box-shadow: inset 0 1px 0 #fff, 0 9px 0 rgba(33, 37, 41, .11), 0 20px 34px rgba(33, 37, 41, .18);
}
.card-3d h3 { font-size: 17px; margin: 0 0 8px; line-height: 1.4; }
.card-3d p { margin: 0; line-height: 1.6; }
.card-3d > :last-child { margin-bottom: 0; }
/* ไอคอนนูนในการ์ด */
/* การ์ดแพ็กเกจร้านค้า — เรียงข้อความเป็นระเบียบ ปุ่มชิดขอบล่างเท่ากันทุกใบ */
.plan-card { border-width: 2px; padding: 26px 24px 24px; }   /* ขอบหนาเท่ากันทุกใบ เนื้อหาจึงตรงแนว */
.plan-card.hot { border-color: var(--primary); }
.plan-tag { position: absolute; top: -12px; left: 22px; }
.plan-name { font-size: 19px; margin: 0 0 10px; letter-spacing: -.01em; }
/* ราคา + หน่วย วางบนเส้นฐานเดียวกัน */
.plan-price { display: flex; align-items: baseline; gap: 7px; margin: 0 0 7px; }
.plan-price b { font-size: 32px; font-weight: 700; color: var(--primary); line-height: 1.1; letter-spacing: -.02em; }
.plan-price span { font-size: 13px; color: var(--muted); }
.plan-fee { font-size: 13px; color: var(--muted); margin: 0 0 17px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.plan-fee b { color: var(--body); font-weight: 600; }
/* รายการสิทธิประโยชน์ — เครื่องหมายถูกตรงแนว บรรทัดห่างเท่ากัน */
.plan-feats { font-size: 13.5px; margin: 0 0 22px; display: grid; gap: 9px; }
.plan-feats li { display: flex; align-items: flex-start; gap: 9px; line-height: 1.5; }
.plan-feats .icon { width: 17px; height: 17px; color: var(--success); flex: none; margin-top: 2px; }
.plan-card > .btn { margin-top: auto; }

.card-3d .c3d-ic {
  width: 48px; height: 48px; border-radius: 14px; flex: none; margin-bottom: 15px;
  display: grid; place-items: center; color: var(--primary);
  background: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(var(--primary-rgb), .16), 0 6px 12px rgba(var(--primary-rgb), .18);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head h3 { font-size: 17px; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 18px; background: #fff; }
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.stat .val { font-size: 25px; font-weight: 700; line-height: 1.15; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 12px; background: var(--page); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table th:first-child { border-radius: 6px 0 0 6px; } .table th:last-child { border-radius: 0 6px 6px 0; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tr:hover td { background: #FCFCFD; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 74px; height: 74px; border-radius: 50%; background: var(--light); display: grid; place-items: center; margin: 0 auto 16px; color: var(--muted-2); }
.empty h3 { font-size: 18px; color: var(--dark); }

/* แจ้งเตือน */
.toast-wrap { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: var(--dark); color: #fff; padding: 13px 18px; border-radius: var(--radius); font-size: 13.5px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; animation: toastIn .25s ease; max-width: 360px; }
.toast.ok { background: var(--success); } .toast.err { background: var(--sale); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }

/* โมดัล */
.modal-backdrop { position: fixed; inset: 0; background: rgba(33,37,41,.55); z-index: 150; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); animation: modalIn .22s ease; margin: auto; }
.modal.wide { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 24px; max-height: 72vh; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; }

.alert { padding: 13px 16px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-err { background: #FFF5F5; color: #C92A2A; }
.alert-ok { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info); }
.alert-warn { background: var(--warning-soft); color: #B54708; }

.skeleton { background: linear-gradient(90deg, var(--border-soft) 25%, #F5F6F8 50%, var(--border-soft) 75%);
  background-size: 200% 100%; animation: shim 1.3s infinite; border-radius: 6px; }
@keyframes shim { to { background-position: -200% 0; } }
.sk-card { height: 330px; border-radius: var(--radius); }

/* กราฟ */
.chart { width: 100%; height: 220px; }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; }
.chart-bars .bar { flex: 1; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .85; transition: opacity var(--t); position: relative; }
.chart-bars .bar:hover { opacity: 1; }
.chart-bars .bar::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff;
  font-size: 11px; padding: 3px 7px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t); margin-bottom: 5px; }
.chart-bars .bar:hover::after { opacity: 1; }

/* =========================================================
   ระบบกรอบนูน + ไอคอน 3D (ใช้ร่วมกันทั้งเว็บ)
   ระดับ 1 = นูนตื้น (การ์ดจำนวนมากในกริด)
   ระดับ 2 = นูนเด่น (การ์ด/แผงหลัก)
   ========================================================= */
:root {
  --e3d-1:  inset 0 1px 0 #fff, 0 3px 0 rgba(33, 37, 41, .08), 0 8px 16px rgba(33, 37, 41, .10);
  --e3d-1h: inset 0 1px 0 #fff, 0 6px 0 rgba(33, 37, 41, .10), 0 15px 28px rgba(33, 37, 41, .17);
  --e3d-2:  inset 0 1px 0 #fff, 0 5px 0 rgba(33, 37, 41, .10), 0 12px 24px rgba(33, 37, 41, .13);
  --e3d-2h: inset 0 1px 0 #fff, 0 9px 0 rgba(33, 37, 41, .11), 0 20px 34px rgba(33, 37, 41, .18);
  --e3d-dark: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(0, 0, 0, .35),
              0 5px 0 rgba(0, 0, 0, .26), 0 14px 28px rgba(33, 37, 41, .30);
  --e3d-tile: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 rgba(33, 37, 41, .10), 0 6px 12px rgba(33, 37, 41, .14);
  --surface-3d: linear-gradient(180deg, #fff 0%, #FAFBFC 100%);
}

/* ---- แผงนิ่ง: กรอบนูนแต่ไม่ขยับเมื่อชี้เมาส์ ---- */
.card, .stat, .filter-box, .summary-box, .shop-toolbar, .gallery-main,
.dept-panel, .modal, .account-nav, .qty-box {
  background-image: var(--surface-3d);
  box-shadow: var(--e3d-2);
}
.account-nav { background-image: none; box-shadow: var(--e3d-dark); }
.modal { box-shadow: inset 0 1px 0 #fff, 0 8px 0 rgba(33, 37, 41, .12), 0 28px 60px rgba(33, 37, 41, .35); }
.qty-box { box-shadow: var(--e3d-1); }
.stat { box-shadow: var(--e3d-1); }

/* ---- การ์ดที่กดได้: นูนแล้วยกขึ้นเมื่อชี้เมาส์ ---- */
.pcard, .pcard-h, .cat-card, .testi-card, .post-card, .courier-item, .brand-item, .pay-option {
  background-image: var(--surface-3d);
  box-shadow: var(--e3d-1);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), background var(--t);
}
.pcard:hover, .pcard-h:hover, .cat-card:hover, .testi-card:hover,
.post-card:hover, .courier-item:hover, .brand-item:hover, .pay-option:hover {
  transform: translateY(-3px); border-color: transparent; box-shadow: var(--e3d-1h);
}
.pcard:hover { z-index: 5; }
.pay-option.active { box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(var(--primary-rgb), .22), 0 8px 16px rgba(var(--primary-rgb), .18); }

/* ---- คูปอง: กรอบเส้นประนูนบนพื้นสีแบรนด์ ---- */
.coupon-card {
  background-image: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 rgba(var(--primary-rgb), .18), 0 10px 20px rgba(var(--primary-rgb), .16);
  transition: transform var(--t), box-shadow var(--t);
}
.coupon-card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 7px 0 rgba(var(--primary-rgb), .2), 0 16px 28px rgba(var(--primary-rgb), .22); }
.coupon-code { box-shadow: var(--e3d-tile); transition: transform var(--t), box-shadow var(--t); }
.coupon-code:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }

/* ---- พื้นเข้ม: ใช้ชุดเงาสำหรับพื้นเข้มเพื่อให้เห็นความหนา ---- */
.newsletter, .flash-band, .coupon-band.on-dark { box-shadow: var(--e3d-dark); }

/* ---- แถบบริการโทนอ่อน (หน้าสินค้า/บัญชี) ---- */
.feature-strip.light { background-image: var(--surface-3d); box-shadow: var(--e3d-1); }
.feature-strip.light:hover { transform: none; box-shadow: var(--e3d-1); }

/* ---- ไอคอนแบบแผ่นนูน 3D ---- */
.ic-tile, .empty .ic, .ptool, .courier-mark, .kpi .ic, .c3d-ic, .avatar {
  box-shadow: var(--e3d-tile);
}
.ic-3d, .feature-item .ic-3d { background: none; box-shadow: none; }   /* ไอคอน SVG 3D เต็มใบ ไม่ต้องมีแผ่นซ้อน */
.empty .ic {
  background-image: linear-gradient(180deg, #fff 0%, var(--light) 100%);
  box-shadow: inset 0 2px 0 #fff, inset 0 -3px 8px rgba(33, 37, 41, .07), 0 4px 0 rgba(33, 37, 41, .07), 0 10px 20px rgba(33, 37, 41, .12);
}
.courier-mark { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 5px rgba(0, 0, 0, .18), 0 3px 0 rgba(33, 37, 41, .14), 0 6px 12px rgba(33, 37, 41, .16); }
.store-logo { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -3px 7px rgba(0, 0, 0, .16), 0 3px 0 rgba(33, 37, 41, .13), 0 7px 14px rgba(33, 37, 41, .17); }
.ptool { transition: transform var(--t), background var(--t), color var(--t); }
.ptool:active { transform: translateY(2px); }

/* ---- ส่วนท้ายเว็บ: แผ่นยกขอบบน + ไอคอน/ชิปแบบนูน ---- */
.site-footer {
  background-image: linear-gradient(180deg, #fff 0%, var(--page) 42%);
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 #fff, inset 0 8px 18px rgba(33, 37, 41, .05);
}
.site-footer .brand-mark {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .28) 0%, rgba(0, 0, 0, .12) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 7px rgba(0, 0, 0, .2),
              0 4px 0 rgba(var(--primary-rgb), .35), 0 8px 16px rgba(var(--primary-rgb), .3);
}
/* ปุ่มโซเชียลแบบแป้นนูน กดยุบได้ */
.social-row a {
  background-image: var(--surface-3d);
  box-shadow: var(--e3d-tile);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t), border-color var(--t);
}
.social-row a:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 4px 0 rgba(var(--primary-rgb), .3), 0 9px 16px rgba(var(--primary-rgb), .28); }
.social-row a:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
/* แผ่นไอคอนช่องทางติดต่อ */
.fc-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background-image: linear-gradient(180deg, #fff 0%, var(--primary-soft) 100%);
  color: var(--primary);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(var(--primary-rgb), .18), 0 5px 10px rgba(var(--primary-rgb), .16);
}
.fc-ic .icon { width: 16px; height: 16px; }
/* เส้นคั่นแถวล่างแบบขอบเอียง + ชิปช่องทางชำระเงินนูน */
.footer-bottom { border-top: 1px solid var(--border); box-shadow: inset 0 1px 0 #fff; }
.pay-chip {
  background-image: var(--surface-3d);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 rgba(33, 37, 41, .1), 0 4px 9px rgba(33, 37, 41, .12);
  transition: transform var(--t), box-shadow var(--t), color var(--t), border-color var(--t);
}
.pay-chip:hover { transform: translateY(-2px); color: var(--dark); border-color: var(--muted-2); }

/* ---- ตาราง / ป้าย / กล่องว่าง — ใช้ร่วมทุกระบบจัดการ ---- */
.table th {
  background-image: linear-gradient(180deg, #fff 0%, var(--page) 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 var(--border-soft);
}
.table tbody tr { transition: background var(--t), box-shadow var(--t); }
.table tbody tr:hover { background: var(--page); box-shadow: inset 3px 0 0 var(--primary); }
.badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 0 rgba(33, 37, 41, .08); }
.empty-sm {
  background-image: linear-gradient(180deg, var(--page) 0%, #fff 100%);
  border-radius: var(--radius); box-shadow: inset 0 2px 6px rgba(33, 37, 41, .06);
}
.stock-bar, .bar-list .track { box-shadow: inset 0 1px 3px rgba(33, 37, 41, .16); }
.stock-bar span, .bar-list .track span { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }

/* ---- เมนูสมาชิก (พื้นเข้ม) ให้นูนแบบเดียวกับแถบข้างแดชบอร์ด ---- */
.account-nav a { transition: transform var(--t), background var(--t), color var(--t), box-shadow var(--t); }
.account-nav a:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.account-nav a.active {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .3) 0%, rgba(0, 0, 0, .12) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 0 rgba(0, 0, 0, .3), 0 7px 14px rgba(252, 196, 25, .3);
}
.account-nav a:active { transform: translateY(2px); }
.account-nav .badge-n, .chat-room .pill, .panel-tabs .pill {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 rgba(0, 0, 0, .2);
}
.chat-room .avatar { box-shadow: var(--e3d-tile); }
.chat-room.active {
  box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px rgba(var(--primary-rgb), .25), 0 2px 0 rgba(var(--primary-rgb), .16);
}
.chat-rooms, .chat-thread { background-image: var(--surface-3d); }

/* ---- ปุ่มเล็ก/ชิป/หน้าถัดไป: นูนบางและกดยุบ ---- */
.pagination button, .chip, .qty-box button, .icon-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 2px 0 rgba(33, 37, 41, .08), 0 4px 8px rgba(33, 37, 41, .10);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t), border-color var(--t);
}
.icon-btn { box-shadow: none; }                          /* ปุ่มไอคอนบนแถบหัวเว็บยังคงโปร่ง */
.pagination button:active, .chip:active, .qty-box button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.pagination button.active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 3px 0 rgba(0, 0, 0, .18), 0 6px 12px rgba(var(--primary-rgb), .28); }

/* ---- ปุ่มทึบ: มีความหนาและกดยุบได้ ---- */
.btn-primary, .btn-dark, .btn-success {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 0 rgba(0, 0, 0, .18), 0 6px 14px rgba(33, 37, 41, .18);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 0 rgba(0, 0, 0, .2), 0 10px 20px rgba(var(--primary-rgb), .3); }
.btn-dark:hover, .btn-success:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 0 rgba(0, 0, 0, .22), 0 10px 20px rgba(33, 37, 41, .26); }
.btn-primary:active, .btn-dark:active, .btn-success:active, .btn-soft:active, .btn-outline:active {
  transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 rgba(0, 0, 0, .18);
}
.btn-soft { transition: all var(--t); }

/* =========================================================
   ระบบจัดการ — แท็บย่อย / ป้ายตัวเลข / ที่อยู่ / แชทในแผง
   ========================================================= */
.panel-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px;
  border-bottom: 1px solid var(--border-soft); padding-bottom: 12px;
}
.panel-tabs a, .panel-tabs button {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 0 rgba(33, 37, 41, .07), 0 4px 8px rgba(33, 37, 41, .09);
  transition: transform var(--t), box-shadow var(--t), background var(--t), color var(--t);
}
.panel-tabs a:hover, .panel-tabs button:hover { color: var(--primary); background: var(--primary-soft); }
.panel-tabs a.active, .panel-tabs button.active {
  background: var(--dark); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 3px 0 rgba(0, 0, 0, .2), 0 6px 12px rgba(33, 37, 41, .22);
}
.panel-tabs a:active, .panel-tabs button:active { transform: translateY(2px); box-shadow: none; }

.pill {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; flex: none;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* ที่อยู่จัดส่ง */
.addr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.addr-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px;
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
}
.addr-card.is-default { border-color: var(--primary); }
.mini-item.unread { background: var(--primary-soft); border-radius: 10px; }

/* แชทในแผงสมาชิก */
.chat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
.chat-rooms { padding: 12px; max-height: 68vh; overflow: auto; }
.chat-room {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px;
  border-radius: 10px; text-align: left; color: inherit; transition: background var(--t);
}
.chat-room:hover { background: var(--page); color: inherit; }
.chat-room.active { background: var(--primary-soft); }
.chat-room .avatar { width: 38px; height: 38px; font-size: 15px; }
.cr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.cr-main b { font-size: 13.5px; font-weight: 600; }

@media (max-width: 992px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-rooms { max-height: 240px; }
}
@media (max-width: 576px) { .addr-grid { grid-template-columns: 1fr; } }

/* =========================================================
   กล่องแชทกับร้านค้า
   ========================================================= */
.chatbox {
  position: fixed; right: 20px; bottom: 20px; width: 342px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid var(--border-soft); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; z-index: 200; animation: modalIn .2s ease;
  box-shadow: 0 6px 0 rgba(33, 37, 41, .10), 0 26px 54px rgba(33, 37, 41, .3);
}
.cb-head {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; color: #fff;
  background: linear-gradient(120deg, var(--dark) 0%, var(--deep-1) 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.cb-head .store-logo { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.cb-who { min-width: 0; flex: 1; }
.cb-who h4 { font-size: 14px; margin: 0; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-who span { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: rgba(255, 255, 255, .7); }
.cb-who .icon { width: 13px; height: 13px; }
.cb-x { margin-left: auto; color: #fff; opacity: .75; flex: none; }
.cb-x:hover { opacity: 1; color: #fff; }
.cb-body { display: flex; flex-direction: column; gap: 9px; padding: 14px; height: 300px; overflow-y: auto; background: var(--page); }
.cb-msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.cb-msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--border-soft); border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); }
.cb-msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 5px; }
.cb-time { display: block; font-size: 10.5px; opacity: .62; margin-top: 3px; }
.cb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border-soft); background: #fff; }
.cb-form .input { height: 38px; font-size: 13px; }
.cb-form .btn { flex: none; width: 42px; padding: 0; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1400px) {
  .hero-layout { grid-template-columns: var(--dept-w) 1fr; }
  /* พื้นที่ไม่พอวางข้างสไลด์แล้ว ย้ายการ์ดลงมาเรียงเป็นแถวเต็มความกว้างแทนการซ่อนทิ้ง */
  .hero-layout .hero-side-right {
    grid-column: 1 / -1; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  }
}
/* ต่ำกว่านี้วางครบ 3 ใบในแถวเดียวไม่ได้ ลงมาเรียงทีละใบเลย ไม่ให้เหลือใบเดียวโดด ๆ */
@media (max-width: 845px) {
  .hero-layout .hero-side-right { grid-template-columns: 1fr; }
}
@media (max-width: 1200px) {
  .header-topbar, .header-main, .header-nav { display: none; }
  .header-mobile { display: block; }
  .site-header { border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: 100; }
  .dept-panel { display: none; }
  .hero-layout { grid-template-columns: 1fr; }
  .hero-wrap { padding-top: 18px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-grid { grid-template-columns: repeat(5, 1fr); }
  .brand-strip { grid-template-columns: repeat(4, 1fr); }
  .courier-strip { grid-template-columns: repeat(4, 1fr); }
  .store-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-slide h2 { font-size: 33px; }
  .footer-main { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 992px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-slider { min-height: 380px; }
  .hero-slide { grid-template-columns: 1fr; padding: 28px; }
  .hero-slide .hero-art { display: none; }
  .shop-layout, .cart-layout, .account-layout, .product-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: none; }
  .sidebar.open { display: block; }
  .summary-box { position: static; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .promo-grid, .store-grid, .testi-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
  .courier-strip { grid-template-columns: repeat(3, 1fr); }
  .feature-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter { grid-template-columns: 1fr; padding: 28px; }
  .coupon-band { grid-template-columns: 1fr; }
  .mobile-bar { display: flex; }
  body { padding-bottom: 60px; }
  .section { padding: 34px 0; }
  .chatbox { bottom: 72px; }        /* ไม่ให้ทับแถบเมนูล่างบนมือถือ */
}
@media (max-width: 768px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 26px; }
  .hero-slide h2 { font-size: 27px; }
  .section-title { font-size: 20px; }
  .promo-card h3 { max-width: 100%; font-size: 18px; }
  .promo-card img { opacity: .28; }
  .product-title { font-size: 22px; }
  .price-block .now { font-size: 27px; }
  .modal-body { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .product-grid, .product-grid.cols-4, .product-grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pcard { padding: 10px; }
  .pcard-title { font-size: 13px; min-height: 36px; }
  .price-now { font-size: 15px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .promo-grid, .store-grid, .testi-grid, .post-grid, .brand-strip { grid-template-columns: 1fr; }
  .card-3d { padding: 20px 18px; }
  .si-visit { display: none; }     /* จอเล็ก: แตะที่กล่องเพื่อเข้าร้านได้อยู่แล้ว */
  .chatbox { left: 8px; right: 8px; width: auto; border-radius: 14px; }
  .cb-body { height: 44vh; }
  .brand-strip { grid-template-columns: repeat(2, 1fr); }
  .courier-strip { grid-template-columns: repeat(2, 1fr); }
  .feature-strip { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  /* บนมือถือแสดง 2 คอลัมน์ — บล็อกโลโก้/คำอธิบายกินเต็มแถวบนสุด */
  .footer-main { grid-template-columns: 1fr 1fr; gap: 24px 16px; padding: 34px 0 26px; }
  .footer-about { grid-column: 1 / -1; }
  .footer-col h4 { font-size: 13.5px; margin-bottom: 11px; }
  .footer-col li { font-size: 13px; margin-bottom: 7px; }
  .footer-contact { font-size: 12.5px; }
  .footer-contact div { gap: 8px; margin-bottom: 9px; }
  .fc-ic { width: 26px; height: 26px; border-radius: 8px; }
  .fc-ic .icon { width: 14px; height: 14px; }
  .footer-phone { font-size: 17px; }
  .newsletter form { flex-direction: column; }
  .cart-table thead { display: none; }
  .cart-table td { display: block; border: 0; padding: 6px 0; }
  .cart-table tr { display: block; border-bottom: 1px solid var(--border-soft); padding: 14px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hero-slide h2 { font-size: 23px; }
  .hero-slider { min-height: 330px; }
  .page-head h1 { font-size: 22px; }
}

@media print { .site-header, .site-footer, .mobile-bar, .btn { display: none !important; } }

/* เลือกที่อยู่ที่บันทึกไว้ในหน้าชำระเงิน */
.addr-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.addr-chip {
  display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; min-width: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius); background-image: var(--surface-3d);
  box-shadow: var(--e3d-1); transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.addr-chip b { font-size: 13.5px; }
.addr-chip span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr-chip:hover { border-color: var(--primary); transform: translateY(-2px); }
.addr-chip.active { border-color: var(--primary); box-shadow: inset 0 1px 0 #fff, 0 3px 0 rgba(var(--primary-rgb), .2), 0 8px 16px rgba(var(--primary-rgb), .16); }
.addr-chip.active b { color: var(--primary); }
@media (max-width: 576px) { .addr-pick { grid-template-columns: 1fr; } }

/* ---------- การ์ดโปรไฟล์สมาชิก (แก้ไขได้) ---------- */
.profile-card { text-align: center; margin-bottom: 16px; padding: 22px 18px 20px; }
.pc-avatar {
  position: relative; display: inline-grid; place-items: center; margin: 0 auto 12px;
  border-radius: 50%; transition: transform var(--t);
}
.pc-avatar:hover { transform: scale(1.04); }
.pc-avatar .avatar { display: grid; }
.pc-cam {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff; display: grid; place-items: center; border: 2px solid #fff;
  box-shadow: 0 2px 0 rgba(var(--primary-rgb), .35), 0 5px 10px rgba(33, 37, 41, .2);
}
.pc-cam .icon { width: 14px; height: 14px; }
.pc-name { font-size: 16px; margin: 0; }
.pc-mail { overflow-wrap: anywhere; }
.pc-edit { margin-top: 14px; width: 100%; }

/* แถวจัดการรูปในแท็บข้อมูลส่วนตัว */
.pf-photo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pf-photo .avatar { box-shadow: var(--e3d-tile); }

/* ---------- โลโก้เว็บที่แอดมินอัปโหลด ---------- */
.brand-logo { height: 40px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.header-main .brand-logo, .header-mobile .brand-logo { filter: brightness(0) invert(1); }  /* บนพื้นแดงให้เป็นสีขาว */
.dash-brand .brand-logo { height: 36px; max-width: 170px; }
.logo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.logo-preview {
  width: 190px; height: 74px; display: grid; place-items: center; flex: none; padding: 10px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background-image: linear-gradient(180deg, #fff 0%, var(--page) 100%);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- รายการงานค้างจากกระดิ่ง ---------- */
.todo-list { display: grid; gap: 8px; }
.todo-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 15px; text-align: left;
  border: 1px solid var(--border-soft); border-radius: var(--radius); font-size: 14px;
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.todo-item:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--e3d-1h); }
.todo-item .icon { width: 19px; height: 19px; color: var(--primary); flex: none; }
.todo-item .pill { margin-left: auto; }

/* ---------- ตัวเลือกโหมดโลโก้ในหน้าตั้งค่า ---------- */
.logo-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.logo-mode {
  display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.logo-mode input { position: absolute; opacity: 0; pointer-events: none; }
.logo-mode b { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.logo-mode b .icon { width: 17px; height: 17px; color: var(--muted); }
.logo-mode span { font-size: 12px; color: var(--muted); }
.logo-mode:hover { border-color: var(--primary); transform: translateY(-2px); }
.logo-mode.active { border-color: var(--primary); }
.logo-mode.active b, .logo-mode.active b .icon { color: var(--primary); }

/* ตัวอย่างโลโก้ — โหมดข้อความแสดงบนพื้นแดงเหมือนแถบหัวจริง */
.logo-preview.on-dark {
  background-image: linear-gradient(120deg, var(--primary), var(--primary-dark));
  border-style: solid; border-color: transparent;
}
.logo-preview.on-dark .brand-name { color: #fff; }
.logo-preview.on-dark .brand-name span { color: rgba(255, 255, 255, .78); }

/* ช่องเลือกสี + ช่องรหัสสี */
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] {
  width: 46px; height: 42px; padding: 3px; flex: none; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.color-row .input { flex: 1; min-width: 0; }

@media (max-width: 768px) { .logo-modes { grid-template-columns: 1fr; } }

/* ---------- รูปผู้ใช้บนแถบหัวเว็บ ---------- */
.qb-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center;
  flex: none; background: rgba(255, 255, 255, .22); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 2px 0 rgba(0, 0, 0, .16), 0 4px 8px rgba(0, 0, 0, .18);
}
.qb-initial { text-transform: uppercase; }

/* ---------- เลือกไอคอนโลโก้ในหน้าตั้งค่า ---------- */
.mark-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.icon-pick button {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  border: 1.5px solid var(--border); color: var(--muted);
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t), color var(--t);
}
.icon-pick button .icon { width: 19px; height: 19px; }
.icon-pick button:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.icon-pick button.active { border-color: var(--primary); color: #fff; background-image: linear-gradient(180deg, var(--primary), var(--primary-dark)); }
.brand-mark.has-img { overflow: hidden; background: transparent; }
.brand-mark.has-img img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 768px) { .mark-row { grid-template-columns: 1fr; } .icon-pick { grid-template-columns: repeat(8, 1fr); } }

/* ---------- อัปโหลดภาพแบนเนอร์ในหน้าแอดมิน ---------- */
.banner-img-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 6px; }
.banner-img-box {
  width: 148px; height: 112px; flex: none; display: grid; place-items: center; padding: 8px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background-image: linear-gradient(180deg, #fff 0%, var(--page) 100%);
}
.banner-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 576px) { .banner-img-box { width: 100%; height: 130px; } }

/* =========================================================
   หน้าข้อมูล / นโยบาย / คำถามที่พบบ่อย
   ========================================================= */
.policy-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 30px; align-items: start; padding-top: 26px; }
.policy-layout > aside { position: sticky; top: 90px; }
#toc h4 { font-size: 13.5px; margin: 0 0 10px; }
.toc-list { display: grid; gap: 2px; }
.toc-list a {
  display: block; padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--muted);
  border-left: 2px solid transparent; transition: all var(--t);
}
.toc-list a:hover { color: var(--primary); background: var(--primary-soft); }
.toc-list a.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-soft); font-weight: 600; }

.policy-body { max-width: 780px; }
.policy-lead { font-size: 15.5px; line-height: 1.75; color: var(--body); margin: 0 0 26px; }
.policy-body h2 {
  font-size: 19px; margin: 34px 0 12px; scroll-margin-top: 92px;
  padding-bottom: 9px; border-bottom: 1px solid var(--border-soft);
}
.policy-body h2:first-of-type { margin-top: 6px; }
.policy-body p { line-height: 1.8; margin: 0 0 12px; }
.policy-list { display: grid; gap: 9px; margin: 0 0 14px; }
.policy-list li { display: flex; gap: 10px; line-height: 1.7; font-size: 14px; }
.policy-list li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
  margin-top: 10px; flex: none;
}
.policy-steps { display: grid; gap: 14px; margin: 0 0 14px; counter-reset: st; }
.policy-steps li {
  display: flex; gap: 14px; line-height: 1.7; font-size: 14px; counter-increment: st;
  padding: 15px 17px; border: 1px solid var(--border-soft); border-radius: var(--radius);
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
}
.policy-steps li::before {
  content: counter(st); width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13.5px; color: #fff;
  background-image: linear-gradient(180deg, var(--primary), var(--primary-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 0 rgba(var(--primary-rgb), .3);
}
.policy-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 26px; }
.policy-highlights > div {
  padding: 16px; border: 1px solid var(--border-soft); border-radius: var(--radius); text-align: center;
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
}
.policy-highlights b { display: block; font-size: 19px; color: var(--primary); }
.policy-highlights span { font-size: 12.5px; color: var(--muted); }

/* คำถามที่พบบ่อย */
.faq-group { margin-bottom: 30px; }
.faq-group h2 { font-size: 19px; margin: 0 0 14px; scroll-margin-top: 92px; }
.faq-item {
  border: 1px solid var(--border-soft); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden;
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
  transition: box-shadow var(--t), border-color var(--t);
}
.faq-item:hover { border-color: var(--primary); }
.faq-q {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 16px 18px; font-size: 14.5px; font-weight: 600; line-height: 1.5;
}
.faq-chev { width: 18px; height: 18px; margin-left: auto; flex: none; color: var(--muted); transition: transform var(--t); }
.faq-item.open .faq-chev { transform: rotate(180deg); color: var(--primary); }
.faq-a { display: none; padding: 0 18px 17px; }
.faq-item.open .faq-a { display: block; }
.faq-a p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted); }
.faq-a a { color: var(--primary); font-weight: 500; }

/* แถบลิงก์นโยบายท้ายเว็บ */
.footer-policy {
  display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 16px 0 0;
  border-top: 1px solid var(--border); font-size: 13px;
}
.footer-policy a { color: var(--muted); }
.footer-policy a:hover { color: var(--primary); }

@media (max-width: 992px) {
  .policy-layout { grid-template-columns: 1fr; gap: 18px; }
  .policy-layout > aside { position: static; }
  .toc-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .policy-highlights { grid-template-columns: 1fr; }
  .toc-list { grid-template-columns: 1fr; }
}

/* ตัวอย่างโลโก้สองพื้นหลัง + ป้ายกำกับ */
.logo-previews { display: grid; gap: 10px; flex: none; width: 230px; }
.logo-preview { position: relative; width: 100%; height: 74px; }
.lp-tag {
  position: absolute; top: 6px; left: 8px; font-size: 10px; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px; background: rgba(33, 37, 41, .1); color: var(--muted);
}
.logo-preview.on-dark .lp-tag { background: rgba(255, 255, 255, .22); color: #fff; }
@media (max-width: 768px) { .logo-previews { width: 100%; grid-template-columns: 1fr 1fr; } }

/* ---------- แคปช่ากันบอทหน้าเข้าสู่ระบบ ---------- */
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.captcha-img {
  width: 168px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: #FBFCFD;
  box-shadow: inset 0 1px 3px rgba(33, 37, 41, .1);
  display: grid; place-items: center;
}
.captcha-img svg { display: block; width: 100%; height: 100%; user-select: none; }
.captcha-reload {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); color: var(--muted);
  background-image: var(--surface-3d); box-shadow: var(--e3d-1);
  transition: transform var(--t), box-shadow var(--t), color var(--t), border-color var(--t);
}
.captcha-reload:hover { color: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.captcha-reload:active { transform: translateY(2px); box-shadow: none; }
.captcha-input { letter-spacing: .18em; font-weight: 600; text-transform: uppercase; }
.captcha-input::placeholder { letter-spacing: normal; font-weight: 400; text-transform: none; }

/* คูปองบนจอแคบ — ยอมให้ขึ้นบรรทัดใหม่และย่อข้อความ ไม่ให้ดันหน้าจนล้น */
.coupon-card { flex-wrap: wrap; min-width: 0; }
.coupon-card > div { min-width: 0; }
.coupon-card h4, .coupon-card p { overflow-wrap: anywhere; }
@media (max-width: 576px) {
  .coupon-card { padding: 16px 16px; gap: 12px; }
  .coupon-off { font-size: 28px; }
  .coupon-code { margin-left: 0; width: 100%; text-align: center; }
}

/* ซ่อนลูกศรขึ้น-ลงของช่องกรอกตัวเลข — ใช้ปุ่ม +/- หรือพิมพ์เองแทน */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- แถบเลื่อน: ตัดปุ่มลูกศรหัว-ท้ายออก ให้เหลือแค่แถบบาง ๆ ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* ปุ่มลูกศรบน-ล่างของแถบเลื่อน (แบบวินโดวส์) */
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* แถบเลื่อนบนพื้นเข้ม เช่น แถบข้างแดชบอร์ดและเมนูสมาชิก */
.dash-side, .account-nav, .drawer { scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.dash-side::-webkit-scrollbar-thumb, .account-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .22); background-clip: content-box;
}



/* ---------- ปุ่มแชทกับร้านค้า — ใช้สีฟ้าให้ต่างจากปุ่มติดตาม ---------- */
.chat-btn {
  --chat-blue: #1C7ED6;
  --chat-blue-dark: #1667B1;
  background: var(--chat-blue); color: #fff; border-color: var(--chat-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 0 rgba(0, 0, 0, .16), 0 6px 14px rgba(28, 126, 214, .28);
}
.chat-btn:hover {
  background: var(--chat-blue-dark); color: #fff; border-color: var(--chat-blue-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 4px 0 rgba(0, 0, 0, .18), 0 10px 20px rgba(28, 126, 214, .34);
}
.chat-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 0 rgba(0, 0, 0, .18); }

}

/* ---------- การ์ดสรุปในหน้าภาพรวมสมาชิก — พื้นขาว ไอคอนนูน 3D ---------- */
.order-stats { grid-template-columns: repeat(4, 1fr); }
.ostat { display: flex; align-items: center; gap: 14px; }
.st-body { display: flex; flex-direction: column; min-width: 0; }
.ostat .lbl { margin-bottom: 2px; }
.ostat .val { font-size: 23px; }

/* แผ่นไอคอนนูน — ไล่เฉดสี + ไฮไลต์ขอบบน + ความหนา + เงาสีเดียวกับไอคอน */
.st-ic {
  --ic-a: #4A90E2; --ic-b: #2F6FD0; --ic-glow: 74, 144, 226;
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--ic-a) 0%, var(--ic-b) 100%);
  box-shadow:
    inset 0 1.5px 0 rgba(255, 255, 255, .45),
    inset 0 -2px 5px rgba(0, 0, 0, .22),
    0 3px 0 rgba(var(--ic-glow), .35),
    0 8px 16px rgba(var(--ic-glow), .32);
  transition: transform var(--t), box-shadow var(--t);
}
.st-ic .icon { width: 23px; height: 23px; stroke-width: 1.9; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.ostat:hover .st-ic {
  transform: translateY(-2px);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .45), inset 0 -2px 5px rgba(0, 0, 0, .22),
              0 5px 0 rgba(var(--ic-glow), .35), 0 12px 22px rgba(var(--ic-glow), .4);
}
.st-ic.blue   { --ic-a: #4A9BF5; --ic-b: #1C6FD0; --ic-glow: 28, 111, 208; }
.st-ic.orange { --ic-a: #FFAE4A; --ic-b: #E8790A; --ic-glow: 232, 121, 10; }
.st-ic.teal   { --ic-a: #35CFCF; --ic-b: #0E9494; --ic-glow: 14, 148, 148; }
.st-ic.violet { --ic-a: #A874F0; --ic-b: #6F35C4; --ic-glow: 111, 53, 196; }
.st-ic.green  { --ic-a: #52CC69; --ic-b: #1E9433; --ic-glow: 30, 148, 51; }
.st-ic.red    { --ic-a: #FF6376; --ic-b: #CE1F32; --ic-glow: 206, 31, 50; }

@media (max-width: 1200px) { .order-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .order-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) {
  .ostat { gap: 11px; }
  .st-ic { width: 40px; height: 40px; border-radius: 12px; }
  .st-ic .icon { width: 20px; height: 20px; }
  .ostat .val { font-size: 20px; }
}

/* วันที่สมัครสมาชิกในการ์ดโปรไฟล์ */
.pc-since {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  max-width: 100%; margin-top: 10px; line-height: 1.5; text-align: center;
  padding: 5px 11px; border-radius: 12px; font-size: 11.5px; color: var(--muted);
  background-image: linear-gradient(180deg, #fff 0%, var(--page) 100%);
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(33, 37, 41, .05);
}
.pc-since .icon { width: 13px; height: 13px; color: var(--muted-2); flex: none; }

/* ---------- ปุ่มดวงตาเปิด/ปิดรหัสผ่าน ---------- */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .input { width: 100%; padding-right: 46px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  color: var(--muted-2); background: transparent;
  transition: color var(--t), background var(--t);
}
.pw-eye:hover { color: var(--primary); background: var(--primary-soft); }
.pw-eye.on { color: var(--primary); }
.pw-eye .icon { width: 18px; height: 18px; }

/* =========================================================
   ปุ่มกลับขึ้นด้านบน
   ========================================================= */
.back-to-top {
  --btt-progress: 0%;
  position: fixed; right: 22px; bottom: 22px; z-index: 95;
  width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-3d); color: var(--dark);
  box-shadow: var(--e3d-2);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.9);
  transition: opacity .22s, transform .22s, visibility .22s, box-shadow .18s;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--primary); box-shadow: var(--e3d-2h); transform: translateY(-2px); }
.back-to-top:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #fff, 0 1px 0 rgba(33, 37, 41, .18); }
.back-to-top:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.back-to-top .icon { width: 21px; height: 21px; stroke-width: 2.4; position: relative; z-index: 1; }

/* วงแหวนบอกว่าอ่านมาถึงไหนของหน้าแล้ว */
.back-to-top .btt-ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--primary) var(--btt-progress), rgba(33, 37, 41, .10) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
}

/* ---- หลบส่วนที่ลอยอยู่มุมล่างเหมือนกัน ---- */
body:has(.chatbox) .back-to-top { right: 378px; }        /* กล่องแชทกว้าง 342px */
body:has(.sticky-buy.show) .back-to-top { bottom: 86px; } /* แถบซื้อสินค้าด้านล่าง */

@media (max-width: 992px) {
  .back-to-top { right: 16px; bottom: 72px; width: 46px; height: 46px; }  /* เหนือแถบเมนูล่าง */
  .back-to-top .icon { width: 19px; height: 19px; }
  body:has(.chatbox) .back-to-top { display: none; }      /* จอเล็กเปิดแชทแล้วเต็มพื้นที่ */
  body:has(.sticky-buy.show) .back-to-top { bottom: 132px; }
}

@media print { .back-to-top { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: opacity .01s, visibility .01s; } }

/* หน้าจอสั่งพิมพ์: ซ่อนส่วนที่ไม่ใช่เนื้อหา (เอกสารจริงถูกสร้างแยกใน iframe อยู่แล้ว) */
@media print {
  .dash-side, .dash-topbar, .filter-bar-card, .site-header, .site-footer,
  .back-to-top, .mobile-bar, .toast-wrap, .chatbox, .row-actions { display: none !important; }
  .dash-layout { display: block !important; }
  .dash-card { box-shadow: none !important; border: 1px solid #999; }
}


/* =========================================================
   แถบตัวกรอง — ใช้ทั้งแผงจัดการและหน้าบัญชีสมาชิก จึงอยู่ในไฟล์กลาง
   ========================================================= */
/* ---------------- แถบตัวกรองในตาราง ---------------- */
.filter-bar-card { padding: 16px 18px; }
.filter-bar {
  display: grid; gap: 10px; align-items: center;
  grid-template-columns: minmax(180px, 2.2fr) repeat(4, minmax(130px, 1fr)) auto auto;
}
.filter-bar .input, .filter-bar .select { height: 42px; min-width: 0; }
.filter-bar .btn { height: 42px; white-space: nowrap; }

.filter-summary {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border-soft);
  font-size: 13px;
}
.filter-summary .muted { font-size: 12.5px; }
.filter-summary .btn { margin-left: auto; }

@media (max-width: 1100px) {
  .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-bar .input { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar .btn { grid-column: span 1; }
  .filter-summary .btn { margin-left: 0; width: 100%; }
}

.filter-summary .fs-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .filter-summary .fs-actions { margin-left: 0; width: 100%; }
  .filter-summary .fs-actions .btn { flex: 1; }
}
