/*
Theme Name: Khaidee
Theme URI: https://af.khaidee.org/
Author: Khaidee
Description: ธีมเว็บ Affiliate สไตล์ Apple สำหรับ ChobHub (ชอบฮับ) — รวมของที่คนชอบจาก Shopee พร้อมราคาย้อนหลัง
Version: 2.0.0
Requires at least: 6.5
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: khaidee
*/

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--bg: #ffffff;
	--bg-alt: #f5f5f7;
	--bg-elev: #ffffff;
	--bg-glass: rgba(255, 255, 255, .78);
	--text: #1d1d1f;
	--text-2: #6e6e73;
	--text-3: #86868b;
	--line: rgba(0, 0, 0, .08);
	--line-2: rgba(0, 0, 0, .14);
	--blue: #0071e3;
	--blue-2: #0077ed;
	--link: #0066cc;
	--buy: #ee4d2d;
	--buy-2: #f05d38;
	--green: #1a8c3a;
	--green-bg: #e9f7ee;
	--red: #d70015;
	--red-bg: #fdeced;
	--orange: #c45500;
	--orange-bg: #fff2e5;
	--gold: #f5a623;
	--dark: #000000;
	--dark-2: #1d1d1f;
	--shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .04);
	--shadow-2: 0 4px 12px rgba(0, 0, 0, .06), 0 20px 48px rgba(0, 0, 0, .10);
	--r-xl: 32px;
	--r-lg: 24px;
	--r: 18px;
	--r-sm: 12px;
	--max: 1200px;
	--max-text: 720px;
	--gutter: clamp(16px, 4vw, 32px);
	--nav-h: 52px;
	--ease: cubic-bezier(.25, .1, .25, 1);
	--spring: cubic-bezier(.32, .72, 0, 1);
	--font: "Inter", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #000000;
		--bg-alt: #0f0f10;
		--bg-elev: #1c1c1e;
		--bg-glass: rgba(22, 22, 23, .78);
		--text: #f5f5f7;
		--text-2: #a1a1a6;
		--text-3: #86868b;
		--line: rgba(255, 255, 255, .1);
		--line-2: rgba(255, 255, 255, .18);
		--blue: #2997ff;
		--blue-2: #47a6ff;
		--link: #2997ff;
		--green: #30d158;
		--green-bg: rgba(48, 209, 88, .14);
		--red: #ff453a;
		--red-bg: rgba(255, 69, 58, .15);
		--orange: #ff9f0a;
		--orange-bg: rgba(255, 159, 10, .15);
		--shadow-1: 0 0 0 1px rgba(255, 255, 255, .06);
		--shadow-2: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 48px rgba(0, 0, 0, .5);
		color-scheme: dark;
	}
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	letter-spacing: -.01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.22; letter-spacing: -.022em; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 1000; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--bg); }
.skip-link:focus { top: 12px; }
.icon { flex: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--text { max-width: calc(var(--max-text) + 2 * var(--gutter)); }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }

.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--orange); display: inline-flex; align-items: center; gap: 6px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: clamp(24px, 3vw, 36px); flex-wrap: wrap; }
.section-title { font-size: clamp(28px, 4vw, 44px); }
.section-head__side { display: flex; align-items: center; gap: 16px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; font-weight: 500; white-space: nowrap; }
.lede { font-size: clamp(18px, 2vw, 21px); color: var(--text-2); line-height: 1.55; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--spring); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* Above-the-fold intro: CSS only, so it never waits for JavaScript */
.intro { animation: rise .9s var(--spring) both; }
.intro:nth-child(2) { animation-delay: .06s; }
.intro:nth-child(3) { animation-delay: .12s; }
.intro:nth-child(4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intro { animation: none; } }

/* ==========================================================================
   Buttons, chips, badges
   ========================================================================== */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 22px;
	border: 0; border-radius: 999px;
	background: var(--blue); color: #fff;
	font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2;
	cursor: pointer; text-decoration: none !important;
	transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { background: var(--blue-2); }
.btn:active { transform: scale(.97); }
.btn--buy { background: linear-gradient(180deg, var(--buy-2), var(--buy)); box-shadow: 0 6px 16px -6px rgba(238, 77, 45, .6); }
.btn--buy:hover { background: linear-gradient(180deg, #f36a47, #f05030); box-shadow: 0 10px 22px -8px rgba(238, 77, 45, .7); }
.btn--ghost { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--ghost:hover { background: var(--bg-alt); }
.btn--dark { background: var(--text); color: var(--bg); }
.btn--dark:hover { background: var(--text); opacity: .86; }
.btn--lg { min-height: 56px; padding: 14px 32px; font-size: 18px; }
.btn--block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; background: var(--bg-alt); color: var(--text-2); }
.chip--green { background: var(--green-bg); color: var(--green); }
.chip--red { background: var(--red-bg); color: var(--red); }
.chip--orange { background: var(--orange-bg); color: var(--orange); }
.mall { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 5px; background: #d0011b; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; }

.stars { position: relative; display: inline-block; line-height: 0; color: var(--line-2); vertical-align: -2px; }
.stars__base, .stars__fill { display: flex; gap: 1px; }
.stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--gold); }
.stars .icon { stroke-width: 0; }

/* ==========================================================================
   Ribbon + navigation
   ========================================================================== */

.ribbon { background: var(--bg-alt); text-align: center; font-size: 14px; padding: 10px var(--gutter); color: var(--text-2); }
.ribbon a { font-weight: 500; }
.ribbon strong { color: var(--text); font-weight: 600; }

.site-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--bg-glass);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.nav { display: flex; align-items: center; gap: 24px; height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: -.03em; text-decoration: none !important; flex: none; }
.brand__mark {
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
	background: linear-gradient(135deg, #ff7a45 0%, #ee4d2d 45%, #c81d6b 100%);
	color: #fff; font-size: 17px; font-weight: 800; letter-spacing: 0;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 6px rgba(238, 77, 45, .35);
}
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.nav__menu { flex: 1; min-width: 0; }
.nav__list { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav__list a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--text); font-size: 14px; opacity: .82; white-space: nowrap; text-decoration: none; transition: opacity .2s, background .2s; }
.nav__list a:hover, .nav__list [aria-current="page"], .nav__list .current-menu-item > a { opacity: 1; background: var(--bg-alt); }
.nav__list .sub-menu { display: none; }
.nav__tools { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; transition: background .2s; }
.icon-btn:hover { background: var(--bg-alt); }
.nav__toggle { display: none; }

.search-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); padding: 20px 0 28px; display: none; }
.search-panel.is-open { display: block; animation: drop .35s var(--spring); }
.search-panel__hint { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }
.search-panel__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
	.nav { gap: 8px; }
	.nav__toggle { display: inline-grid; }
	.nav__menu {
		position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
		background: var(--bg); padding: 16px var(--gutter) 40px; overflow-y: auto;
		opacity: 0; visibility: hidden; transform: translateY(-8px);
		transition: opacity .3s var(--ease), transform .3s var(--spring), visibility .3s;
	}
	.admin-bar .nav__menu { top: calc(var(--nav-h) + 46px); }
	.nav-open .nav__menu { opacity: 1; visibility: visible; transform: none; }
	.nav-open { overflow: hidden; }
	.nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.nav__list a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 22px; font-weight: 600; opacity: 1; }
	.nav__list a:hover { background: none; }
	.brand { margin-right: auto; }
}

/* ==========================================================================
   Search field
   ========================================================================== */

.searchbox { position: relative; display: flex; align-items: center; width: 100%; max-width: 640px; margin: 0 auto; background: var(--bg-elev); border-radius: 999px; box-shadow: 0 0 0 1px var(--line-2), 0 10px 30px -12px rgba(0, 0, 0, .18); transition: box-shadow .2s; }
.searchbox:focus-within { box-shadow: 0 0 0 2px var(--blue), 0 10px 30px -12px rgba(0, 113, 227, .35); }
.searchbox .icon { position: absolute; left: 20px; color: var(--text-3); pointer-events: none; }
.searchbox input { flex: 1; min-width: 0; height: 60px; padding: 0 12px 0 52px; border: 0; background: transparent; font-size: 17px; outline: none; }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox .btn { margin: 6px; min-height: 48px; padding: 10px 24px; }
.search-error { max-width: 640px; margin: 14px auto 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--red-bg); color: var(--red); font-size: 15px; text-align: left; }
@media (max-width: 520px) {
	.searchbox input { height: 54px; font-size: 16px; padding-left: 46px; }
	.searchbox .icon { left: 16px; }
	.searchbox .btn { padding: 8px 16px; min-height: 42px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 8vw, 88px); text-align: center; isolation: isolate; }
.hero::before {
	content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
	background:
		radial-gradient(40% 50% at 18% 30%, rgba(255, 122, 69, .18), transparent 70%),
		radial-gradient(35% 45% at 82% 25%, rgba(0, 113, 227, .14), transparent 70%),
		radial-gradient(40% 40% at 50% 90%, rgba(200, 29, 107, .10), transparent 70%);
	filter: blur(10px);
}
.hero__badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--bg-elev); box-shadow: 0 0 0 1px var(--line); font-size: 14px; color: var(--text-2); }
.hero__badge b { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--orange-bg); color: var(--orange); font-weight: 600; }
.hero__title { font-size: clamp(42px, 7.4vw, 88px); line-height: 1.12; letter-spacing: -.04em; font-weight: 800; margin: 0 auto 20px; max-width: 14ch; }
.gradient-text { background: linear-gradient(100deg, #ff7a45 0%, #ee4d2d 35%, #c81d6b 70%, #7b3ff2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { max-width: 34em; margin: 0 auto 32px; }
.hero__quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; font-size: 14px; color: var(--text-3); }
.hero__quick a { padding: 5px 12px; border-radius: 999px; background: var(--bg-elev); box-shadow: 0 0 0 1px var(--line); color: var(--text); text-decoration: none; transition: box-shadow .2s, transform .2s; }
.hero__quick a:hover { box-shadow: 0 0 0 1px var(--line-2), var(--shadow-1); transform: translateY(-1px); }

.hero__stage { position: relative; height: 300px; max-width: 900px; margin: 56px auto 0; perspective: 1200px; }
.float-card {
	position: absolute; top: 0; width: 250px; padding: 12px; border-radius: var(--r-lg);
	background: var(--bg-elev); box-shadow: var(--shadow-2); text-align: left;
	color: var(--text); text-decoration: none !important;
	transition: transform .6s var(--spring);
	animation: bob 6s ease-in-out infinite;
}
.float-card:nth-child(1) { left: 4%; top: 40px; transform: rotate(-6deg); animation-delay: -1s; }
.float-card:nth-child(2) { left: 50%; margin-left: -125px; z-index: 2; animation-delay: -3s; }
.float-card:nth-child(3) { right: 4%; top: 40px; transform: rotate(6deg); animation-delay: -5s; }
.float-card:hover { transform: translateY(-8px) rotate(0); }
.float-card__media { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--bg-alt); }
.float-card__media img { width: 100%; height: 100%; object-fit: contain; }
.float-card__title { margin: 10px 4px 4px; font-size: 14px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.float-card__price { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 2px; }
.float-card__price strong { font-size: 20px; letter-spacing: -.02em; }
.float-card__price del { font-size: 13px; color: var(--text-3); }
.float-card .pcard__off { top: 8px; left: 8px; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } }
@media (max-width: 760px) {
	.hero__stage { height: 250px; margin-top: 40px; }
	.float-card { width: 200px; }
	.float-card:nth-child(1) { left: -30px; }
	.float-card:nth-child(2) { margin-left: -100px; }
	.float-card:nth-child(3) { right: -30px; }
}

/* ==========================================================================
   Trust strip
   ========================================================================== */

.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.trust__item { display: flex; gap: 14px; align-items: flex-start; padding: 22px; background: var(--bg-elev); }
.trust__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg-alt); color: var(--blue); flex: none; }
.trust__item strong { display: block; font-size: 15px; line-height: 1.35; }
.trust__item span { font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
@media (max-width: 900px) { .trust { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .trust__item { padding: 16px; gap: 10px; } .trust__icon { width: 34px; height: 34px; } }

/* ==========================================================================
   Countdown
   ========================================================================== */

.countdown { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.countdown__units { display: inline-flex; gap: 4px; font-family: "Inter", sans-serif; font-variant-numeric: tabular-nums; }
.countdown__units span { min-width: 34px; padding: 5px 0; border-radius: 8px; background: var(--text); color: var(--bg); text-align: center; font-weight: 700; font-size: 15px; }
.countdown__units i { font-style: normal; font-weight: 700; color: var(--text); align-self: center; }

/* ==========================================================================
   Product card
   ========================================================================== */

.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1080px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.pcard {
	position: relative; display: flex; flex-direction: column; min-width: 0; height: 100%;
	border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1);
	overflow: hidden; transition: transform .45s var(--spring), box-shadow .45s var(--spring);
}
.section--alt .pcard, .bg-alt .pcard { box-shadow: none; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.pcard__media { position: relative; display: block; aspect-ratio: 1 / 1; margin: 8px 8px 0; border-radius: 18px; overflow: hidden; background: var(--bg-alt); }
.section--alt .pcard__media { background: #f7f7f9; }
@media (prefers-color-scheme: dark) { .section--alt .pcard__media { background: #2c2c2e; } }
.pcard__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--spring); }
.pcard:hover .pcard__media img, .pcard:hover .media-fallback span { transform: scale(1.06); }
.pcard__off { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 4px 9px; border-radius: 999px; background: var(--buy); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: -.01em; box-shadow: 0 4px 10px -4px rgba(238, 77, 45, .7); }
.pcard__rank { position: absolute; bottom: 10px; left: 10px; z-index: 1; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 12px; background: var(--text); color: var(--bg); font-family: "Inter", sans-serif; font-weight: 800; font-size: 17px; }
.pcard__body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px 16px; }
.pcard__shop { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; color: var(--text-3); }
.pcard__shop span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__title { font-size: 15.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.pcard__title a { color: var(--text); }
.pcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.pcard__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.pcard__meta .dot::before { content: "·"; margin-right: 6px; color: var(--text-3); }
.pcard__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pcard__price strong { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-family: "Inter", "Noto Sans Thai", sans-serif; }
.pcard__price del { font-size: 13px; color: var(--text-3); }
.pcard__chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.pcard__chips:empty { display: none; }
.pcard__cta { position: relative; z-index: 1; margin-top: auto; min-height: 42px; font-size: 15px; }
.pcard__body > .pcard__cta { margin-top: auto; }
.pcard__chips + .pcard__cta, .pcard__price + .pcard__chips:empty + .pcard__cta { margin-top: 10px; }
@media (max-width: 520px) {
	.pcard__body { padding: 10px 12px 12px; gap: 4px; }
	.pcard__title { font-size: 14px; }
	.pcard__price strong { font-size: 18px; }
	.pcard__cta { min-height: 38px; font-size: 13.5px; padding: 8px 10px; gap: 4px; }
	.pcard__cta .icon { width: 15px; height: 15px; }
	.pcard__meta .stars { display: none; }
}

.media-fallback { display: grid; place-items: center; width: 100%; height: 100%; background: radial-gradient(70% 70% at 30% 25%, hsl(var(--h) 90% 92%), hsl(calc(var(--h) + 30) 70% 86%)); }
.media-fallback span { font-size: clamp(48px, 9vw, 84px); filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .14)); transition: transform .6s var(--spring); }
.media-fallback--lg span { font-size: clamp(96px, 16vw, 160px); }
@media (prefers-color-scheme: dark) { .media-fallback { background: radial-gradient(70% 70% at 30% 25%, hsl(var(--h) 40% 26%), hsl(calc(var(--h) + 30) 35% 16%)); } }

/* Row variant (inline in articles) */
.pcard--row { flex-direction: row; align-items: center; }
.pcard--row .pcard__media { width: 160px; flex: none; margin: 8px; }

/* Scroller */
.scroller { position: relative; }
.scroller__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4.3); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); padding: 4px var(--gutter) 24px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; overscroll-behavior-x: contain; }
.scroller__track::-webkit-scrollbar { display: none; }
.scroller__item { scroll-snap-align: start; min-width: 0; }
.scroller__btn { position: absolute; top: 38%; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--bg-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-2); color: var(--text); cursor: pointer; transition: opacity .2s, transform .2s; }
.scroller__btn:hover { transform: scale(1.06); }
.scroller__btn[disabled] { opacity: 0; pointer-events: none; }
.scroller__btn--prev { left: -12px; }
.scroller__btn--next { right: -12px; }
@media (max-width: 1080px) { .scroller__track { grid-auto-columns: calc((100% - 2 * 20px) / 3.2); } }
@media (max-width: 760px) { .scroller__track { grid-auto-columns: 62%; gap: 12px; } .scroller__btn { display: none; } }

/* ==========================================================================
   Category tiles
   ========================================================================== */

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile {
	position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
	min-height: 168px; padding: 22px; border-radius: var(--r-lg); overflow: hidden;
	background: linear-gradient(160deg, hsl(var(--h) 85% 96%), hsl(calc(var(--h) + 25) 70% 90%));
	color: #1d1d1f; text-decoration: none !important; isolation: isolate;
	transition: transform .45s var(--spring), box-shadow .45s var(--spring);
}
.cat-tile:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-2); }
.cat-tile .cat-tile__emoji { position: absolute; right: -6px; bottom: -14px; z-index: -1; font-size: 96px; line-height: 1; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .15)); transition: transform .6s var(--spring); }
.cat-tile:hover .cat-tile__emoji { transform: rotate(-8deg) scale(1.08); }
.cat-tile .cat-tile__go { color: inherit; }
.cat-tile strong { font-size: 20px; letter-spacing: -.02em; }
.cat-tile span { font-size: 13.5px; color: rgba(29, 29, 31, .62); }
.cat-tile__go { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: rgba(255, 255, 255, .7); }
@media (prefers-color-scheme: dark) {
	.cat-tile { background: linear-gradient(160deg, hsl(var(--h) 35% 22%), hsl(calc(var(--h) + 25) 30% 14%)); color: #f5f5f7; }
	.cat-tile span { color: rgba(245, 245, 247, .62); }
	.cat-tile__go { background: rgba(255, 255, 255, .12); }
}
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .cat-tile { min-height: 132px; padding: 18px; } .cat-tile .cat-tile__emoji { font-size: 72px; } .cat-tile strong { font-size: 17px; } }

/* ==========================================================================
   Bento
   ========================================================================== */

.bento { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.bento__tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; min-height: 240px; padding: clamp(24px, 3vw, 36px); border-radius: var(--r-xl); overflow: hidden; color: var(--text); background: var(--bg-elev); box-shadow: var(--shadow-1); text-decoration: none !important; isolation: isolate; transition: transform .5s var(--spring); }
.bento__tile:hover { transform: scale(1.01); }
.bento__tile h3 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.bento__tile p { margin: 0; color: var(--text-2); max-width: 28em; }
.bento__tile .more { margin-top: 6px; color: var(--link); }
.bento__tile--hero { grid-row: span 2; min-height: 500px; background: #000; color: #f5f5f7; }
.bento__tile--hero p { color: #a1a1a6; }
.bento__tile--hero .more { color: #2997ff; }
.bento__tile--hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 70% 25%, rgba(48, 209, 88, .35), transparent 70%), radial-gradient(50% 40% at 20% 10%, rgba(41, 151, 255, .3), transparent 70%); }
.bento__big { font-family: "Inter", sans-serif; font-size: clamp(64px, 9vw, 120px); font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, #fff, #30d158); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: auto; }
.bento__icon { position: absolute; top: clamp(24px, 3vw, 36px); left: clamp(24px, 3vw, 36px); display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; color: #fff; }
.bento__tile--budget { background: linear-gradient(150deg, #fff4e8, #ffe1cc); }
.bento__tile--budget .bento__icon { background: linear-gradient(135deg, #ff9f0a, #ff6a00); }
.bento__tile--guide { background: linear-gradient(150deg, #eef4ff, #dfe9ff); }
.bento__tile--guide .bento__icon { background: linear-gradient(135deg, #2997ff, #5e5ce6); }
.bento__tile--budget, .bento__tile--guide { color: #1d1d1f; }
.bento__tile--budget p, .bento__tile--guide p { color: #515154; }
@media (prefers-color-scheme: dark) {
	.bento__tile--budget { background: linear-gradient(150deg, #2a1d10, #3a230e); color: #f5f5f7; }
	.bento__tile--guide { background: linear-gradient(150deg, #0f1a2e, #16234a); color: #f5f5f7; }
	.bento__tile--budget p, .bento__tile--guide p { color: #a1a1a6; }
}
@media (max-width: 860px) { .bento { grid-template-columns: 1fr; } .bento__tile--hero { grid-row: auto; min-height: 380px; } .bento__tile { min-height: 210px; } }

/* ==========================================================================
   Tabs / segmented / pills
   ========================================================================== */

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }
.section--alt .segmented { background: var(--bg-elev); }
.segmented__item, .segmented button { padding: 7px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .25s var(--ease), color .25s, box-shadow .25s; }
.segmented__item:hover, .segmented button:hover { color: var(--text); }
.segmented .is-active, .segmented [aria-selected="true"] { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px var(--line); }
.section--alt .segmented .is-active, .section--alt .segmented [aria-selected="true"] { background: var(--text); color: var(--bg); }
.tabpanel[hidden] { display: none; }
.tabpanel { animation: fade .45s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pills { margin: 0 calc(-1 * var(--gutter)); overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills__track { display: flex; gap: 8px; padding: 2px var(--gutter); width: max-content; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--bg-elev); box-shadow: 0 0 0 1px var(--line-2); color: var(--text); font-size: 14.5px; font-weight: 500; white-space: nowrap; text-decoration: none !important; transition: background .2s, box-shadow .2s; }
.pill:hover { box-shadow: 0 0 0 1px var(--text-3); }
.pill.is-active { background: var(--text); color: var(--bg); box-shadow: none; }

/* ==========================================================================
   Steps
   ========================================================================== */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 28px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.step__num { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; border-radius: 14px; background: var(--bg-alt); color: var(--blue); }
.step h3 { font-size: 20px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.step::after { counter-increment: step; content: "0" counter(step); position: absolute; top: 22px; right: 26px; font-family: "Inter", sans-serif; font-size: 44px; font-weight: 800; letter-spacing: -.04em; color: var(--line); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ==========================================================================
   Post cards / magazine
   ========================================================================== */

.mag { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
.mag__side { display: grid; gap: 20px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 960px) { .mag { grid-template-columns: 1fr; } .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.post-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1); overflow: hidden; transition: transform .45s var(--spring), box-shadow .45s var(--spring); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--spring); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__body { padding: 18px 20px 22px; }
.post-card__kicker { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--orange); }
.post-card__title { font-size: 19px; line-height: 1.38; letter-spacing: -.015em; }
.post-card__title a { color: var(--text); }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card__excerpt { margin: 8px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card--lg .post-card__media { aspect-ratio: 16 / 10; }
.post-card--lg .post-card__title { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.025em; }
.post-card--sm { flex-direction: row; align-items: stretch; }
.post-card--sm .post-card__media { width: 38%; aspect-ratio: auto; flex: none; }
.post-card--sm .post-card__body { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.post-card--sm .post-card__title { font-size: 16.5px; }

.post-cover { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; width: 100%; height: 100%; padding: 22px; background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 45) 75% 45%)); color: #fff; overflow: hidden; }
.post-cover::before { content: ""; position: absolute; width: 70%; aspect-ratio: 1; right: -18%; top: -30%; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.post-cover::after { content: ""; position: absolute; width: 40%; aspect-ratio: 1; right: 18%; top: 30%; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.post-cover__icon { position: relative; z-index: 1; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.post-cover__title { position: relative; z-index: 1; font-size: clamp(18px, 2.2vw, 24px); font-weight: 700; letter-spacing: -.02em; line-height: 1.3; text-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.post-card--sm .post-cover { padding: 14px; }
.post-card--sm .post-cover__title { display: none; }
.post-card--sm .post-cover__icon { width: 40px; height: 40px; border-radius: 12px; margin: auto; }

/* ==========================================================================
   Page headers (archives, blog, search)
   ========================================================================== */

.page-hero { position: relative; padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 40px); overflow: hidden; isolation: isolate; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 85% 0%, hsl(var(--h, 20) 90% 92% / .9), transparent 70%); }
@media (prefers-color-scheme: dark) { .page-hero::before { background: radial-gradient(50% 80% at 85% 0%, hsl(var(--h, 20) 50% 20% / .7), transparent 70%); } }
.page-hero__row { display: flex; align-items: center; gap: 20px; }
.page-hero__emoji { display: grid; place-items: center; width: 72px; height: 72px; flex: none; border-radius: 22px; font-size: 40px; background: linear-gradient(160deg, hsl(var(--h, 20) 85% 96%), hsl(calc(var(--h, 20) + 25) 70% 88%)); box-shadow: var(--shadow-1); }
.page-hero h1 { font-size: clamp(34px, 5.4vw, 60px); letter-spacing: -.035em; }
.page-hero .lede { margin: 12px 0 0; max-width: 40em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 20px 0 28px; }
.toolbar__count { font-size: 14px; color: var(--text-2); }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--text-3); }
.crumbs li + li::before { content: "›"; margin-right: 4px; color: var(--text-3); }
.crumbs a { color: var(--text-2); }
.crumbs span { color: var(--text-3); display: inline-block; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 48px; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; background: var(--bg-elev); box-shadow: 0 0 0 1px var(--line); color: var(--text); font-weight: 500; text-decoration: none; }
.pagination .page-numbers:hover { box-shadow: 0 0 0 1px var(--text-3); }
.pagination .current { background: var(--text); color: var(--bg); box-shadow: none; }
.pagination .dots { box-shadow: none; background: none; }

.empty { padding: 64px 24px; border-radius: var(--r-xl); background: var(--bg-alt); text-align: center; }
.empty__icon { display: inline-grid; place-items: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 22px; background: var(--bg-elev); color: var(--text-3); box-shadow: var(--shadow-1); }
.empty h2 { font-size: 26px; margin-bottom: 8px; }
.empty p { color: var(--text-2); max-width: 30em; margin: 0 auto 20px; }

/* ==========================================================================
   Product page
   ========================================================================== */

.subnav { position: sticky; top: var(--nav-h); z-index: 90; background: var(--bg-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); transform: translateY(-100%); opacity: 0; pointer-events: none; transition: transform .4s var(--spring), opacity .3s; }
.admin-bar .subnav { top: calc(var(--nav-h) + 32px); }
.subnav.is-visible { transform: none; opacity: 1; pointer-events: auto; }
.subnav__inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.subnav__title { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subnav__links { display: flex; gap: 20px; font-size: 13px; }
.subnav__links a { color: var(--text-2); }
.subnav__price { font-weight: 700; font-size: 17px; }
.subnav .btn { min-height: 34px; padding: 6px 16px; font-size: 13.5px; }
@media (max-width: 900px) { .subnav { display: none; } }

.product { padding: 20px 0 clamp(48px, 7vw, 88px); }
.product__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; margin-top: 20px; }
.product__media { position: sticky; top: calc(var(--nav-h) + 24px); }
.admin-bar .product__media { top: calc(var(--nav-h) + 56px); }
.product__frame { position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-xl); background: var(--bg-alt); overflow: hidden; }
.product__frame img { width: 100%; height: 100%; object-fit: contain; }
.product__frame .pcard__off { top: 20px; left: 20px; padding: 6px 14px; font-size: 17px; }
.product__thumbs { display: flex; gap: 10px; justify-content: center; margin-top: 14px; font-size: 13px; color: var(--text-3); }
.product__info { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.product__shop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-2); }
.product__shop .icon { color: var(--blue); }
.product__title { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -.03em; line-height: 1.2; }
.product__rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: var(--text-2); }
.product__rating .stars { transform: scale(1.15); transform-origin: left center; margin-right: 8px; }
.product__rating b { color: var(--text); }

.pricebox { padding: 22px 24px; border-radius: var(--r-lg); background: var(--bg-alt); }
.pricebox__row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pricebox__price { font-family: "Inter", "Noto Sans Thai", sans-serif; font-size: clamp(40px, 5vw, 56px); font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.pricebox del { font-size: 18px; color: var(--text-3); }
.pricebox__save { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14.5px; color: var(--green); font-weight: 600; }
.pricebox__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pricebox__chips:empty { display: none; }

.verdict { padding: 18px 20px; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); }
.verdict__head { display: flex; gap: 12px; align-items: flex-start; }
.verdict__head p { margin: 2px 0 0; font-size: 14.5px; color: var(--text-2); }
.verdict__head strong { font-size: 16.5px; }
.verdict__icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--bg-alt); color: var(--text-2); }
.verdict--good .verdict__icon { background: var(--green-bg); color: var(--green); }
.verdict--bad .verdict__icon { background: var(--red-bg); color: var(--red); }
.meter { margin-top: 16px; }
.meter__bar { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #30d158, #ffd60a 55%, #ff453a); }
.meter__avg { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px; background: var(--text-3); }
.meter__now { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--bg-elev); box-shadow: 0 0 0 3px var(--text), 0 4px 10px rgba(0, 0, 0, .2); }
.meter__legend { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }

.buy { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.buy .btn--buy { min-height: 58px; font-size: 18px; border-radius: 18px; }
.buy .icon-btn { width: 58px; height: 58px; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.assure { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14.5px; color: var(--text-2); }
.assure li { display: flex; align-items: center; gap: 10px; }
.assure .icon { color: var(--green); }
.toast { position: fixed; left: 50%; bottom: 96px; z-index: 300; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s var(--spring); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
	.product__grid { grid-template-columns: 1fr; gap: 20px; }
	.product__media { position: static; }
	.product__frame { aspect-ratio: auto; height: min(46vh, 360px); border-radius: var(--r-lg); }
	.product__info { gap: 14px; padding-top: 0; }
}

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.feature { padding: 24px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.feature__icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; background: var(--green-bg); color: var(--green); }
.feature p { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }

.history { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.history__chart { padding: 24px; border-radius: var(--r-xl); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.history__chart header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.history__chart h3 { font-size: 19px; }
.history__stats { display: grid; gap: 12px; }
.stat { display: flex; flex-direction: column; justify-content: center; padding: 20px 22px; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.stat span { font-size: 13.5px; color: var(--text-2); }
.stat strong { font-family: "Inter", "Noto Sans Thai", sans-serif; font-size: 28px; letter-spacing: -.035em; }
.stat--low strong { color: var(--green); }
.stat--high strong { color: var(--red); }
@media (max-width: 900px) { .history { grid-template-columns: 1fr; } .history__stats { grid-template-columns: repeat(3, 1fr); } .stat { padding: 14px; } .stat strong { font-size: 18px; } }

.chart { margin: 0; }
.chart svg { width: 100%; height: 260px; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart__grid--avg { stroke: var(--text-3); stroke-dasharray: 2 4; opacity: .7; }
.chart__label, .chart__date { fill: var(--text-3); font-size: 12px; font-family: "Inter", "Noto Sans Thai", sans-serif; }
.chart__line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.js .chart.is-in .chart__line { animation: draw 1.4s var(--ease) both; stroke-dasharray: 1; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.chart__dot { fill: var(--blue); stroke: var(--bg-elev); stroke-width: 2.5; }
.chart__halo { fill: var(--blue); opacity: .18; animation: pulse 2s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .35; } 100% { transform: scale(1.8); opacity: 0; } }
.chart-empty { display: grid; place-items: center; gap: 10px; min-height: 220px; text-align: center; color: var(--text-3); }
.chart-empty p { margin: 0; font-size: 14.5px; }

.summary { padding: clamp(22px, 3vw, 32px); border-radius: var(--r-xl); background: var(--bg-elev); box-shadow: var(--shadow-1); border-left: 4px solid var(--blue); }
.summary p { margin: 0; font-size: 17.5px; line-height: 1.8; }
.summary p + p { margin-top: 12px; }
.compare__title { margin: 40px 0 14px; font-size: 21px; }
.compare { overflow-x: auto; border-radius: var(--r-lg); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.compare table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compare thead th { font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--bg-alt); }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tbody th { font-weight: 500; max-width: 280px; }
.compare tbody th a { color: var(--text); }
.compare .is-current { background: color-mix(in srgb, var(--blue) 6%, transparent); }
.compare__you { display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.prose-card { padding: clamp(24px, 4vw, 44px); border-radius: var(--r-xl); background: var(--bg-elev); box-shadow: var(--shadow-1); }
.disclosure { margin: 16px 0 0; font-size: 12.5px; color: var(--text-3); }

.cta-band { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(28px, 4vw, 44px); border-radius: var(--r-xl); background: #000; color: #f5f5f7; overflow: hidden; isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 120% at 90% 50%, rgba(238, 77, 45, .45), transparent 70%); }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); }
.cta-band p { margin: 6px 0 0; color: #a1a1a6; }

.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: var(--bg-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); transform: translateY(110%); transition: transform .4s var(--spring); }
.buybar.is-visible { transform: none; }
.buybar__inner { display: flex; align-items: center; gap: 12px; }
.buybar__price { flex: 1; min-width: 0; line-height: 1.2; }
.buybar__price strong { display: block; font-size: 21px; letter-spacing: -.03em; }
.buybar__price span { font-size: 12.5px; color: var(--green); font-weight: 600; }
.buybar .btn { flex: none; min-height: 48px; }
@media (min-width: 901px) { .buybar { display: none; } }
@media (max-width: 900px) { .has-buybar .site-footer { padding-bottom: 100px; } }

/* ==========================================================================
   Article
   ========================================================================== */

.progress { position: fixed; top: 0; left: 0; z-index: 200; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #ff7a45, #ee4d2d, #c81d6b); }
.admin-bar .progress { top: 32px; }

.article-hero { padding: clamp(32px, 5vw, 64px) 0 0; text-align: center; }
.article-hero .crumbs ol { justify-content: center; }
.article-hero__kicker { display: inline-flex; margin: 22px 0 14px; padding: 5px 14px; border-radius: 999px; background: var(--orange-bg); color: var(--orange); font-size: 14px; font-weight: 600; text-decoration: none !important; }
.article-hero h1 { font-size: clamp(32px, 5.2vw, 58px); letter-spacing: -.035em; line-height: 1.18; max-width: 20ch; margin: 0 auto; }
.article-hero .lede { max-width: 36em; margin: 20px auto 0; }
.byline { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; font-size: 14px; color: var(--text-2); }
.byline__avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #ff7a45, #c81d6b); color: #fff; font-weight: 700; font-size: 15px; }
.byline b { color: var(--text); font-weight: 600; }
.byline .sep { color: var(--line-2); }
.article-cover { max-width: 1080px; margin: clamp(32px, 5vw, 56px) auto 0; padding: 0 var(--gutter); }
.article-cover img, .article-cover .post-cover { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-xl); }
.article-cover .post-cover { padding: clamp(24px, 4vw, 48px); }
.article-cover .post-cover__icon { width: 64px; height: 64px; border-radius: 20px; }
@media (max-width: 640px) { .article-cover img, .article-cover .post-cover { aspect-ratio: 16 / 10; } }

.article-layout { display: grid; grid-template-columns: 240px minmax(0, var(--max-text)) 240px; justify-content: center; gap: 48px; padding-top: clamp(32px, 5vw, 56px); padding-bottom: 40px; }
.article-layout__side { position: relative; }
.toc { position: sticky; top: calc(var(--nav-h) + 32px); font-size: 14px; }
.toc__title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--line); }
.toc a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--text-2); line-height: 1.45; text-decoration: none; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); border-left-color: var(--buy); font-weight: 600; }
.side-deals { position: sticky; top: calc(var(--nav-h) + 32px); display: grid; gap: 12px; }
.side-deals__title { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.mini { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--bg-alt); text-decoration: none !important; color: var(--text); transition: background .2s; }
.mini:hover { background: color-mix(in srgb, var(--bg-alt) 70%, var(--line-2)); }
.mini__media { width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden; background: var(--bg-elev); }
.mini__media img { width: 100%; height: 100%; object-fit: contain; }
.mini__media .media-fallback span { font-size: 28px; }
.mini__title { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini__price { font-size: 14px; font-weight: 700; }
.mini__price em { font-style: normal; color: var(--buy); font-size: 12px; margin-left: 4px; }
@media (max-width: 1240px) { .article-layout { grid-template-columns: 220px minmax(0, var(--max-text)); } .article-layout__side--right { display: none; } }
@media (max-width: 960px) { .article-layout { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--max-text) + 2 * var(--gutter)); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); } .article-layout__side--left { display: none; } }
@media (min-width: 961px) { .article-layout { padding-left: var(--gutter); padding-right: var(--gutter); } }

.toc-inline { display: none; margin-bottom: 32px; border-radius: var(--r-lg); background: var(--bg-alt); }
.toc-inline summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; font-weight: 600; cursor: pointer; list-style: none; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary .icon { transition: transform .3s var(--spring); transform: rotate(90deg); }
.toc-inline[open] summary .icon { transform: rotate(-90deg); }
.toc-inline ol { margin: 0; padding: 0 20px 18px 40px; }
.toc-inline li { padding: 4px 0; }
.toc-inline a { color: var(--text-2); }
@media (max-width: 960px) { .toc-inline { display: block; } }

/* Prose */
.prose { font-size: 18.5px; line-height: 1.85; letter-spacing: -.005em; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose > p:first-child { font-size: 1.12em; line-height: 1.75; color: var(--text); }
.prose h2 { margin-top: 2.2em; margin-bottom: .2em; font-size: clamp(26px, 3vw, 32px); letter-spacing: -.028em; line-height: 1.3; }
.prose h3 { margin-top: 1.8em; font-size: 21px; letter-spacing: -.02em; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: .2em; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose ul li, .prose ol li { position: relative; padding-left: 32px; margin: .55em 0; }
.prose ul li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--buy); box-shadow: 0 0 0 4px var(--orange-bg); }
.prose ol { counter-reset: li; }
.prose ol li { counter-increment: li; }
.prose ol li::before { content: counter(li); position: absolute; left: 0; top: .3em; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 700; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--buy); font-size: 1.15em; font-weight: 600; letter-spacing: -.015em; }
.prose img { border-radius: var(--r-lg); }
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--text-3); text-align: center; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.6em 0; font-size: 16px; line-height: 1.5; border-radius: var(--r); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.prose th { background: var(--bg-alt); text-align: left; font-weight: 700; font-size: 14px; color: var(--text-2); }
.prose th, .prose td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; white-space: nowrap; }
.prose .table-wrap { overflow-x: auto; margin: 1.6em calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.prose .table-wrap table { margin: 0; min-width: 480px; }
@media (max-width: 600px) { .prose { font-size: 17.5px; line-height: 1.8; } }

/* FAQ accordion (built by JS from "คำถามที่พบบ่อย") */
.faq { margin-top: 1.4em; border-radius: var(--r-lg); background: var(--bg-alt); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; font-size: 17px; font-weight: 600; line-height: 1.45; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-elev); font-size: 20px; font-weight: 400; transition: transform .3s var(--spring); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq__a { padding: 0 22px 20px; color: var(--text-2); font-size: 16.5px; line-height: 1.75; }

/* Product embeds inside articles */
.spa-embed { margin: 1.8em 0; }
.spa-embed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.prose .spa-embed .pcard { box-shadow: 0 0 0 1px var(--line); }
.prose .spa-embed .pcard:hover { box-shadow: var(--shadow-2); }
.prose .spa-embed h3 { margin: 0; font-size: 15.5px; }
.prose .spa-embed a { text-decoration: none; }
.prose .spa-embed .pcard__cta { color: #fff; }
.prose .spa-embed:not(.spa-embed-grid) .pcard { flex-direction: row; align-items: center; }
.prose .spa-embed:not(.spa-embed-grid) .pcard__media { width: 180px; flex: none; margin: 10px; }
@media (min-width: 700px) { .spa-embed-grid:has(> .pcard:nth-child(3)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .spa-embed-grid { gap: 10px; } .prose .spa-embed:not(.spa-embed-grid) .pcard__media { width: 110px; } }

.article-end { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-end__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.share { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.share a, .share button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--bg-alt); color: var(--text); cursor: pointer; text-decoration: none !important; font-weight: 700; font-size: 13px; transition: background .2s, transform .2s; }
.share a:hover, .share button:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--bg-alt) 70%, var(--line-2)); }

.author-box { display: flex; gap: 16px; align-items: center; margin-top: 32px; padding: 22px; border-radius: var(--r-lg); background: var(--bg-alt); }
.author-box .byline__avatar { width: 52px; height: 52px; font-size: 20px; flex: none; }
.author-box p { margin: 2px 0 0; font-size: 14.5px; color: var(--text-2); }

/* ==========================================================================
   Pages, comments, 404
   ========================================================================== */

.page-content { padding: clamp(24px, 4vw, 48px) 0 clamp(56px, 8vw, 96px); }
.nf { padding: clamp(80px, 14vw, 160px) 0; text-align: center; }
.nf__code { font-family: "Inter", sans-serif; font-size: clamp(96px, 20vw, 220px); font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.nf h1 { font-size: clamp(28px, 4vw, 40px); margin: 12px 0 10px; }
.nf .searchbox { margin-top: 32px; }

.comments { margin-top: 48px; }
.comments h2 { font-size: 24px; margin-bottom: 20px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-meta { font-size: 14px; color: var(--text-2); }
.comment-meta img { display: inline; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: 12px 14px; border: 0; border-radius: var(--r-sm); background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); }
.comment-form textarea:focus, .comment-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.comment-form .submit { display: inline-flex; min-height: 44px; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--bg-alt); color: var(--text-2); font-size: 13px; line-height: 1.6; padding: 48px 0 32px; }
.footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.footer__brand p { margin: 14px 0 0; max-width: 26em; font-size: 14px; }
.footer__col h2 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.footer__col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.footer__col a { color: var(--text-2); }
.footer__col a:hover { color: var(--text); }
.footer__disclosure { margin: 24px 0 0; padding: 16px 18px; border-radius: var(--r-sm); background: var(--bg-elev); font-size: 12.5px; color: var(--text-2); display: flex; gap: 10px; align-items: flex-start; }
.footer__disclosure .icon { color: var(--blue); margin-top: 2px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.to-top { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--text-2); font-size: 13px; cursor: pointer; }
.to-top:hover { color: var(--text); }
@media (max-width: 860px) { .footer__top { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

/* WordPress core classes */
.alignwide { max-width: 1080px; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .wp-element-caption { font-size: 14px; color: var(--text-3); text-align: center; }
