:root {
  --bg: #fff6fa;
  --surface: #ffffff;
  --surface-2: #ffe3f1;
  --line: #f8cfe3;
  --text: #3a1328;
  --muted: #8f6a7d;
  --accent: #e6007e; /* สีชมพูของโลโก้ร้าน */
  --accent-ink: #ffffff;
  --line-green: #06c755;
  --fb-blue: #1877f2;
  --tabbar-h: 80px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Sukhumvit Set", "Noto Sans Thai", "Thonburi", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

/* โครงหน้า */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.brand img { width: 40px; height: 40px; border-radius: 10px; display: block; }
.admin-brand img { width: 32px; height: 32px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.langbtn { display: flex; gap: 8px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.flag { display: block; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; opacity: .45; border: 3px solid transparent; }
.flag svg { display: block; width: 100%; height: 100%; }
.flag.on { opacity: 1; border-color: var(--accent); }
.pill {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
#view {
  max-width: 720px; margin: 0 auto;
  padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
  min-height: calc(100dvh - var(--topbar-h));
}
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box;
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: end;
  background: var(--surface); border-radius: 28px 28px 0 0; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px #e6007e2e;
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
  height: 100%; padding-bottom: 10px;
  font-size: 16px; font-weight: 600; color: var(--text);
}
.tabbar a:not(.tab-center) .ico { width: 52px; height: 36px; padding: 2px 10px; border-radius: 18px; box-sizing: border-box; }
.tabbar a.active:not(.tab-center) { color: var(--accent); }
.tabbar a.active:not(.tab-center) .ico { background: var(--surface-2); }
.tabbar a.active:not(.tab-center) .ico svg { fill: currentColor; }
.tab-center { color: var(--text); }
.tab-center.active { color: var(--accent); }
.tab-circle {
  position: absolute; top: -30px; left: 50%; width: 66px; height: 66px; margin-left: -33px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: #fff; border: 5px solid var(--surface);
  box-shadow: 0 6px 16px #e6007e66;
}
.tab-circle .ico { width: 30px; height: 30px; }
.tab-circle .ico svg { fill: currentColor; }
.tab-center.active .tab-circle { box-shadow: 0 0 0 4px var(--surface-2), 0 6px 16px #e6007e66; }
.tab-center .badge { top: -8px; left: auto; right: -10px; background: #fff; color: var(--accent); border: 2px solid var(--accent); line-height: 20px; }
.ico { display: inline-flex; width: 32px; height: 32px; }
.ico svg { width: 100%; height: 100%; }
.badge {
  position: absolute; top: 2px; left: calc(50% + 8px);
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 14px; font-weight: 700; line-height: 24px; text-align: center;
}

/* ปุ่ม */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 0 18px; border-radius: 14px;
  background: var(--surface); color: var(--text); font-weight: 600; text-align: center;
  border: 1px solid var(--line);
}
.btn-line, .btn-fb, .btn-accent { border-color: transparent; }
.btn-line { background: var(--line-green); color: #fff; }
.btn-fb { background: var(--fb-blue); color: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: none; border: 1px solid var(--line); font-weight: 500; }
.stack { display: grid; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 12px; }
.page-title { font-size: 22px; font-weight: 600; margin: 8px 0 16px; }
.empty { text-align: center; padding: 56px 0; display: grid; gap: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px;
  display: inline-flex; align-items: center; white-space: nowrap; flex: none;
}
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip[data-shortcut] { background: var(--surface-2); border-color: var(--surface-2); color: var(--accent); font-weight: 600; }
.tag { display: inline-flex; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }

/* โชว์รูม */
.search {
  width: 100%; height: 46px; padding: 0 18px; border-radius: 23px;
  border: 1px solid var(--line); background: var(--surface); outline: 0;
}
/* แนะนำปุ่มหัวใจ: ภาพเคลื่อนไหวสั้นๆ แทนข้อความอธิบาย */
.how { margin: 4px -16px 0; padding: 20px 16px 22px; background: linear-gradient(180deg, #ffd3ea 0%, var(--bg) 100%); text-align: center; }
.how h1 { font-size: 28px; font-weight: 600; line-height: 1.35; margin-top: 14px; }
.how p { margin-top: 4px; color: var(--text); font-size: 20px; }
.demo { display: flex; align-items: center; justify-content: center; gap: 14px; }
.demo-card { position: relative; width: 84px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 6px 18px #e6007e26; }
.demo-card i { display: block; height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; }
.demo-card i + i { width: 55%; }
.demo-img { height: 56px; border-radius: 9px; background: linear-gradient(135deg, #ffc2e2, #ffe9f4); }
.demo-heart, .demo-pill { display: grid; place-items: center; }
.demo-heart { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--accent); box-shadow: 0 1px 4px #3a132833; animation: demo-tap 3.2s infinite; }
.demo-heart svg { width: 15px; height: 15px; }
.demo-arrow { color: var(--accent); font-size: 22px; animation: demo-fade 3.2s infinite; }
.demo-pill { grid-auto-flow: column; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 16px #e6007e59; animation: demo-pop 3.2s infinite; }
.demo-pill svg { width: 16px; height: 16px; fill: currentColor; }
@keyframes demo-tap { 0%, 30% { background: #fff; color: var(--accent); transform: scale(1); } 40% { transform: scale(.8); } 50%, 90% { background: var(--accent); color: #fff; transform: scale(1.12); } 100% { background: #fff; color: var(--accent); transform: scale(1); } }
@keyframes demo-fade { 0%, 45% { opacity: 0; } 60%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes demo-pop { 0%, 48% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 66%, 90% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .demo-heart, .demo-arrow, .demo-pill { animation: none; } .demo-heart { background: var(--accent); color: #fff; } }
.cats { margin-top: 14px; }
.cats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; }
.cat-tile { display: grid; justify-items: center; gap: 8px; font-size: 13px; text-align: center; color: var(--text); }
.cat-tile .circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent);
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.cat-tile .circle svg { width: 44px; height: 44px; } /* ไอคอนใหญ่ขึ้น วงกลมยังขนาดเดิม 64px */
.cat-tile.on .circle { background: var(--accent); color: var(--accent-ink); }
.cat-tile.on { color: var(--accent); font-weight: 600; }
#products { scroll-margin-top: calc(var(--topbar-h) + 68px); min-height: 100dvh; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.toolbar select { height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 22px; font-weight: 600; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.soldout .thumb img, .soldout .thumb { opacity: .55; }
.sold-badge { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 2px 9px; border-radius: 999px; background: #000c; color: #fff; font-size: 12px; }
.card .name { margin-top: 8px; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 600; }
.heart {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 38px; height: 38px; border-radius: 50%; background: #fffffff2; color: var(--accent);
  box-shadow: 0 1px 6px #3a132833; font-size: 14px; font-weight: 600;
}
.heart svg { width: 20px; height: 20px; flex: none; }
.heart.on { background: var(--accent); color: var(--accent-ink); }
.heart.on svg { fill: currentColor; }
.heart span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.card .heart { position: absolute; top: 8px; right: 8px; }
.heart[data-long] { width: 100%; height: 48px; border-radius: 14px; border: 1.5px solid var(--accent); box-shadow: none; background: var(--surface); font-size: 16px; }
.heart[data-long].on { background: var(--accent); }
.heart[data-long] span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
.card { position: relative; display: flex; flex-direction: column; }
.card > a { position: relative; display: block; flex: 1; }
.filters { display: grid; gap: 10px; margin-top: 12px; }
.filters:empty { display: none; }
.filter-row > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.link { color: var(--accent); font-size: 14px; text-decoration: underline; min-height: 36px; margin-bottom: 8px; }
.empty-ico { width: 56px; height: 56px; margin: 0 auto; color: var(--accent); }
.empty-ico svg { width: 100%; height: 100%; }

.top-chat { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 3px 8px #3a132833; }
.top-chat svg { width: 24px; height: 24px; }
.top-line { background: var(--line-green); }
.top-fb { background: var(--fb-blue); }
.topbar-actions { align-items: center; }
.tab-circle.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .tab-circle.bump { animation: none; } }
.foot-note { margin: 28px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* หน้าสินค้า */
.product .thumb { border-radius: 18px; font-size: 40px; }
.product h1 { font-size: 20px; font-weight: 600; line-height: 1.35; margin-top: 16px; }
.product .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.product .price { font-size: 24px; }
.status-in { color: #1c8a4b; }
.status-out { color: #c0392b; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: start; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* รายการที่สนใจ */
.list-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item .thumb { width: 64px; border-radius: 10px; font-size: 18px; }
.list-item .name { font-size: 14px; line-height: 1.35; }
.warn { color: #b05e00; font-size: 13px; }
.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 600; margin: 18px 0; }
.remove { min-width: 44px; min-height: 44px; color: var(--muted); font-size: 13px; }

/* รีวิว */
.review { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.review img { border-radius: 10px; margin-bottom: 10px; }
.review .who { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* แผ่นเลื่อนขึ้นจากด้านล่าง */
.sheet { position: fixed; inset: 0; z-index: 40; background: #3b222980; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body {
  width: 100%; max-width: 720px; max-height: 86dvh; overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: var(--surface);
}
.sheet-body h2 { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.sheet-body .btn:not(.btn-line):not(.btn-fb):not(.btn-accent) { background: var(--surface-2); }
.field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 14px; }
.field > span { color: var(--muted); }
.field select, .field input { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); width: 100%; min-width: 0; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); z-index: 50;
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; max-width: 90vw; text-align: center;
}

/* แกลเลอรีรูปหน้าสินค้า */
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.gallery .thumbs::-webkit-scrollbar { display: none; }
.gallery .thumbs button { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .7; padding: 0; }
.gallery .thumbs button.on { border-color: var(--accent); opacity: 1; }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }

.fb-msg { margin: 0; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; max-height: 30vh; overflow-y: auto; }

/* วิดีโอจากร้าน: แถบเลื่อนซ้ายขวาแบบรีล */
.reels { grid-column: 1 / -1; margin: 8px -16px; padding: 12px 0 4px; background: var(--surface-2); }
.reels .section-title { padding: 0 16px; margin-top: 0; }
.reel-row { display: flex; gap: 12px; overflow-x: auto; padding: 4px 16px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.reel-row::-webkit-scrollbar { display: none; }
.reel { position: relative; flex: none; width: 94px; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; scroll-snap-align: start; background: linear-gradient(160deg, #ff7ab8, #e6007e 55%, #7a3df0); color: #fff; box-shadow: 0 4px 12px #3a132833; }
.reel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* คลิปแนวนอน: การ์ดเป็นแนวนอน 16:9 ส่วนคลิปแนวตั้ง (Shorts) ยังเป็นการ์ดแนวตั้ง */
.reel.wide { width: min(299px, calc(100vw - 40px)); height: 168px; aspect-ratio: auto; } /* สูงเท่าการ์ดแนวตั้ง (94×16/9 ≈ 168) กว้างตามสัดส่วน 16:9 */
.reel-row { align-items: center; }
.reel-play { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #0008; display: grid; place-items: center; }
.reel-play svg { width: 26px; height: 26px; }
.reel-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px; font-size: 14px; font-weight: 600; line-height: 1.3; text-align: left; background: linear-gradient(transparent, #000b); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reel.instagram::after { content: 'Instagram'; position: absolute; top: 10px; left: 10px; padding: 2px 9px; border-radius: 999px; background: #0007; font-size: 12px; }
.player { margin: 0 auto; border-radius: 14px; overflow: hidden; background: #000; }
.player iframe { display: block; width: 100%; height: 100%; border: 0; }
.player.wide { aspect-ratio: 16 / 9; background: var(--surface-2); }
.player.short { aspect-ratio: 9 / 16; max-height: 68dvh; }
.player.ig { height: min(640px, 70dvh); background: #fff; }

/* หน้าโชว์รูมเรียงแบบ Shopee: ช่องค้นหาติดบนสุด → รายการโปรด → วิดีโอ → สินค้า */
.searchbar { position: sticky; top: var(--topbar-h); z-index: 15; margin: 0 -16px; padding: 4px 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); }
.searchbox { position: relative; }
.searchbox .search { height: 52px; padding: 0 18px 0 48px; border-radius: 26px; font-size: 17px; border: 2px solid var(--accent); }
.search-ico { position: absolute; left: 16px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--accent); pointer-events: none; }
.search-ico svg { width: 100%; height: 100%; }
.favrow { margin: 0 -16px; padding: 10px 16px 12px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; background: linear-gradient(180deg, #ffd3ea 0%, var(--bg) 100%); }
.fav-card { display: grid; gap: 2px; justify-items: start; padding: 11px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px #e6007e26; color: var(--text); }
.fav-ico { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--accent); color: #fff; margin-bottom: 2px; }
.fav-ico svg { width: 17px; height: 17px; fill: currentColor; }
.fav-title { font-size: 16px; }
.fav-count { font-size: 14px; color: var(--accent); font-weight: 600; }
.fav-count #favCount { font-size: 22px; font-weight: 700; }
.fav-how { text-align: center; }
.fav-rv { display: none; }
.fav-sub { font-size: 14px; color: var(--muted); }
.fav-how .demo { transform: scale(.55); transform-origin: center bottom; margin: -18px 0 -3px; }
.fav-how p { margin-top: 2px; font-size: 14px; line-height: 1.3; }
.fav-how p b { font-size: 16px; }
.reels { grid-column: auto; }

/* ลดขนาดแถบวิดีโอลงประมาณ 30% */
.reels { margin: 4px -16px; padding: 6px 0 0; }
.reels .section-title { font-size: 14px; margin-bottom: 4px; }
.reel-row { gap: 7px; padding: 2px 16px 6px; }
.reel { border-radius: 12px; }
.reel-title { padding: 16px 6px 6px; font-size: 11px; -webkit-line-clamp: 2; }
.reel-play { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.reel-play svg { width: 15px; height: 15px; }

/* แถบเลือกตามหมวดหมู่: แถบสีชมพูเต็มความกว้างให้เด่นขึ้น */
.catband { margin: 20px -16px 0; padding: 14px 16px 18px; background: linear-gradient(135deg, #ff7ab8 0%, var(--accent) 100%); color: #fff; }
.catband .section-title { margin: 0 0 12px; color: #fff; font-size: 17px; }
.catband .cat-tile { color: #fff; }
.catband .cat-tile .circle { background: #fff; color: var(--accent); }
.catband .cat-tile.on { color: #fff; font-weight: 700; }
.catband .cat-tile.on .circle { background: #fff; color: var(--accent); box-shadow: 0 0 0 4px #ffffff8c; }

/* รายการแนะนำใต้ช่องค้นหา: แสดง 5 แถว ถ้ามีมากกว่านั้นเลื่อนดูได้ ถ้าน้อยกว่ากล่องสั้นลงตามจำนวน */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 28px #3a132833; }
.suggest-row { display: flex; align-items: center; height: 52px; border-bottom: 1px solid var(--line); }
.suggest-row:last-child { border-bottom: 0; }
.suggest-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 4px 0 16px; text-align: left; font-size: 17px; color: var(--text); }
.suggest-ico { flex: none; width: 20px; height: 20px; color: var(--muted); }
.suggest-ico svg { width: 100%; height: 100%; }
.suggest-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-text b { color: var(--accent); }
.suggest-fill { flex: none; width: 52px; height: 100%; display: grid; place-items: center; color: var(--accent); }
.suggest-fill svg { width: 22px; height: 22px; }

/* หน้ารีวิวแบบ Shopee */
.rv-sum { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.rv-score b { font-size: 34px; font-weight: 700; }
.rv-score small { font-size: 18px; color: var(--muted); }
.rv-stars { display: inline-flex; gap: 2px; color: #ffb400; }
.rv-stars svg { width: 22px; height: 22px; }
.rv-count { margin-left: auto; font-size: 15px; color: var(--muted); }
.rv-chips { display: flex; gap: 8px; margin: 12px 0 0; }
.rv-strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.rv-strip::-webkit-scrollbar { display: none; }
.rv-thumb { position: relative; flex: none; width: 130px; height: 130px; border-radius: 14px; overflow: hidden; background: var(--surface-2); scroll-snap-align: start; }
.rv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rv-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; color: #fff; font-size: 13px; font-weight: 600; text-align: left; background: linear-gradient(transparent, #000a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-list { margin-top: 16px; }
.rv-card { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.rv-head { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.rv-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 18px; }
.rv-card p { font-size: 17px; line-height: 1.5; }
.rv-photo { width: 100%; border-radius: 14px; }

/* ===== เวอร์ชันคอมพิวเตอร์ (จอกว้าง 900 พิกเซลขึ้นไป) มือถือและแท็บเล็ตยังใช้แบบเดิม ===== */
@media (min-width: 900px) {
  .topbar { padding-inline: max(16px, calc((100vw - 1100px) / 2 + 16px)); }
  #view { max-width: 1100px; }
  .searchbox { max-width: none; }
  .searchbar { border-radius: 0 0 16px 16px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
  .cat-tiles { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .fav-rv { display: grid; }
  .favrow { grid-template-columns: 240px 240px 1fr; gap: 24px; align-items: stretch; padding: 22px 28px; border-radius: 0 0 20px 20px; }
  .fav-how { align-self: center; }
  .fav-how .demo { transform: scale(.85); margin: -10px 0 0; }
  .fav-how p { font-size: 18px; }
  .fav-how p b { font-size: 21px; }
  .reels { padding: 12px 0 4px; border-radius: 16px; }
  .reels .section-title { font-size: 17px; padding: 0 28px; }
  .reel-row { padding: 4px 28px 14px; gap: 14px; }
  .reel { width: 140px; }
  .reel.wide { width: 443px; height: 249px; }
  .reel-title { font-size: 14px; }
  .catband { border-radius: 16px; padding: 18px 28px 22px; }
  .tabbar { display: none; }
  #view { padding-bottom: 48px; }
  .sheet { align-items: center; }
  .sheet-body { max-width: 560px; border-radius: 22px; }
  .product { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 0 40px; align-items: start; }
  .product .gallery { grid-column: 1; grid-row: 1 / span 14; position: sticky; top: 140px; }
  .product > :not(.gallery) { grid-column: 2; }
  .product > .sim, .product > .grid { grid-column: 1 / -1; }
  .rv-sum, .rv-chips, .rv-list { max-width: 760px; margin-left: auto; margin-right: auto; }
  .rv-photo { max-width: 420px; }
  #view > .page-title, #view > .list-item, #view > .total, #view > .stack, #view > .muted, #view > .empty { max-width: 760px; margin-left: auto; margin-right: auto; }
  #view > .list-item { display: grid; }
  /* หน้ารีวิว: ชิดซ้ายตามขอบคอลัมน์ (หน้ารายการโปรดอยู่กึ่งกลางตามเดิม) */
  #view[data-page="reviews"] :is(.page-title, .rv-sum, .rv-chips, .rv-list) { margin-left: 0; margin-right: auto; }
}


/* ป๊อปอัพเล็กซ้ายล่างตอนคัดลอกข้อความ Messenger: อยู่ 3 วินาทีแล้วจางหาย ไม่ต้องกดปิด */
.copytoast { position: fixed; left: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); z-index: 50; width: max-content; max-width: min(320px, calc(100vw - 24px)); display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px #3a132833; font-size: 15px; pointer-events: none; transition: opacity .4s, transform .4s; animation: copytoast-in .25s ease; }
.copytoast b { color: var(--accent); font-size: 16px; }
.copytoast-msg { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.copytoast.hide { opacity: 0; transform: translateY(6px); }
@keyframes copytoast-in { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .copytoast { bottom: 24px; } }

.copytoast.manual { pointer-events: auto; user-select: text; -webkit-user-select: text; }
.copytoast-open { display: block; text-align: center; padding: 10px; border-radius: 12px; background: var(--fb-blue); color: #fff; font-weight: 700; }

/* ปุ่มกลับ */
.backrow { margin: 6px 0 4px; }
.backbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 18px 0 10px; border-radius: 999px; border: 2px solid var(--line); background: #fff; color: var(--text); font: 600 17px inherit; cursor: pointer; }
.backbtn svg { width: 22px; height: 22px; color: var(--accent); }
.backbtn:active { background: var(--surface-2); }
