/* Page layouts: landing hero, pulse tiles, sections, explorer header, product page, prose. */

/* landing hero */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 32px; align-items: center;
  padding: 40px; margin-bottom: 18px; border-radius: 24px; overflow: clip;
  background: radial-gradient(120% 90% at 100% 0%, #ffd9bd 0%, rgba(255, 217, 189, 0) 55%), var(--tint); }
.hero::after { content: ''; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%;
  border: 2px dashed rgba(255, 106, 19, .25); box-shadow: 0 0 0 60px rgba(255, 106, 19, .05), 0 0 0 120px rgba(255, 106, 19, .035); pointer-events: none; }
.hero-copy, .spotlight { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--brand-strong); font-weight: 600;
  background: var(--surface); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } .pcard a { transition: none; } }
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 3rem); margin: 0 0 12px; line-height: 1.2; }
.hero h1 em { font-style: normal; color: var(--brand); background: linear-gradient(transparent 70%, var(--brand-soft) 70%); }
.hero-search { display: flex; gap: 8px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  max-width: 560px; box-shadow: var(--shadow); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; padding: 0 14px; color: var(--ink); }
.hero-search input:focus { outline: none; }
.hero-search:focus-within { border-color: var(--brand); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* spotlight (live #1 product) */
.spotlight { display: flex; flex-direction: column; gap: 14px; padding: 18px; text-decoration: none; background: var(--surface);
  border-radius: 20px; border: 1px solid var(--line); border-top: 4px solid var(--brand); box-shadow: 0 30px 60px -36px rgba(201, 75, 8, .55); }
.spot-top { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; }
.spot-tag { background: var(--brand); color: var(--on-brand); font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.spot-main { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; }
.spot-main img, .spot-main .img-ph { width: 132px; height: 132px; border-radius: 14px; object-fit: cover; }
.spot-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .82rem; }
.spot-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .98rem; font-weight: 600; line-height: 1.45; }
.spot-price { font-size: 1.4rem; color: var(--brand-strong); margin-top: auto; }
.spot-stats { display: grid; grid-template-columns: auto 1fr 1fr; gap: 12px; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.spot-stats > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spot-stats small { color: var(--muted); font-size: .74rem; }
.spot-stats b { font-size: 1.15rem; }
.spot-score { flex-direction: row !important; align-items: center; gap: 8px !important; }
.spotlight:hover .spot-name { color: var(--brand-strong); }

/* pulse tiles */
.pulse-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.pulse { display: flex; flex-direction: column; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none; background: var(--surface); }
.pulse:hover { border-color: var(--brand); }
.pulse b { font-size: 1.5rem; font-weight: 600; color: var(--ink); }
.pulse span { font-size: .82rem; color: var(--muted); }
.pulse:first-child { background: var(--brand); border-color: var(--brand); }
.pulse:first-child b, .pulse:first-child span { color: var(--on-brand); }

/* sections */
.block { margin-bottom: 40px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 1.4rem; }
.block-head a { color: var(--brand-strong); text-decoration: none; font-weight: 500; white-space: nowrap; }
.steps ol { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.steps li { padding: 18px; border-radius: var(--radius); background: var(--tint); }
.steps p { margin: 6px 0 0; font-size: .9rem; }
.step-n { display: block; color: var(--brand); font-weight: 600; font-size: 1.3rem; margin-bottom: 4px; }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); margin: 0 0 2px; }
.page-head p { margin: 0; }

/* product page */
.crumbs { font-size: .86rem; margin-bottom: 12px; }
.crumbs a { color: var(--brand-strong); text-decoration: none; }
.product-head { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.product-img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--tint); }
.product-info h1 { font-size: clamp(1.1rem, 2.4vw, 1.5rem); margin: 0 0 6px; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 10px 0; font-family: var(--mono); }
.price { font-size: 1.9rem; font-weight: 600; color: var(--brand-strong); }
.discount { background: var(--brand); color: var(--on-brand); font-weight: 600; padding: 0 8px; border-radius: 999px; font-size: .85rem; }
.score-row { display: flex; gap: 14px; align-items: center; margin: 14px 0; padding: 12px; border-radius: 14px; background: var(--tint); }
.score-row p { margin: 0; }
.btn-buy { width: 100%; max-width: 360px; min-height: 52px; font-size: 1.04rem; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.fact, .card, .chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fact > span { font-size: .78rem; }
.fact strong { font-family: var(--mono); font-size: 1.3rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
.card { margin-bottom: 24px; }

/* prose (how-it-works) */
.prose { max-width: 780px; }
.prose h1 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.prose a { color: var(--brand-strong); }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--tint); font-size: .8rem; }
.table td:nth-child(2) { font-family: var(--mono); }

/* ── responsive (all pages) ── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 20px; gap: 22px; }
  .pulse-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catboard { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field-search, .filter-actions { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .rank-head { display: none; }
  .rank-row { grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) auto; row-gap: 10px; column-gap: 10px; padding: 12px;
    grid-template-areas: 'pos main main score' 'pos c1 c2 c2' 'pos c3 c4 c4'; }
  .rank-pos { grid-area: pos; align-self: start; padding-top: 14px; font-size: .86rem; text-align: left; }
  .rank-main { grid-area: main; }
  .cell-score { grid-area: score; align-self: start; }
  .c-sold { grid-area: c1; } .c-move { grid-area: c2; } .c-price { grid-area: c3; } .c-comm { grid-area: c4; }
  .rank-row > .cell { align-self: start; }
  .cell-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
    font-family: 'IBM Plex Sans Thai', sans-serif; font-size: .7rem; color: var(--muted); font-weight: 400; }
  .product-head { grid-template-columns: minmax(0, 1fr); }
  .product-img { max-width: 360px; margin: 0 auto; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .steps ol { grid-template-columns: minmax(0, 1fr); }
  .breakdown li { grid-template-columns: 120px 1fr 90px; }
}
@media (max-width: 640px) {
  .hero { padding: 22px 16px; border-radius: 18px; }
  .hero-search .btn { padding: 0 16px; }
  .pulse-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pulse:first-child { grid-column: 1 / -1; }
  .pulse b { font-size: 1.25rem; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions .btn { flex: 1; }
  .catboard a { grid-template-columns: 22px 44px minmax(0, 1fr); }
  .cb-score { grid-column: 2 / -1; }
  .spot-main { grid-template-columns: 96px minmax(0, 1fr); }
  .spot-main img, .spot-main .img-ph { width: 96px; height: 96px; }
  .spot-stats { grid-template-columns: auto 1fr 1fr; gap: 8px; }
  .spot-stats .gauge-lg { width: 60px; height: 60px; }
  .spot-stats .gauge-lg b { font-size: 1.1rem; }
  .spot-score small { display: none; }
  .block-head h2 { font-size: 1.2rem; }
}
@media (max-width: 420px) {
  .rank-main img, .rank-main .img-ph { width: 46px; height: 46px; }
  .breakdown li { grid-template-columns: 1fr 80px; }
  .bd-bar { grid-column: 1 / -1; grid-row: 2; }
  .brand small { display: none; }
}
