/* ============================================================
   TrustBro — Design System
   Trust me bro. We verify it.
   ============================================================ */

:root {
  --navy: #0B1F3A;
  --navy-700: #16335a;
  --navy-600: #1f4373;
  --yellow: #F5B400;
  --yellow-dark: #d89e00;
  --yellow-soft: #fff4d6;
  --lime: #c7f032;
  --lime-dark: #aee01a;
  --white: #FFFFFF;
  --bg: #F7F9FC;
  --bg-alt: #eef2f8;
  --text: #102033;
  --muted: #667085;
  --line: #e4e9f2;
  --green: #16a34a;
  --green-soft: #e7f6ec;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 51, 0.06), 0 1px 3px rgba(16, 32, 51, 0.05);
  --shadow: 0 4px 16px rgba(16, 32, 51, 0.08);
  --shadow-lg: 0 18px 50px rgba(11, 31, 58, 0.16);
  --maxw: 1160px;
  --header-h: 68px;

  --font: 'Noto Sans Thai', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Prompt', 'Noto Sans Thai', 'Inter', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.text-yellow { color: var(--yellow); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--yellow-dark);
}
.muted { color: var(--muted); }
.center { text-align: center; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 0.97rem;
  padding: 13px 22px; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: var(--navy); box-shadow: 0 6px 18px rgba(245, 180, 0, 0.35); }
.btn-primary:hover { background: var(--yellow-dark); box-shadow: 0 8px 22px rgba(245, 180, 0, 0.45); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); background: var(--white); }
.btn-ghost-light { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); color: var(--white); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.16); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 1.02rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--navy); }
/* Brand logo — angry-eyes mark + Trust(solid) / Bro(outline) wordmark */
.logo-eyes { display: flex; gap: 5px; align-items: flex-end; flex-shrink: 0; }
.logo-eyes .eye {
  position: relative; display: block; width: 16px; height: 16px;
  border: 2.5px solid var(--navy); border-radius: 50%;
  background: var(--white); overflow: hidden;
}
.logo-eyes .pupil { position: absolute; bottom: 1px; width: 6px; height: 6px; border-radius: 50%; background: var(--navy); }
.logo-eyes .brow  { position: absolute; top: -4px; left: -2px; width: 135%; height: 62%; background: var(--navy); }
.logo-eyes .eye.l .pupil { left: 2px; }
.logo-eyes .eye.l .brow  { transform: rotate(20deg); }
.logo-eyes .eye.r .pupil { right: 2px; }
.logo-eyes .eye.r .brow  { transform: rotate(-20deg); }
.logo-word { line-height: 1; }
.logo-word em { font-style: normal; color: transparent; -webkit-text-stroke: 1.6px var(--navy); }
/* footer variants (navy background) */
.site-footer .logo { color: #fff; }
.site-footer .logo-eyes .eye { border-color: #fff; background: var(--navy); }
.site-footer .logo-eyes .pupil, .site-footer .logo-eyes .brow { background: #fff; }
.site-footer .logo-word em { -webkit-text-stroke-color: #fff; }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 0.95rem; transition: color .14s; }
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; padding: 8px; color: var(--navy); }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Beta announcement bar ---------- */
/* แถบแจ้งช่วงทดลอง — วางเหนือ header, เลื่อนหายตามหน้าได้ (ไม่ sticky) */
.beta-bar {
  background: var(--navy);
  color: #e8eef6;
  border-bottom: 2px solid var(--yellow);
  font-size: 0.86rem;
  line-height: 1.45;
}
.beta-bar[hidden] { display: none; }
.beta-bar-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
}
.beta-bar .beta-flag {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.02em; color: var(--yellow);
  white-space: nowrap;
}
.beta-bar .beta-text { flex: 1 1 auto; min-width: 0; color: #cdd8e8; }
.beta-bar .beta-text strong { color: #fff; font-weight: 600; }
.beta-bar .beta-link {
  color: var(--yellow); font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
  white-space: nowrap;
}
.beta-bar .beta-link:hover { color: var(--yellow-dark); }
.beta-bar .beta-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  color: #cdd8e8; border-radius: 8px;
  width: 30px; height: 30px; min-width: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .14s ease, color .14s ease;
}
.beta-bar .beta-close:hover { background: rgba(255,255,255,0.16); color: #fff; }
.beta-bar .beta-close svg { width: 16px; height: 16px; }
@media (max-width: 600px) {
  .beta-bar { font-size: 0.8rem; }
  .beta-bar-inner { align-items: flex-start; gap: 10px; padding: 8px 0; }
  .beta-bar .beta-flag { padding-top: 1px; }
  .beta-bar .beta-close { width: 28px; height: 28px; min-width: 28px; }
}

/* ---------- Hero (navy) ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 85% 0%, #16335a 0%, var(--navy) 55%);
  color: var(--white);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .6; pointer-events: none;
}
.hero-inner { position: relative; padding: 72px 0 84px; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { color: var(--white); font-size: clamp(2.4rem, 6vw, 4rem); letter-spacing: -0.03em; }
.hero h1 .tm { display: block; color: var(--yellow); }
.hero .lead { font-size: 1.4rem; font-weight: 600; margin: 18px 0 6px; color: #e9eef6; }
.hero .sub { color: #aebbcd; font-size: 1.05rem; max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; color: #aebbcd; font-size: 0.9rem; }
.hero-trust b { color: var(--white); font-family: var(--display); font-size: 1.3rem; display: block; }

/* Hero visual card */
.hero-card {
  background: var(--white); color: var(--text); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow-lg); transform: rotate(1.2deg);
}
.hero-card .ph { height: 200px; border-radius: 14px; }
.hero-card .hc-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.hero-card h4 { font-size: 1.05rem; }
.hero-card .price { font-family: var(--display); font-weight: 700; color: var(--navy); }
.hero-card .price span { color: var(--muted); font-weight: 500; font-size: 0.85rem; }

/* ---------- Placeholders ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(45deg, rgba(11,31,58,0.04) 0 10px, rgba(11,31,58,0.07) 10px 20px),
    linear-gradient(135deg, #dfe7f2, #eef2f8);
  display: grid; place-items: center;
}
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0.04em; color: #7d8aa0;
  background: rgba(255,255,255,0.7); padding: 4px 10px; border-radius: 999px;
}
.ph-navy {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 10px, rgba(255,255,255,0.08) 10px 20px),
    linear-gradient(135deg, #16335a, #0B1F3A);
}
.ph-navy::after { background: rgba(255,255,255,0.12); color: #cdd8e8; }

/* ---------- Real images (drop-in replacement for .ph placeholders) ---------- */
/* product card media — fill the same fixed-height frame as the .ph it replaces */
.pc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* hero visual card image — matches .hero-card .ph (200px, rounded) */
.hero-card img.hc-img { height: 200px; width: 100%; border-radius: 14px; object-fit: cover; }
/* product gallery — main + thumbnails keep their .ph sizes */
.pd-gallery .main.img { height: 380px; border-radius: var(--radius); object-fit: cover; width: 100%; }
.pd-thumbs img { height: 78px; width: 100%; border-radius: var(--radius-sm); object-fit: cover; cursor: pointer; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d4ddec; }
.card .ico {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--yellow-soft); color: var(--yellow-dark); margin-bottom: 16px; font-size: 22px;
}
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.96rem; }

/* number chip for problem cards */
.num-chip {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy); color: var(--yellow); font-family: var(--display); font-weight: 700; margin-bottom: 16px;
}

/* solution small cards */
.feature {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.feature .ico { margin: 0; width: 42px; height: 42px; flex-shrink: 0; }
.feature h4 { font-size: 1rem; margin-bottom: 3px; }
.feature p { color: var(--muted); font-size: 0.88rem; }

/* categories */
.cat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.cat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 14px; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s; cursor: pointer;
}
.cat:hover { transform: translateY(-3px); border-color: var(--yellow); }
.cat .emoji { font-size: 30px; margin-bottom: 10px; }
.cat span { font-weight: 600; font-size: 0.92rem; }

/* how it works */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; box-shadow: var(--shadow-sm); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--yellow);
  display: block; margin-bottom: 10px;
}
.step h4 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-alt); color: var(--navy-600); border: 1px solid var(--line);
}
.badge svg { width: 13px; height: 13px; }
.badge-verified { background: var(--green-soft); color: #15803d; border-color: #c7ead2; }
.badge-smart { background: var(--yellow-soft); color: var(--yellow-dark); border-color: #f3e2ad; }
.badge-evidence { background: #eaf1ff; color: #2453c4; border-color: #cfdcfb; }

/* trust score pill */
.trust-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy); color: var(--white); border-radius: 999px;
  padding: 5px 12px 5px 7px; font-weight: 600; font-size: 0.84rem;
}
.trust-pill .score { background: var(--yellow); color: var(--navy); border-radius: 999px; padding: 2px 8px; font-family: var(--display); font-weight: 700; font-size: 0.82rem; }

/* ---------- Product cards ---------- */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #d4ddec; }
.pc-media { position: relative; height: 170px; }
.pc-media .ph { height: 100%; border-radius: 0; }
.pc-trust { position: absolute; top: 10px; right: 10px; }
.pc-cat { position: absolute; top: 10px; left: 10px; background: rgba(11,31,58,0.82); color: #fff; font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.pc-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pc-title { font-family: var(--display); font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.pc-loc { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 0.84rem; }
.pc-loc svg { width: 14px; height: 14px; }
.pc-price { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; }
.pc-price .day { font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--navy); }
.pc-price .day span { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.pc-deposit { font-size: 0.82rem; color: var(--muted); }
.pc-deposit b { color: var(--text); }
.pc-rating { display: inline-flex; align-items: center; gap: 4px; font-size: 0.84rem; font-weight: 600; color: var(--text); }
.pc-rating svg { width: 14px; height: 14px; color: var(--yellow); }
.pc-foot { margin-top: auto; padding-top: 4px; }

/* ---------- Marketplace toolbar ---------- */
.mkt-hero { background: var(--navy); color: #fff; padding: 48px 0 40px; }
.mkt-hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 2.8rem); }
.mkt-hero p { color: #aebbcd; margin-top: 10px; max-width: 560px; font-size: 1.05rem; }

.search-bar { display: flex; gap: 10px; margin-top: 26px; max-width: 620px; }
.search-bar .field { flex: 1; position: relative; }
.search-bar .field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search-bar input {
  width: 100%; padding: 15px 16px 15px 46px; border-radius: 999px; border: none;
  font-size: 1rem; background: #fff; color: var(--text);
}
.search-bar input:focus { outline: 3px solid rgba(245,180,0,0.5); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 20px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 600; font-size: 0.88rem; color: var(--muted);
  transition: all .14s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.select {
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 600; font-size: 0.88rem; color: var(--text); font-family: inherit;
}
.result-count { color: var(--muted); font-size: 0.9rem; margin-left: auto; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 6px; }
.empty-state p { color: var(--muted); }

/* ---------- Product detail ---------- */
.pd-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; padding: 36px 0 64px; }
.pd-gallery .main { height: 380px; border-radius: var(--radius); }
.pd-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.pd-thumbs .ph { height: 78px; cursor: pointer; }
.pd-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.pd-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; color: var(--muted); margin: 12px 0 18px; font-size: 0.92rem; }
.pd-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: #cbd3e0; }
.avail { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }
.avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.price-block { display: flex; gap: 28px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.price-block .pb { }
.price-block .pb small { color: var(--muted); font-size: 0.8rem; display: block; }
.price-block .pb b { font-family: var(--display); font-size: 1.45rem; color: var(--navy); }

/* แถบ "ดีลนี้ปลอดภัยยังไง" — สื่อสารการดูแล/หลักฐาน (ไม่ใช่การันตี) */
.deal-safety { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.deal-safety .ds-title { font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--navy); margin-bottom: 10px; }
.deal-safety .ds-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.deal-safety .ds-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: 0.8rem; line-height: 1.25; color: var(--text); font-weight: 600; }
.deal-safety .ds-ico { font-size: 1.5rem; line-height: 1; }

.trust-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; }
.trust-box h3 { color: #fff; font-size: 1.1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.trust-list { list-style: none; display: grid; gap: 11px; }
.trust-list li { display: flex; align-items: center; gap: 10px; color: #d6deea; font-size: 0.94rem; }
.trust-list li svg { width: 18px; height: 18px; color: var(--yellow); flex-shrink: 0; }

.booking-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.booking-box h3 { font-size: 1.15rem; margin-bottom: 16px; }

/* Forms */
.field-group { display: grid; gap: 6px; margin-bottom: 14px; }
.field-group label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.field-group input, .field-group select, .field-group textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 0.95rem; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .14s, box-shadow .14s;
}
.field-group input:focus, .field-group select:focus, .field-group textarea:focus {
  outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,180,0,0.18);
}
.field-group textarea { resize: vertical; min-height: 92px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; font-weight: 500; margin-bottom: 10px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--yellow); }

.calc-result { background: var(--bg); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; display: none; }
.calc-result.show { display: block; }
.calc-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; color: var(--muted); }
.calc-row b { color: var(--text); font-weight: 600; }
.calc-total { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 8px; border-top: 1.5px solid var(--line); font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--navy); }

/* ===== ปฏิทินไทย (แทน native date picker ที่โชว์ตาม locale เครื่อง) ===== */
.tbdate { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; transition: border-color .14s, box-shadow .14s; }
.tbdate:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245,180,0,0.18); }
.tbdate::after { content: '📅'; font-size: .95rem; }
.tbdate .ph { color: var(--muted); }
.tbcal-bd { position: fixed; inset: 0; z-index: 1099; background: transparent; display: none; }
.tbcal-bd.show { display: block; }
.tbcal { position: fixed; z-index: 1100; width: 280px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px -16px rgba(11,31,58,.4); padding: 12px; display: none; }
.tbcal.show { display: block; }
.tbcal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tbcal-h b { font-family: var(--display); font-weight: 700; color: var(--text); }
.tbcal-nav { border: 0; background: var(--bg-alt); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1.05rem; color: var(--text); }
.tbcal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.tbcal-dow span { text-align: center; font-size: .72rem; color: var(--muted); padding: 3px 0; }
.tbcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tbcal-d { aspect-ratio: 1; border: 0; background: none; border-radius: 9px; cursor: pointer; font: inherit; font-size: .9rem; color: var(--text); }
.tbcal-d:hover:not(:disabled) { background: var(--bg-alt); }
.tbcal-d.sel { background: var(--navy); color: #fff; font-weight: 700; }
.tbcal-d:disabled { color: var(--line); cursor: default; }
.tbcal-d.empty { visibility: hidden; }

/* owner section / condition */
.owner-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.owner-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: var(--yellow); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.3rem; flex-shrink: 0; }
.owner-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 4px; }
.owner-stats div small { color: var(--muted); font-size: 0.78rem; display: block; }
.owner-stats div b { font-family: var(--display); color: var(--navy); }

.cond-list { list-style: none; display: grid; gap: 9px; margin: 14px 0; }
.cond-list li { display: flex; align-items: center; gap: 10px; font-size: 0.94rem; }
.cond-list li svg { width: 17px; height: 17px; color: var(--green); flex-shrink: 0; }
.grade { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: #15803d; font-weight: 700; padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; }

/* ---------- Owner page ---------- */
.smart-preview { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; position: sticky; top: 88px; }
.smart-preview h3 { color: #fff; font-size: 1.15rem; margin-bottom: 4px; }
.smart-preview .sp-sub { color: #aebbcd; font-size: 0.88rem; margin-bottom: 18px; }
.sp-result { display: none; }
.sp-result.show { display: block; }
.sp-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.12); }
.sp-row:last-child { border-bottom: none; }
.sp-row small { color: #aebbcd; font-size: 0.82rem; display: block; }
.sp-row .sp-label { font-size: 0.92rem; color: #d6deea; }
.sp-row .sp-val { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--yellow); }
.sp-placeholder { text-align: center; color: #8d9bb2; padding: 30px 10px; }
.sp-placeholder .emoji { font-size: 40px; margin-bottom: 10px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--yellow), #ffcb3d); color: var(--navy); border-radius: var(--radius-lg); padding: 48px; text-align: center; }
.cta-band h2 { color: var(--navy); font-size: clamp(1.6rem, 4vw, 2.4rem); }
.cta-band p { font-size: 1.1rem; margin: 10px 0 22px; opacity: 0.85; }

/* waitlist */
.waitlist { background: var(--navy); border-radius: var(--radius-lg); padding: 44px; color: #fff; }
.waitlist-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; }
.waitlist h2 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.waitlist p { color: #aebbcd; margin-top: 10px; }
.waitlist-form { background: #fff; border-radius: var(--radius); padding: 26px; }
.radio-pills { display: flex; gap: 8px; }
.radio-pills label { flex: 1; }
.radio-pills input { position: absolute; opacity: 0; }
.radio-pills span { display: block; text-align: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 0.88rem; cursor: pointer; transition: all .14s; }
.radio-pills input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Auth pages (signup / login) ---------- */
.auth-card { max-width: 440px; margin: 0 auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow-sm); }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 6px 0 8px; }
.auth-head p { font-size: 0.95rem; }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.auth-google svg { width: 18px; height: 18px; flex: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-hint { font-size: 0.85rem; margin: -4px 0 12px; }
.auth-msg { display: none; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; }
.auth-msg.show { display: block; }
.auth-msg.info { background: var(--bg-alt); color: var(--navy-600); border: 1px solid var(--line); }
.auth-msg.success { background: #e7f7ec; color: #1c7a3e; border: 1px solid #bce6c9; }
.auth-msg.error { background: #fde8e8; color: #c0392b; border: 1px solid #f3c4c4; }
.auth-consent { display: flex; align-items: flex-start; gap: 9px; margin: 18px 0 4px; font-size: 0.85rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.auth-consent input { width: 17px; height: 17px; margin-top: 2px; flex: none; accent-color: var(--yellow); }
.auth-consent a { color: var(--yellow-dark); font-weight: 600; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 0.92rem; color: var(--muted); }
.auth-alt a { color: var(--yellow-dark); font-weight: 600; }
.btn-ghost-link { background: none; border: none; color: var(--muted); font-size: 0.85rem; text-decoration: underline; padding: 8px; width: 100%; cursor: pointer; margin-top: 4px; }
#recaptcha-container { margin: 4px 0; }

/* nav user state (เมื่อล็อกอินแล้ว) */
.nav-user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); font-size: 0.92rem; }
.nav-user .greet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* CTA สมัครสมาชิก (แทน Waitlist บนหน้าแรก) */
.join-cta { background: radial-gradient(120% 130% at 85% 0%, #16335a 0%, var(--navy) 60%); border-radius: var(--radius-lg); padding: 48px 44px; color: #fff; text-align: center; }
.join-cta .eyebrow { color: var(--yellow); }
.join-cta h2 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 8px 0 12px; }
.join-cta p { color: #aebbcd; max-width: 560px; margin: 0 auto 26px; font-size: 1.05rem; }
.join-cta .join-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #aebbcd; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.site-footer .logo { color: #fff; }
.footer-col h5 { color: #fff; font-family: var(--display); font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: grid; gap: 9px; }
.footer-col a { color: #aebbcd; font-size: 0.9rem; transition: color .14s; }
.footer-col a:hover { color: var(--yellow); }
.footer-tag { margin-top: 14px; color: #8d9bb2; font-size: 0.9rem; max-width: 280px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 22px; font-size: 0.86rem; }
.footer-bottom a { color: var(--yellow); }
.trust-me-bro { font-family: var(--display); font-weight: 600; color: #fff; }
.trust-me-bro span { color: var(--yellow); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-card { max-width: 420px; }
  .pd-layout { grid-template-columns: 1fr; gap: 28px; }
  .waitlist-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .products, .cols-4 { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .smart-preview { position: static; }
}

@media (max-width: 760px) {
  /* เมนู hamburger: ลิงก์ + ปุ่มเข้าสู่ระบบ/สมัคร อยู่ในแผง dropdown เดียวกัน
     (ปิดอยู่ = ซ่อนทั้งหมด เห็นแค่โลโก้ + hamburger; กันลูกค้าเก่าล็อกอินบนมือถือไม่ได้) */
  .nav { flex-wrap: wrap; position: relative; }
  .nav-links { display: none; }
  /* ตอนปิดเมนู: ซ่อนทั้งปุ่ม login/signup (guest) และ greet/logout (logged-in)
     ให้แถบบนเหลือแค่โลโก้ + hamburger */
  .nav-cta .btn-outline, .nav-cta .btn-primary, .nav-cta .nav-user { display: none; }
  /* hamburger ยึดมุมขวาบนของแถบ header เสมอ (ทั้งตอนเปิด/ปิด)
     ใช้ absolute เพื่อไม่ให้ถูกลากลงไปกับ .nav-cta ตอนเมนูกาง */
  .nav-toggle {
    display: inline-flex; position: absolute; top: 0; right: 0;
    height: var(--header-h); align-items: center; z-index: 3;
  }

  /* เปิดเมนู: nav-links กับ nav-cta ดรอปลงมาเต็มความกว้าง ไหลต่อกันตามธรรมชาติ
     (ไม่ใช้ absolute/คำนวณ margin — แผงสูงตามเนื้อหาเอง) */
  .nav.open .nav-links {
    display: flex; flex-direction: column; align-items: stretch;
    width: 100%; order: 3; gap: 2px;
    margin: 12px -20px 0; padding: 8px 20px 4px;
    background: #fff; border-top: 1px solid var(--line);
  }
  .nav.open .nav-links a {
    padding: 12px 2px; width: 100%; font-size: 1.05rem;
    min-height: 44px; display: flex; align-items: center;
  }
  .nav.open .nav-cta {
    width: 100%; order: 4; align-items: stretch; gap: 10px;
    margin: 0 -20px; padding: 6px 20px 16px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav.open .nav-cta .btn-outline,
  .nav.open .nav-cta .btn-primary {
    display: inline-flex; width: 100%; justify-content: center;
    min-height: 46px; font-size: 1.02rem;
  }
  /* ผู้ใช้ที่ล็อกอินแล้ว: โชว์ชื่อหัวแผงก่อนปุ่มออกจากระบบ */
  .nav.open .nav-cta .nav-user {
    display: flex; width: 100%; padding: 6px 2px 2px;
    font-size: 0.95rem; max-width: none;
  }
  .nav.open .nav-cta .nav-user .greet { max-width: none; }
  .section { padding: 48px 0; }
  .grid.cols-3, .steps, .grid.cols-2 { grid-template-columns: 1fr; }
  .products, .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .waitlist, .cta-band, .smart-preview, .join-cta { padding: 28px 22px; }
  .auth-card { padding: 28px 22px; }
  .join-cta .join-actions .btn { flex: 1; }
  .price-block { gap: 18px; flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; }
  .result-count { width: 100%; margin-left: 0; }
  .hero-inner { padding: 44px 0 52px; }
}

@media (max-width: 460px) {
  .products, .cols-4 { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pc-body { padding: 13px; }
  .pc-title { font-size: 0.94rem; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions .btn { flex: 1; }
}

/* fade-in — only hide when JS is available to reveal it (.has-js on <html>).
   No JS / JS disabled = no .has-js = content stays fully visible (fail-safe). */
.has-js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.has-js .reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Round 1 — trust hardening, a11y, mobile nav support
   ============================================================ */

/* ---------- Eyebrow contrast (a11y): เข้มพอผ่าน WCAG AA บนพื้นสว่าง ----------
   (eyebrow บนพื้น navy ใน hero/mkt-hero/join ถูก override เป็นเหลืองสดด้วย inline/rule อยู่แล้ว) */
.eyebrow { color: #9a6f00; }

/* ---------- Hero trust: คำมั่นเชิงระบบ (แทนสถิติผู้ใช้ปลอม) ---------- */
.hero-trust {
  list-style: none; display: flex; flex-direction: column;
  gap: 11px; margin-top: 30px; padding: 0;
}
.hero-trust li {
  display: flex; align-items: center; gap: 10px;
  color: #dbe4f0; font-size: 0.98rem; font-weight: 500;
}
.hero-trust li svg {
  width: 19px; height: 19px; flex-shrink: 0;
  color: var(--lime); /* เครื่องหมายถูกสีไลม์ตัดกับพื้น navy ชัด */
}

/* badge "เปิดรับเจ้าของรุ่นแรก" — จริงตั้งแต่วันแรก ไม่ใช่ตัวเลขปลอม */
.hero-firstbatch {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 22px; padding: 8px 16px;
  background: rgba(199, 240, 50, 0.12);
  border: 1px solid rgba(199, 240, 50, 0.4);
  border-radius: 999px;
  color: #eaf6c9; font-size: 0.9rem; font-weight: 600;
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lime); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(199, 240, 50, 0.55);
  animation: dotLivePulse 2s ease-out infinite;
}
@keyframes dotLivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(199, 240, 50, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(199, 240, 50, 0); }
  100% { box-shadow: 0 0 0 0 rgba(199, 240, 50, 0); }
}

/* ---------- Owner avatar (verified mark แทนอักษรปลอม) ---------- */
.owner-avatar-verified { background: var(--navy); }
.owner-avatar-verified svg { width: 30px; height: 30px; color: var(--lime); }

/* ---------- a11y: focus-visible ring ทั่วเว็บ (คีย์บอร์ดเห็นตำแหน่งชัด) ---------- */
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 4px;
}
/* ปุ่ม/ลิงก์บนพื้น navy ให้ใช้ไลม์ตัดกับพื้นเข้มชัดกว่า */
.hero :focus-visible,
.mkt-hero :focus-visible,
.site-footer :focus-visible,
.join-cta :focus-visible {
  outline-color: var(--lime);
}
/* เมาส์คลิกไม่ต้องมี ring (เฉพาะ keyboard) */
:focus:not(:focus-visible) { outline: none; }

/* ---------- a11y: เคารพ prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .has-js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .dot-live { animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
