/*
Theme Name: FesAd
Theme URI: https://example.com
Description: Fast, modern WordPress theme for selling Facebook ad accounts. Zero bloat, LINE-only checkout.
Author: 55
Version: 4.6.0
Text Domain: fesad
*/

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; }

/* ─── Variables ─────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg:        #09090b;
  --bg-alt:    #0f0f12;
  --card:      #18181b;
  --card-h:    #1c1c20;
  --border:    rgba(255,255,255,.08);

  /* text */
  --text:      #f4f4f5;
  --muted:     #a1a1aa;
  --dim:       #8b8b95;

  /* brand */
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --green:     #22c55e;
  --line-clr:  #06C755;
  --line-h:    #05a847;

  /* ui */
  --radius:    10px;
  --radius-lg: 16px;
  --max-w:     1180px;
  --gap:       24px;

  /* font – system-first, Thai-aware */
  --font: 'Noto Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Base ───────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Layout Helpers ─────────────────────────────────── */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--gap); }
.grid-6 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--gap); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-6 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
}

/* ─── Typography ─────────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.lede {
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 56ch;
  margin-top: 12px;
}

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-line {
  background: var(--line-clr);
  color: #fff;
}
.btn-line:hover { background: var(--line-h); box-shadow: 0 0 0 4px rgba(6,199,85,.2); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: rgba(255,255,255,.25); background: var(--card); }

.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* ─── HEADER ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,11,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand svg { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: var(--card); }

.nav-cta { margin-left: 8px; }

.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  cursor: pointer;
  color: var(--muted);
  margin-left: auto;
}

@media (max-width: 720px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px 20px; gap: 2px; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-toggle-label { display: block; }
  .nav-cta { display: none; }
  .nav-wrap { flex-wrap: wrap; height: auto; padding: 14px 20px; }
}

/* ─── HERO ───────────────────────────────────────────── */
.hero {
  padding: 80px 0 72px;
  background: linear-gradient(180deg, #0d0d14 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(37,99,235,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 48px;
  align-items: center;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(37,99,235,.12);
  color: #93c5fd;
  border: 1px solid rgba(37,99,235,.25);
}
.badge-green {
  background: rgba(34,197,94,.1);
  color: #86efac;
  border-color: rgba(34,197,94,.2);
}

.hero-title { margin: 8px 0 16px; }

.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 32px;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .95rem;
  color: var(--muted);
}
.checklist li svg { color: var(--green); flex-shrink: 0; margin-top: 2px; }

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-image-wrap {
  position: relative;
}
.hero-image-wrap img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 16px;
}
.stat-item {
  background: var(--card);
  padding: 14px 16px;
  text-align: center;
}
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: .75rem; color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image-wrap { order: -1; max-width: 480px; margin: 0 auto; }
}

/* ─── TRUST BAR ──────────────────────────────────────── */
.trust-bar {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.trust-items {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted);
}
.trust-item svg { color: var(--green); }
.trust-item strong { color: var(--text); }

/* ─── PRODUCTS (index.php cards) ────────────────────── */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: rgba(37,99,235,.4);
  box-shadow: 0 0 0 1px rgba(37,99,235,.12), 0 12px 40px rgba(0,0,0,.5);
  transform: translateY(-2px);
}
.product-media {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}
.product-media img { width:100%; height:100%; object-fit:cover; transition: transform .4s; }
.product-card:hover .product-media img { transform: scale(1.04); }
.ribbon {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 10px; border-radius: 100px;
  font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.ribbon-hot { background: #ef4444; color: #fff; }
.ribbon-rec { background: var(--accent); color: #fff; }
.ribbon-new { background: var(--green); color: #052e16; }
.product-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.product-name { font-size: 1rem; font-weight: 700; line-height: 1.35; }
.price-row { display: flex; align-items: baseline; gap: 10px; }
.price-now { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.price-old { font-size: .9rem; color: var(--dim); text-decoration: line-through; }
.price-save {
  font-size: .78rem; background: rgba(34,197,94,.12); color: var(--green);
  padding: 2px 8px; border-radius: 100px; font-weight: 600; border: 1px solid rgba(34,197,94,.2);
}
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: .75rem; padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--muted);
}
.product-body .btn { margin-top: auto; width: 100%; justify-content: center; }

/* ─── PRODUCTS PAGE HERO ────────────────────────────── */
.products-hero {
  padding: 56px 0 48px;
  background: linear-gradient(180deg, #0d0d14 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}
.products-hero::before {
  content: '';
  position: absolute;
  top: -80px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 300px;
  background: radial-gradient(ellipse, rgba(37,99,235,.1) 0%, transparent 70%);
  pointer-events: none;
}
.products-hero h1 { margin: 8px 0 12px; }
.text-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.products-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 24px;
}
.products-trust span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
}

/* ─── PRICING CARDS (archive-product.php) ───────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
  padding: 48px 0 32px;
}
@media (max-width: 1000px) { .products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .products-grid { grid-template-columns: 1fr; } }

/* Base card */
.pcard {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s, border-color .22s;
}
.pcard:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}

/* Recommended card */
.pcard.card-rec {
  border-color: rgba(37,99,235,.5);
  box-shadow: 0 0 0 1px rgba(37,99,235,.2), 0 4px 24px rgba(37,99,235,.12);
  background: linear-gradient(180deg, rgba(37,99,235,.06) 0%, var(--card) 60%);
}
.pcard.card-rec:hover {
  border-color: rgba(37,99,235,.8);
  box-shadow: 0 0 0 1px rgba(37,99,235,.4), 0 24px 64px rgba(37,99,235,.2);
}

/* Hot card */
.pcard.card-hot {
  border-color: rgba(239,68,68,.4);
  box-shadow: 0 0 0 1px rgba(239,68,68,.15), 0 4px 24px rgba(239,68,68,.1);
}
.pcard.card-hot:hover {
  border-color: rgba(239,68,68,.7);
  box-shadow: 0 0 0 1px rgba(239,68,68,.35), 0 24px 64px rgba(239,68,68,.18);
}

/* Crown badge (แนะนำ / ขายดี) */
.pcard-crown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  background: var(--accent);
  color: #fff;
}
.pcard-crown-hot { background: #dc2626; }

/* Media */
.pcard-media {
  position: relative;
  aspect-ratio: 16/9;
  background: #111;
  overflow: hidden;
}
.pcard-media a { display: block; height: 100%; }
.pcard-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.pcard:hover .pcard-media img { transform: scale(1.05); }

.pcard-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9,9,11,.7) 0%, transparent 60%);
  pointer-events: none;
}
.pcard-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--dim);
}

/* % save badge */
.pcard-save-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--green);
  color: #052e16;
}

/* Body */
.pcard-body {
  padding: 22px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Name */
.pcard-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
}
.pcard-name a {
  color: var(--text);
  text-decoration: none;
}
.pcard-name a:hover { color: #93c5fd; }

/* Pricing */
.pcard-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.pcard-price {
  font-size: .85rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: -.01em;
}
.pcard-price span {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
}
.card-rec .pcard-price span { color: #93c5fd; }
.card-hot .pcard-price span { color: #fca5a5; }

.pcard-price-old {
  font-size: .88rem;
  color: var(--dim);
  text-decoration: line-through;
}

/* Features */
.pcard-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.pcard-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.4;
}
.pcard-features li svg {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 1px;
}
.card-rec .pcard-features li svg { color: #93c5fd; }

/* Actions */
.pcard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.pcard-buy {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 13px 20px;
}
.pcard-detail-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.pcard-detail-link:hover { color: var(--text); }

/* Empty state */
.products-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ─── COMPARE TABLE ──────────────────────────────────── */
.compare-section { padding-top: 60px; padding-bottom: 60px; }
.compare-wrap { overflow-x: auto; margin-top: 32px; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 540px;
}
.compare-table th,
.compare-table td {
  padding: 13px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.compare-table th:first-child,
.compare-table td:first-child {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
}
.compare-table thead th {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-alt);
}
.compare-table thead th:first-child { border-radius: 8px 0 0 0; }
.compare-table thead th:last-child  { border-radius: 0 8px 0 0; }
.compare-table td { color: var(--muted); }
.compare-table td:not(:first-child) { color: var(--text); }
.compare-table .col-rec {
  background: rgba(37,99,235,.06);
  color: #93c5fd !important;
  border-left: 1px solid rgba(37,99,235,.2);
  border-right: 1px solid rgba(37,99,235,.2);
  font-weight: 600;
}
.compare-table thead .col-rec {
  color: #93c5fd !important;
  background: rgba(37,99,235,.12);
}

/* ─── WHY CARDS ──────────────────────────────────────── */
.why-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color .2s;
}
.why-card:hover { border-color: rgba(37,99,235,.3); }
.why-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(37,99,235,.12);
  color: #93c5fd;
  margin-bottom: 14px;
}
.why-card h3 { font-size: .95rem; margin-bottom: 6px; }
.why-card p { font-size: .88rem; color: var(--muted); line-height: 1.55; }

/* ─── ARTICLE CARDS ──────────────────────────────────── */
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.article-card:hover {
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.article-thumb {
  display: block;
  aspect-ratio: 16/9;
  background: var(--bg-alt);
  overflow: hidden;
}
.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.article-card:hover .article-thumb img { transform: scale(1.04); }

.article-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .78rem;
  color: var(--dim);
}
.article-cat {
  background: rgba(37,99,235,.12);
  color: #93c5fd;
  padding: 2px 9px;
  border-radius: 100px;
  font-weight: 600;
  border: 1px solid rgba(37,99,235,.2);
}
.article-body h3 { font-size: .98rem; line-height: 1.45; }
.article-body h3 a { text-decoration: none; color: var(--text); }
.article-body h3 a:hover { color: #93c5fd; }
.article-excerpt { font-size: .85rem; color: var(--muted); line-height: 1.5; }

/* ─── FAQ ────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }

details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
details[open] { border-color: rgba(37,99,235,.3); }

summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary .chev { flex-shrink: 0; color: var(--dim); transition: transform .2s; }
details[open] summary .chev { transform: rotate(180deg); }

details p {
  padding: 0 20px 18px;
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.65;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: -4px;
}

/* ─── CTA SECTION ────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 80px 0;
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(6,199,85,.08) 0%, transparent 70%);
  pointer-events: none;
}
.cta-section h2 { margin-bottom: 12px; }
.cta-section p { color: var(--muted); margin-bottom: 28px; }
.cta-line-id {
  display: inline-block;
  font-size: .88rem;
  color: var(--dim);
  margin-top: 14px;
}

/* ─── FOOTER ─────────────────────────────────────────── */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.foot-brand { max-width: 280px; }
.foot-brand .brand { font-size: 1rem; margin-bottom: 12px; display: flex; }
.foot-desc { font-size: .85rem; color: var(--muted); line-height: 1.6; }

.foot-col h4, .foot-col .foot-h { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .06em; }
.foot-col ul { display: flex; flex-direction: column; gap: 8px; }
.foot-col ul li a { font-size: .88rem; color: var(--muted); text-decoration: none; transition: color .15s; }
.foot-col ul li a:hover { color: var(--text); }

.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .82rem;
  color: var(--dim);
}

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; max-width: 100%; }
}
@media (max-width: 600px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ─── FLOATING LINE BUTTON ───────────────────────────── */
.line-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--line-clr);
  color: #fff;
  padding: 12px 20px 12px 16px;
  border-radius: 100px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(6,199,85,.35);
  transition: background .15s, box-shadow .15s, transform .1s;
}
.line-fab:hover { background: var(--line-h); box-shadow: 0 4px 32px rgba(6,199,85,.5); transform: translateY(-2px); }
.line-fab:active { transform: scale(.97); }
.line-fab svg { flex-shrink: 0; }
.line-fab-label { line-height: 1; }
.line-fab-sub { font-size: .72rem; font-weight: 400; opacity: .85; display: block; margin-top: 1px; }

@media (max-width: 480px) {
  .line-fab { padding: 12px 14px; border-radius: 50%; }
  .line-fab-label { display: none; }
}

/* ─── SINGLE POST ────────────────────────────────────── */
.post-hero {
  padding: 60px 0 40px;
  border-bottom: 1px solid var(--border);
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: .82rem;
  color: var(--dim);
  margin-bottom: 20px;
}
.post-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px;
}
.post-content h1, .post-content h2, .post-content h3 { margin: 1.5em 0 .6em; }
.post-content h2 { font-size: 1.4rem; color: var(--text); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.post-content h3 { font-size: 1.1rem; color: var(--text); }
.post-content p { margin-bottom: 1.2em; color: var(--muted); line-height: 1.8; }
.post-content ul, .post-content ol { margin: 1em 0 1.2em 1.4em; color: var(--muted); line-height: 1.8; }
.post-content li { margin-bottom: .4em; }
.post-content strong { color: var(--text); }
.post-content a { color: #93c5fd; text-decoration: underline; }
.post-content blockquote { border-left: 3px solid var(--accent); padding: 12px 20px; background: var(--card); border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; }
.post-content blockquote p { color: var(--text); margin: 0; }
.post-content img { border-radius: var(--radius); margin: 1.5em 0; border: 1px solid var(--border); }
.post-content .table-wrap { overflow-x: auto; margin: 1.5em 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.post-content th { background: var(--card); color: var(--text); padding: 10px 14px; text-align: left; border: 1px solid var(--border); }
.post-content td { padding: 10px 14px; border: 1px solid var(--border); color: var(--muted); }

/* Post CTA box */
.post-cta-box {
  background: var(--card);
  border: 1px solid rgba(6,199,85,.2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 2em 0;
}
.post-cta-box p { margin: 0; color: var(--muted); font-size: .9rem; }
.post-cta-box strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

/* Related posts */
.related-posts { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0; }

/* ─── PAGINATION ─────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: .88rem;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--card);
  transition: color .15s, border-color .15s;
}
.pagination a:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── 404 ────────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 100px 20px;
}
.not-found .code { font-size: 7rem; font-weight: 900; color: var(--border); line-height: 1; }

/* ─── UTILS ──────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.section-head { margin-bottom: 32px; }
.section-head h2 { margin-top: 6px; }

/* ═══════════════════════════════════════════════════════
   v4 — nav fix, hero mock, auto cover, blog listing
   ═══════════════════════════════════════════════════════ */

/* ─── Nav (ul > li > a) ─────────────────────────────── */
.nav-menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-menu li { list-style: none; margin: 0; }
.nav-menu li::marker { content: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--card); }
@media (max-width: 720px) {
  .nav-menu { flex-direction: column; align-items: stretch; width: 100%; }
  .nav-menu a { padding: 12px 10px; font-size: 1rem; }
}

/* ─── Hero mock (แสดงเมื่อไม่ได้ตั้งรูป Hero) ─────────── */
.hero-mock {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #15151b 0%, #0f0f13 100%);
  box-shadow: 0 30px 80px -20px rgba(37,99,235,.35), 0 0 0 1px rgba(255,255,255,.02) inset;
  overflow: hidden;
  font-size: .82rem;
}
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3f3f46; }
.mock-bar i:first-child { background: #ef4444; } .mock-bar i:nth-child(2) { background: #eab308; } .mock-bar i:nth-child(3) { background: #22c55e; }
.mock-bar span { margin-left: 8px; color: var(--muted); font-weight: 600; font-size: .78rem; }
.mock-body { padding: 18px; display: grid; gap: 16px; }
.mock-status { display: inline-flex; align-items: center; gap: 8px; color: #86efac; background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); padding: 6px 10px; border-radius: 999px; width: fit-content; font-size: .76rem; font-weight: 600; }
.dot-green, .dot-blue { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; flex-shrink: 0; }
.dot-blue { background: #60a5fa; box-shadow: 0 0 8px #60a5fa; }
.mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-kpis div { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.mock-kpis small { display: block; color: var(--dim); font-size: .7rem; margin-bottom: 2px; }
.mock-kpis b { font-size: 1.05rem; color: var(--text); font-variant-numeric: tabular-nums; }
.mock-kpis b.up { color: #86efac; }
.mock-chart { height: 96px; display: flex; align-items: flex-end; gap: 6px; padding: 0 2px; border-bottom: 1px solid var(--border); }
.mock-chart span { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #3b82f6, rgba(59,130,246,.15)); animation: barUp .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
.mock-chart span:nth-child(n+9) { background: linear-gradient(180deg, #8b5cf6, rgba(139,92,246,.15)); }
@keyframes barUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.mock-rows { display: grid; gap: 6px; }
.mock-rows div { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; background: rgba(255,255,255,.025); color: var(--muted); }
.mock-rows em { margin-left: auto; font-style: normal; font-size: .72rem; color: #86efac; }
.mock-rows div:last-child em { color: #93c5fd; }
@media (prefers-reduced-motion: reduce) { .mock-chart span { animation: none; } }

/* ─── Auto cover (บทความ/สินค้าที่ไม่มีรูป — ไม่โหลดรูปเลย) ── */
.article-thumb, .pcard-media a { text-decoration: none; color: #fff; }
.auto-cover {
  position: relative;
  width: 100%; height: 100%;
  aspect-ratio: 16/9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #fff;
  background:
    radial-gradient(70% 90% at var(--x, 80%) 0%, var(--c2) 0%, transparent 60%),
    radial-gradient(60% 80% at 10% 100%, var(--c1) 0%, transparent 65%),
    #0d0d12;
  overflow: hidden;
  transition: transform .4s;
}
.auto-cover::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 75%);
  pointer-events: none;
}
.ac-icon {
  position: relative; z-index: 1;
  width: 68px; height: 68px; display: grid; place-items: center;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.ac-label { position: relative; z-index: 1; font-size: .74rem; font-weight: 700; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.35); color: rgba(255,255,255,.9); }
.article-card:hover .auto-cover, .pcard:hover .auto-cover { transform: scale(1.04); }
.pcard-media .auto-cover { aspect-ratio: auto; }
.pcard-media > a { display: block; height: 100%; }

/* ─── Article card ──────────────────────────────────── */
.article-card { display: flex; flex-direction: column; }
.article-body { flex: 1; }
.article-title { font-size: 1rem; font-weight: 700; line-height: 1.45; margin: 0; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a::after { content: ""; position: absolute; inset: 0; }
.article-card { position: relative; }
.article-card:hover .article-title a { color: #93c5fd; }
.article-more { margin-top: auto; padding-top: 6px; font-size: .82rem; font-weight: 600; color: var(--accent); }

/* ─── Blog listing page ─────────────────────────────── */
.page-hero { padding: 56px 0 28px; background: linear-gradient(180deg, #0d0d14 0%, var(--bg) 100%); }
.page-hero h1 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); line-height: 1.25; margin: 8px 0 10px; }
.page-hero .lede { max-width: 60ch; }
.cat-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cat-pills a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; color: var(--muted); text-decoration: none; transition: .15s; }
.cat-pills a small { font-size: .72rem; color: var(--dim); }
.cat-pills a:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.cat-pills a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-pills a[aria-current="page"] small { color: rgba(255,255,255,.7); }

.empty-note { color: var(--muted); text-align: center; padding: 48px 0; }

/* ─── Pagination ────────────────────────────────────── */
.pagination { margin-top: 40px; display: flex; justify-content: center; }
.pagination ul { display: flex; gap: 6px; padding: 0; margin: 0; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.pagination a:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ─── Front page: product grid spacing ──────────────── */
#products .products-grid { margin-top: 8px; }

/* ─── Post content: คืน bullet / ตาราง scroll บนมือถือ ── */
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .35em; }
.post-content li::marker { color: var(--accent); }
.post-content figure.wp-block-table { margin: 1.5em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-content td { padding: 10px 14px; border: 1px solid var(--border); color: var(--muted); }
.post-content code { background: var(--card); padding: 2px 6px; border-radius: 5px; font-size: .88em; }
.post-content a:not(.btn) { color: #93c5fd; text-underline-offset: 3px; }

/* ─── Accessibility: skip link ──────────────────────── */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 0; z-index: 1000;
  top: 8px; left: 8px; padding: 10px 16px; background: var(--accent); color: #fff; border-radius: 8px;
}

/* ─── Brand: ชื่อยาวไม่ดันหน้าจอ ──────────────────────── */
.brand { min-width: 0; flex-shrink: 1; }
.brand svg { flex-shrink: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html, body { overflow-x: clip; }

@media (max-width: 720px) {
  .nav-wrap { flex-wrap: nowrap; height: 60px; padding: 0 16px; gap: 12px; }
  .nav-toggle-label { flex-shrink: 0; padding: 8px; margin-right: -8px; }
  .brand { flex: 1; font-size: .9rem; }
  .nav-links { top: 60px; }
  /* มือถือ: เอาหัวข้อขึ้นก่อน ซ่อน mockup เหลือแต่ตัวเลข */
  .hero { padding: 40px 0 48px; }
  .hero-image-wrap { order: 0 !important; max-width: none; }
  .hero-mock { display: none; }
}

/* ─── TOP crown ─────────────────────────────────────── */
.pcard-crown-top { background: linear-gradient(90deg, #2563eb, #7c3aed); letter-spacing: .02em; }

/* ─── Logo + footer network links ───────────────────── */
.brand .brand-logo { flex-shrink: 0; border-radius: 8px; box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.brand svg.brand-logo { color: inherit; }
.foot-network { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.foot-network a { color: var(--muted); text-decoration: none; transition: color .15s; }
.foot-network a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.foot-network span { color: var(--dim); }
@media (max-width: 720px) {
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand .brand-logo { width: 26px; height: 26px; }
}
/* เว้นที่ให้ปุ่ม LINE ลอย ไม่บังลิงก์ท้ายเว็บ */
.site-footer { padding-bottom: 96px; }

/* ─── Contrast (WCAG AA) ────────────────────────────── */
:root { --accent-text: #60a5fa; }
.eyebrow, .article-more { color: var(--accent-text); }
.eyebrow::before { background: var(--accent-text); }
.post-content a.btn, .post-cta-box a.btn { color: #fff; text-decoration: none; }
.post-content a.btn-line, .post-cta-box a.btn-line, a.btn-line { color: #04220f; }
.btn-line, .line-fab { color: #04220f; }
.btn-line svg, .line-fab svg { color: #04220f; }
.line-fab-sub { color: rgba(4,34,15,.75); }
.ribbon-hot { background: #dc2626 !important; color: #fff !important; }
.ribbon-rec { background: #2563eb !important; color: #fff !important; }

/* ═══════════════════════════════════════════════════════
   TOP card — การ์ดเด่น เต็มแถว แนวนอน ขอบทองหมุน
   ═══════════════════════════════════════════════════════ */
@property --top-ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes topSpin  { to { --top-ang: 360deg; } }
@keyframes topShine { 0%, 60% { transform: translateX(-120%) skewX(-20deg); } 100% { transform: translateX(220%) skewX(-20deg); } }
@keyframes topPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(6,199,85,.45); } 50% { box-shadow: 0 0 0 10px rgba(6,199,85,0); } }

.pcard.card-top {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  border: 2px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(135deg, #221a0c 0%, #17171b 45%, #1b1530 100%) padding-box,
    conic-gradient(from var(--top-ang), #f59e0b, #fde68a, #ec4899, #8b5cf6, #3b82f6, #f59e0b) border-box;
  box-shadow: 0 0 0 1px rgba(245,158,11,.15), 0 30px 80px -20px rgba(245,158,11,.35), 0 10px 60px -10px rgba(139,92,246,.3);
  animation: topSpin 6s linear infinite;
  margin-bottom: 12px;
}
.pcard.card-top:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(245,158,11,.3), 0 40px 90px -20px rgba(245,158,11,.5), 0 10px 60px -10px rgba(139,92,246,.4); }

/* ป้าย TOP ลอยบนรูป */
.card-top .pcard-crown-top {
  position: absolute; z-index: 4; top: 18px; left: 18px;
  display: inline-flex; gap: 6px; padding: 9px 18px;
  border-radius: 999px; overflow: hidden;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #1c1300; font-size: .9rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 8px 24px rgba(245,158,11,.5);
}
.card-top .pcard-crown-top::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: topShine 3.2s ease-in-out infinite;
}
.card-top .pcard-media { aspect-ratio: auto; height: 100%; min-height: 360px; border-radius: 20px 0 0 20px; }
.card-top .pcard-media img, .card-top .pcard-media .auto-cover { height: 100%; }
.card-top .pcard-save-badge { top: auto; bottom: 16px; right: 16px; font-size: .85rem; padding: 6px 12px; }

.card-top .pcard-body { padding: 36px 40px; justify-content: center; gap: 14px; }
.pcard-top-tag { font-size: .8rem; font-weight: 700; letter-spacing: .04em; color: #fbbf24; text-transform: uppercase; }
.card-top .pcard-name { font-size: 1.6rem; line-height: 1.3; }
.card-top .pcard-name a { color: #fff; }
.card-top .pcard-name a:hover { color: #fde68a; }
.card-top .pcard-price { font-size: 1.3rem; color: #fde68a; }
.card-top .pcard-price span {
  font-size: 3.2rem; line-height: 1;
  background: linear-gradient(90deg, #fff7d6, #fbbf24 60%, #f59e0b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.card-top .pcard-price-old { font-size: 1.05rem; }
.card-top .pcard-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.card-top .pcard-features li { color: #e4e4e7; }
.card-top .pcard-features li svg { color: #fbbf24; }
.card-top .pcard-actions { flex-direction: row; align-items: center; gap: 18px; margin-top: 6px; }
.card-top .pcard-buy { flex: 1; max-width: 340px; padding: 16px 24px; font-size: 1.08rem; animation: topPulse 2.2s ease-out infinite; }

@media (max-width: 1000px) {
  .pcard.card-top { grid-template-columns: 1fr; }
  .card-top .pcard-media { aspect-ratio: 16/9; height: auto; min-height: 0; border-radius: 20px 20px 0 0; }
  .card-top .pcard-body { padding: 24px 22px 26px; }
  .card-top .pcard-name { font-size: 1.3rem; }
  .card-top .pcard-price span { font-size: 2.6rem; }
  .card-top .pcard-actions { flex-direction: column; align-items: stretch; }
  .card-top .pcard-buy { max-width: none; }
}
@media (max-width: 600px) { .card-top .pcard-features { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .pcard.card-top, .card-top .pcard-crown-top::after, .card-top .pcard-buy { animation: none; }
}
/* TOP: รูปแบบกรอบ 16:9 ไม่ถูกครอป + ป้ายอยู่มุมขวาบน */
.card-top .pcard-media { aspect-ratio: 16/9; height: auto; min-height: 0; align-self: center; margin: 22px 0 22px 22px; border-radius: 14px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); }
.card-top .pcard-crown-top { left: auto; right: 22px; top: 22px; }
.card-top .pcard-body { padding-top: 64px; }
@media (max-width: 1000px) {
  .card-top .pcard-media { margin: 0; border-radius: 20px 20px 0 0; box-shadow: none; }
  .card-top .pcard-crown-top { left: 16px; right: auto; top: 16px; }
  .card-top .pcard-body { padding-top: 24px; }
}
@media (max-width: 600px) { .card-top .pcard-crown-top { top: 10px; left: 10px; padding: 6px 12px; font-size: .78rem; } }
