/* =========================================================
   Car Dealer — Frontend inspired by GearShift template
   Public: light + orange accent | Admin: dark panel
   ========================================================= */

:root {
  --orange: #ff6a00;
  --orange-hover: #e85f00;
  --orange-soft: rgba(255, 106, 0, .12);
  --ink: #111827;
  --ink-2: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-muted: #f3f4f6;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(17, 24, 39, .08);
  --shadow-lg: 0 20px 50px rgba(17, 24, 39, .12);
  --font: "Sarabun", "Segoe UI", Tahoma, sans-serif;
  --container: 1180px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
.container {
  width: min(var(--container), 92%);
  margin: 0 auto;
}
.text-accent { color: var(--orange); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 10px;
  padding: .7rem 1.15rem;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: .15s ease;
}
.btn:disabled,
.btn.is-busy {
  opacity: .72;
  cursor: wait;
  pointer-events: none;
}
.btn-primary, .btn-success {
  background: var(--orange);
  color: #fff !important;
}
.btn-primary:hover, .btn-success:hover {
  background: var(--orange-hover);
  color: #fff !important;
  filter: none;
}
.btn-outline {
  background: transparent;
  color: var(--ink) !important;
  border: 1.5px solid var(--line);
}
.btn-outline:hover {
  border-color: var(--orange);
  color: var(--orange) !important;
}
.btn-outline-light {
  background: transparent;
  color: #fff !important;
  border: 1.5px solid rgba(255,255,255,.55);
}
.btn-outline-light:hover {
  background: rgba(255,255,255,.1);
  color: #fff !important;
}
.btn-secondary {
  background: var(--bg-muted);
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange) !important; }
/* ปุ่มโทร / LINE — ไอคอน+ข้อความแบบหน้าต่างลอย */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff !important;
  border: 0;
  min-height: 44px;
  padding: .65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.btn-cta__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-cta__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}
.btn-cta.is-phone {
  background: var(--orange, #ff6a00);
}
.btn-cta.is-phone:hover {
  background: var(--orange-hover, #e85f00);
  color: #fff !important;
}
.btn-cta.is-line {
  background: #06c755;
}
.btn-cta.is-line:hover {
  background: #05a847;
  color: #fff !important;
}
.btn-cta.is-muted {
  background: var(--bg-muted, #f3f4f6);
  color: var(--ink, #111) !important;
  border: 1px solid var(--line, #e5e7eb);
  box-shadow: none;
}
.btn-cta.is-muted:hover {
  border-color: var(--orange, #ff6a00);
  color: var(--orange, #ff6a00) !important;
  background: #fff;
}
.btn-danger { background: #ef4444; color: #fff !important; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: 8px; }

/* Header — อ่านง่ายทุกธีม (พื้นขาว + ตัวเข้ม / บน hero ตัวขาว) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  box-shadow: 0 1px 0 rgba(17, 24, 39, .04);
}
/* หน้า hero: แถบมืดบางๆ ให้อ่านตัวขาวชัด ไม่พึ่งสีธีม */
.site-header--transparent {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, .62) 0%,
    rgba(0, 0, 0, .38) 55%,
    rgba(0, 0, 0, .12) 100%
  );
  border-bottom: 0;
  box-shadow: none;
}
.site-header--transparent .logo-text,
.site-header--transparent .nav > a {
  color: #fff;
}
/* บน hero: hover/active เป็นขาวบนพื้นโปร่ง — ใช้ได้ทุกธีม */
.site-header--transparent .nav > a:hover,
.site-header--transparent .nav > a.is-active {
  color: #fff !important;
  background: rgba(255, 255, 255, .18);
}
/* เลื่อนแล้วพื้นขาว — เฉพาะหน้า public */
body.is-public .site-header.is-scrolled,
body.is-public .site-header--transparent.is-scrolled {
  background: rgba(255, 255, 255, .99);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 22px rgba(17, 24, 39, .08);
}
body.is-public .site-header.is-scrolled .logo-text,
body.is-public .site-header.is-scrolled .nav > a,
body.is-public .site-header--transparent.is-scrolled .logo-text,
body.is-public .site-header--transparent.is-scrolled .nav > a {
  color: #111827;
  text-shadow: none;
}
body.is-public .site-header.is-scrolled .nav > a:hover,
body.is-public .site-header.is-scrolled .nav > a.is-active,
body.is-public .site-header--transparent.is-scrolled .nav > a:hover,
body.is-public .site-header--transparent.is-scrolled .nav > a.is-active {
  color: var(--orange) !important;
  background: var(--orange-soft);
}
body.is-public .site-header.is-scrolled .nav-toggle,
body.is-public .site-header--transparent.is-scrolled .nav-toggle {
  color: #111827;
  background: rgba(17, 24, 39, .05);
  border-color: var(--line);
}
body.is-admin .site-header.is-scrolled {
  background: rgba(15,20,25,.98);
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
/* เว้นที่ให้เนื้อหาไม่โดนเมนูบัง (ยกเว้น hero ที่มี padding ของตัวเอง) */
body.is-public .site-main {
  padding-top: var(--header-h);
}
body.is-public.page-home .site-main {
  padding-top: 0;
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
/* ชื่อ Dealer / โลโก้ จาก config */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: min(58vw, 16rem);
  font-family: "Sarabun", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none !important;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  min-width: 0;
}
.site-brand:hover {
  color: var(--orange);
}
.site-brand__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1.2;
}
/* ไม่มีโลโก้: ตัวอักษรแรกบนพื้นธีม + ชื่อ (ใช้ได้ทุกธีม) */
.site-brand--text .site-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--orange);
  color: #fff !important;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
  text-shadow: none;
}
.site-brand--text:hover .site-brand__mark {
  background: var(--orange-hover);
  color: #fff !important;
}
.site-brand--text .site-brand__name {
  color: #111827;
  font-weight: 800;
}
.site-brand--text:hover .site-brand__name {
  color: var(--orange);
}
.site-brand__logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(72vw, 17.5rem);
  object-fit: contain;
  object-position: left center;
}
.site-brand--has-logo {
  position: relative;
  max-width: min(74vw, 18rem);
  gap: 0;
  overflow: visible;
}
.site-brand__logo--on-light {
  display: none;
  height: 42px;
}
/* บน hero (โปร่งใส): ชื่อขาว · mark คงสีธีม */
body.is-public .site-header--transparent .site-brand {
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
  opacity: 1;
}
body.is-public .site-header--transparent .site-brand--text .site-brand__name {
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
body.is-public .site-header--transparent .site-brand--text .site-brand__mark {
  background: var(--orange);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  text-shadow: none;
}
body.is-public .site-header--transparent .site-brand--text:hover .site-brand__name {
  color: #fff !important;
  opacity: .92;
}
body.is-public .site-header--transparent .site-brand--text:hover .site-brand__mark {
  background: var(--orange-hover);
  color: #fff !important;
}
/* เลื่อนลง / หัวขาว: ชื่อเข้ม · mark ธีม */
body.is-public .site-header--transparent.is-scrolled .site-brand,
body.is-public .site-header.is-scrolled .site-brand {
  color: #111827;
  text-shadow: none;
  opacity: 1;
}
body.is-public .site-header--transparent.is-scrolled .site-brand--text .site-brand__name,
body.is-public .site-header.is-scrolled .site-brand--text .site-brand__name {
  color: #111827 !important;
  text-shadow: none;
}
body.is-public .site-header--transparent.is-scrolled .site-brand--text:hover .site-brand__name,
body.is-public .site-header.is-scrolled .site-brand--text:hover .site-brand__name {
  color: var(--orange) !important;
}
body.is-public .site-header--transparent.is-scrolled .site-brand--text .site-brand__mark,
body.is-public .site-header.is-scrolled .site-brand--text .site-brand__mark {
  box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
}
/* ชื่อทองโปร่งใสบน hero มืด */
body.is-public .site-header--transparent .site-brand--has-logo {
  text-shadow: none;
  padding: 0;
  background: transparent;
}
body.is-public .site-header--transparent:not(.is-scrolled) .site-brand__logo--on-dark {
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}
body.is-public .site-header--transparent:not(.is-scrolled) .site-brand__logo--on-light {
  display: none;
}
/* พื้นขาว: โลโก้แถบแดงตามต้นฉบับ */
body.is-public .site-header:not(.site-header--transparent) .site-brand__logo--on-dark,
body.is-public .site-header.is-scrolled .site-brand__logo--on-dark {
  display: none;
}
body.is-public .site-header:not(.site-header--transparent) .site-brand__logo--on-light,
body.is-public .site-header.is-scrolled .site-brand__logo--on-light {
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .18));
}
body.is-public .site-header--transparent.is-scrolled .site-brand--has-logo {
  background: transparent;
  padding: 0;
}
@media (max-width: 640px) {
  .site-brand__logo {
    height: 34px;
    max-width: min(70vw, 14rem);
  }
  .site-brand__logo--on-light {
    height: 32px;
  }
  .site-brand--text .site-brand__mark {
    width: 1.85rem;
    height: 1.85rem;
    font-size: .88rem;
    border-radius: 9px;
  }
  .site-brand--text {
    font-size: 1rem;
    gap: .45rem;
    max-width: min(52vw, 12rem);
  }
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none !important;
}
.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.logo-text { font-size: 1.05rem; }
.nav {
  display: flex;
  align-items: center;
  gap: .35rem;
}
/* ลิงก์เมนู — ไทยอ่านง่าย ไม่บังคับ uppercase */
.nav > a {
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
  color: #1f2937;
  text-decoration: none !important;
  padding: .42rem .7rem;
  border-radius: 999px;
  line-height: 1.25;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.nav > a:hover {
  color: var(--orange);
  background: var(--orange-soft);
}
.nav > a.is-active {
  color: var(--orange);
  background: var(--orange-soft);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .08);
}
/* Desktop */
@media (min-width: 861px) {
  body.is-public .nav {
    gap: .4rem;
  }
  body.is-public .nav > a {
    font-size: .98rem;
    font-weight: 700;
    letter-spacing: .01em;
    padding: .45rem .78rem;
  }
  body.is-public .header-cta {
    font-size: .92rem !important;
    margin-left: .35rem;
  }
  body.is-public .site-brand {
    font-size: 1.12rem;
  }
}
/* ปุ่มโทร — ขาวบนสีธีม ชัดทุกโทน */
body.is-public .header-cta.btn-primary {
  background: var(--orange) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 4px 14px rgba(17, 24, 39, .16);
}
body.is-public .header-cta.btn-primary:hover {
  background: var(--orange-hover) !important;
  color: #fff !important;
}
.header-cta {
  text-transform: none;
  letter-spacing: .01em;
  font-size: .88rem !important;
  font-weight: 700 !important;
  gap: .4rem;
  white-space: nowrap;
}
.header-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.header-cta__icon svg {
  display: block;
  width: 1em;
  height: 1em;
}
.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  color: #111827;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.site-header--transparent .nav-toggle {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .22);
}
.site-header--transparent .nav-toggle:hover {
  background: rgba(255, 255, 255, .22);
}

/* มือถือ: แผงเมนูพื้นขาวตัวเข้มเสมอ — อ่านง่ายทุกธีม */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  body.is-public .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff !important;
    flex-direction: column;
    align-items: stretch;
    padding: .65rem .75rem .85rem;
    gap: .2rem;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
    display: none;
  }
  body.is-public .nav.is-open { display: flex; }
  body.is-public .nav > a {
    padding: .8rem .85rem !important;
    color: #111827 !important;
    text-transform: none;
    letter-spacing: .01em;
    font-size: 1rem !important;
    font-weight: 700;
    border-radius: 10px;
    background: transparent;
  }
  body.is-public .nav > a:hover,
  body.is-public .nav > a.is-active {
    color: var(--orange) !important;
    background: var(--orange-soft) !important;
    box-shadow: none;
  }
  body.is-public .header-cta {
    margin-top: .45rem;
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }
  /* ยกเลิกพื้นดำบน transparent เดิม — ใช้ขาวอ่านง่าย */
  body.is-public .site-header--transparent .nav {
    background: #fff !important;
  }
  body.is-public .site-header--transparent .nav > a {
    color: #111827 !important;
  }
}

/* Hero
 * รูปปก/สไลด์ส่วนใหญ่เป็นแนวนอน (~3:2 หรือ 16:9) — เลิกใช้ความสูง 86vh
 * ที่ทำให้ crop ภาพมากเกินไป
 */
.hero {
  position: relative;
  /* สัดส่วนใกล้ 16:9 ของความกว้างจอ · จำกัดช่วงความสูงให้อ่านข้อความได้ */
  height: clamp(280px, 42vw, 520px);
  min-height: 280px;
  max-height: min(520px, 70vh);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(105deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.4) 50%, rgba(0,0,0,.45) 100%),
    var(--hero-image) center center / cover no-repeat;
  color: #fff;
  padding: calc(var(--header-h) + 1.25rem) 0 2.25rem;
  text-align: center;
  overflow: hidden;
}
/* Hero หน้ารถ / หน้าย่อย — เตี้ยกว่าหน้าแรก */
.hero--compact {
  height: clamp(200px, 32vw, 340px);
  min-height: 200px;
  max-height: 340px;
  padding: calc(var(--header-h) + 1rem) 0 1.75rem;
}
.hero--compact .hero__title {
  font-size: clamp(1.35rem, 3.2vw, 2.15rem);
  margin-bottom: 1rem;
}
.hero--compact .hero__actions .btn-lg {
  padding: .7rem 1.15rem;
  font-size: .95rem;
}
.page-detail .detail-wrap {
  padding-top: 1.5rem;
}
/* หน้า buy-car: รูปสไลด์ 1920×1080 (16:9) */
.page-buy-car .hero:not(.hero--compact) {
  height: clamp(260px, 42vw, 540px);
  max-height: min(540px, 68vh);
}
@media (max-width: 640px) {
  .hero {
    height: clamp(240px, 58vw, 360px);
    max-height: 360px;
    padding: calc(var(--header-h) + .85rem) 0 1.75rem;
  }
  .hero--compact {
    height: clamp(180px, 48vw, 280px);
    min-height: 180px;
    max-height: 280px;
    padding: calc(var(--header-h) + .75rem) 0 1.35rem;
  }
  .hero--compact .hero__title {
    font-size: clamp(1.15rem, 5vw, 1.55rem);
  }
  .page-buy-car .hero:not(.hero--compact) {
    height: clamp(220px, 56vw, 360px);
    max-height: 360px;
  }
}
/* ไม่มีรูปปก — พื้นเทา */
.hero--no-image {
  background:
    linear-gradient(105deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.25) 100%),
    linear-gradient(135deg, #6b7280 0%, #9ca3af 45%, #4b5563 100%);
}
/* สไลด์ 2–4 รูป */
.hero--slider {
  background: #1a1a1a;
}
.hero__slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide.is-active {
  opacity: 1;
  z-index: 1;
}
.hero--slider .hero__overlay,
.hero:not(.hero--no-image) .hero__overlay {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  /* ดำ + โทนธีมบางๆ ให้อารมณ์เข้ากับแบรนด์ */
  background:
    linear-gradient(105deg, rgba(0, 0, 0, .52) 0%, rgba(0, 0, 0, .38) 50%, rgba(0, 0, 0, .42) 100%),
    linear-gradient(105deg, var(--orange-soft), var(--orange-soft));
}
.hero__overlay { display: none; }
.hero__dots {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: .45rem;
}
.hero__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: .2s ease;
}
.hero__dot.is-active {
  background: var(--orange);
  transform: scale(1.2);
}
.hero__dot:hover {
  background: rgba(255,255,255,.75);
}
.hero__content {
  position: relative;
  z-index: 3;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.hero__title {
  font-size: clamp(1.55rem, 3.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 1.15rem;
  letter-spacing: -.02em;
  color: #fff;
  /* เงาหลายชั้น — ดูมีมิติ / 3D */
  text-shadow:
    0 1px 0 rgba(255,255,255,.12),
    0 2px 0 rgba(0,0,0,.15),
    0 3px 0 rgba(0,0,0,.12),
    0 4px 0 rgba(0,0,0,.1),
    0 6px 8px rgba(0,0,0,.35),
    0 12px 24px rgba(0,0,0,.45),
    0 0 40px rgba(0,0,0,.25);
}
/* หน้าแรก + รถทั้งหมด: ข้อความ hero ขนาด/ระยะบรรทัดเดียวกัน */
/* ทุกหน้า home-hero: line-height 1.5 */
body.is-public .hero .hero__title {
  line-height: 1.5;
}
body.is-public.page-home:not(.page-detail):not(.page-buy-car):not(.page-contact):not(.page-finance)
  .hero .hero__title,
body.is-public.page-cars .hero .hero__title {
  font-size: clamp(1.2rem, 2.9vw, 2.05rem);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 700;
}
body.is-public.page-home:not(.page-detail):not(.page-buy-car):not(.page-contact):not(.page-finance)
  .hero .hero__title .text-accent,
body.is-public.page-cars .hero .hero__title .text-accent {
  font-size: 1.05em; /* ชื่อร้านใหญ่กว่าบรรยายเล็กน้อย */
}
/* กัน hero--compact บน cars.html ไปลดขนาดตัวหนังสือต่างจาก index */
body.is-public.page-cars .hero--compact .hero__title {
  font-size: clamp(1.2rem, 2.9vw, 2.05rem);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-weight: 700;
}
@media (max-width: 640px) {
  body.is-public.page-home:not(.page-detail):not(.page-buy-car):not(.page-contact):not(.page-finance)
    .hero .hero__title,
  body.is-public.page-cars .hero .hero__title,
  body.is-public.page-cars .hero--compact .hero__title {
    font-size: clamp(1.05rem, 4.4vw, 1.4rem);
    line-height: 1.5;
  }
}
/*
 * Home-hero ทุกหน้า · ทุกธีม:
 * - ตัวหนังสือขาวทั้งหมด
 * - ไม่มีพื้น/กรอบ/ป้ายที่บรรทัด accent
 */
body.is-public .hero .hero__title,
body.is-public .hero .hero__title .text-accent,
body.is-public .hero .text-accent,
body.is-public .hero .hero__lead,
body.is-public .hero .hero__content,
body.is-public .hero .hero__content p {
  color: #fff !important;
}
.hero__title {
  color: #fff !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .45),
    0 2px 10px rgba(0, 0, 0, .35);
}
.hero__title .text-accent,
.hero .text-accent {
  display: inline;
  color: #fff !important;
  background: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, .45),
    0 2px 10px rgba(0, 0, 0, .35);
  line-height: inherit;
}
.hero__lead {
  font-size: 1.05rem;
  color: #fff !important;
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.hero__content {
  color: #fff !important;
}
.hero__content p {
  color: #fff !important;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
}

/* ลูกค้ารับรถ — social proof */
/* หน้าแรก: เกือบติดรายการรถ ลดช่องว่างขาว */
.page-home #fleet.section:has(+ .customers-home) {
  padding-bottom: .7rem;
}
.page-home .customers-home.section {
  padding-top: calc(.55rem + 10px);
  padding-bottom: 2.25rem;
}
/* หน้าแรก: บทความเกือบติดภาพส่งมอบ — ใช้ระยะเดียวกับ fleet→customers */
.page-home .customers-home.section:has(+ .articles-home) {
  padding-bottom: .7rem;
}
.page-home .articles-home.section {
  padding-top: calc(.55rem + 10px);
  padding-bottom: 2.25rem;
}
.page-home .customers-home .section-head,
.page-home .articles-home .section-head {
  margin-bottom: .9rem;
  align-items: center;
}
.page-home .customers-home .section-title {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.35;
  max-width: 42rem;
}
.page-home .articles-home .section-title {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.35;
}
.page-home .articles-home .section-meta {
  margin: .2rem 0 0;
  font-size: .92rem;
  line-height: 1.45;
}
.customers-home__lead {
  margin: -.75rem 0 1.15rem;
  font-size: .98rem;
}
.customers-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.customers-grid--home {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.customers-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius, 14px);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.customers-card__link {
  display: block;
  color: inherit;
  text-decoration: none !important;
}
.customers-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #111;
  overflow: hidden;
}
/* สไลด์หลายรูป — ทุกใบ absolute ซ้อนกัน สลับด้วย is-active */
.customers-card__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 0;
  transition: opacity .28s ease, visibility .28s ease;
}
.customers-card__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  pointer-events: auto;
}
.customers-card__media > img:not(.customers-card__slide) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.customers-card__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.customers-card__nav--prev { left: .45rem; }
.customers-card__nav--next { right: .45rem; }
.customers-card__nav:hover,
.customers-card__nav:focus-visible {
  background: var(--orange);
  outline: none;
}
.customers-card__count {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  z-index: 5;
  font-size: .78rem;
  font-weight: 800;
  padding: .22rem .5rem;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  pointer-events: none;
}
.customers-card__cap {
  padding: .7rem .8rem .8rem;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-2);
}
.customers-page .section-title {
  margin: 0;
}
@media (max-width: 1000px) {
  .customers-grid,
  .customers-grid--home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .customers-grid,
  .customers-grid--home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
  }
  .customers-card__cap {
    font-size: .82rem;
    padding: .55rem .6rem .65rem;
  }
  .page-home .customers-home .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    margin-bottom: .75rem;
  }
  .page-home .customers-home .section-title {
    font-size: .92rem;
    line-height: 1.4;
    letter-spacing: 0;
    max-width: none;
    font-weight: 700;
  }
}
@media (max-width: 480px) {
  .page-home .customers-home .section-title {
    font-size: .84rem;
    line-height: 1.45;
  }
}

/* ข้อความหน้าแรก (จาก dealer_config.home_intro) */
.home-intro {
  background: transparent;
  border: 0;
  padding: 1.5rem 0 .4rem;
  margin-top: -1px;
}
/* หัวข้อรถแนะนำ เกือบติดข้อความหน้าแรก */
.home-intro + .section {
  padding-top: .55rem;
}
.home-intro__body {
  width: 100%;
  max-width: none;
  margin: 0;
  text-align: center;
  color: var(--ink);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 500;
  line-height: 1.7;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.6rem 1.45rem;
  box-sizing: border-box;
}
.home-intro__body p {
  margin: 0 0 .85rem;
}
.home-intro__body p:last-child {
  margin-bottom: 0;
}
@media (max-width: 640px) {
  .home-intro {
    padding: 1.15rem 0 .3rem;
  }
  .home-intro + .section {
    padding-top: .45rem;
  }
  .home-intro__body {
    font-size: 1.08rem;
    text-align: left;
    padding: 1.1rem 1.05rem 1.15rem;
  }
}

/* Sections */
.section { padding: 3.5rem 0; }
.section--muted { background: var(--bg-soft); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.section-link {
  color: var(--orange) !important;
  font-weight: 600;
  font-size: .95rem;
}

/* Admin stats — mobile-first */
body.is-admin .admin-top--stats {
  margin-bottom: .65rem;
}
.stats-period {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .35rem;
  margin: 0 0 1rem;
  padding: .3rem;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stats-period__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: .4rem .35rem;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none !important;
  transition: .15s ease;
  touch-action: manipulation;
}
.stats-period__btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .04);
}
.stats-period__btn.is-active {
  background: var(--orange);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(255, 106, 0, .28);
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .55rem;
  margin-bottom: 1rem;
}
.stats-card {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .7rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stats-card__ico {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 106, 0, .12);
  font-size: 1rem;
}
.stats-card--phone .stats-card__ico {
  background: rgba(34, 197, 94, .12);
}
.stats-card--audio .stats-card__ico {
  background: rgba(99, 102, 241, .14);
}
.stats-card__body {
  min-width: 0;
  flex: 1;
}
.stats-card__label {
  font-size: .78rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}
.stats-card__num {
  font-size: clamp(1.25rem, 4.5vw, 1.85rem);
  font-weight: 800;
  color: var(--orange);
  line-height: 1.15;
  margin: .15rem 0 .1rem;
  letter-spacing: -.02em;
  word-break: break-all;
}
.stats-card--phone .stats-card__num { color: #4ade80; }
.stats-card--audio .stats-card__num { color: #a5b4fc; }
.stats-card__hint {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.3;
}
.stats-panel {
  margin-bottom: 1rem;
  overflow: hidden;
}
.stats-panel__title {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}
.stats-panel__sub {
  margin: 0 0 .75rem;
  font-size: .85rem;
}
.stats-daily-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -.15rem;
  padding: 0 .15rem .15rem;
}
.stats-daily-table {
  width: 100%;
  min-width: 0;
  font-size: .9rem;
}
.stats-daily-table th,
.stats-daily-table td {
  white-space: nowrap;
  padding: .5rem .55rem;
}
.stats-daily-date {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.stats-rank-table-wrap {
  display: block;
}
.stats-rank-cards {
  display: none;
}
.stats-rank-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-muted);
  padding: .85rem .8rem;
  margin-bottom: .7rem;
}
.stats-rank-card:last-of-type {
  margin-bottom: 0;
}
.stats-rank-card__rank {
  position: absolute;
  top: .65rem;
  right: .7rem;
  font-size: .8rem;
  font-weight: 800;
  color: var(--orange);
  background: rgba(255, 106, 0, .12);
  border-radius: 999px;
  padding: .15rem .5rem;
}
.stats-rank-card__main {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .65rem;
  align-items: start;
  padding-right: 2.75rem;
}
.stats-rank-card__cover {
  width: 4.5rem;
  height: 3.35rem;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid var(--line);
}
.stats-rank-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stats-rank-card__ph {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.stats-rank-card__title {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.stats-rank-card__price {
  margin: .2rem 0 .35rem;
  font-size: .82rem;
}
.stats-rank-card__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.stats-rank-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin-top: .75rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
}
.stats-metric {
  text-align: center;
  min-width: 0;
  padding: .4rem .25rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}
.stats-metric__label {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .15rem;
}
.stats-metric__val {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stats-rank-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
  margin-top: .7rem;
}
.stats-rank-card__actions .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  min-height: 2.35rem;
}
.stats-footnote {
  margin: .85rem 0 0;
  font-size: .82rem;
  line-height: 1.45;
}

@media (max-width: 700px) {
  .stats-cards {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .stats-card {
    padding: .7rem .75rem;
  }
  .stats-card__hint {
    display: none; /* มือถือสั้นลง อ่านจาก label พอ */
  }
  .stats-card__num {
    font-size: 1.45rem;
  }
  .stats-period {
    position: sticky;
    top: calc(var(--admin-topbar-h, 60px) + .15rem);
    z-index: 18;
    margin-bottom: .85rem;
  }
  .stats-period__btn {
    font-size: .8rem;
    min-height: 2.55rem;
  }
  .stats-rank-table-wrap {
    display: none !important;
  }
  .stats-rank-cards {
    display: block;
  }
  .stats-panel {
    padding: .9rem .75rem 1rem;
    border-radius: 12px;
  }
  .stats-daily-table {
    min-width: 18rem;
    font-size: .85rem;
  }
}

@media (min-width: 701px) and (max-width: 960px) {
  .stats-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-card__hint {
    font-size: .7rem;
  }
}

@media (max-width: 380px) {
  .stats-period__btn {
    font-size: .74rem;
    padding: .35rem .2rem;
  }
  .stats-rank-card__main {
    grid-template-columns: 3.85rem minmax(0, 1fr);
    padding-right: 2.4rem;
  }
  .stats-rank-card__cover {
    width: 3.85rem;
    height: 2.9rem;
  }
  .stats-metric__val {
    font-size: .95rem;
  }
}

/* หน้ารวมรถ + pagination */
.page-cars .cars-page {
  padding-top: 1.75rem;
  padding-bottom: 3rem;
  background: var(--bg);
}
.cars-page {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}
.cars-page .section-head,
.cars-page__head {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.cars-page__head-text {
  min-width: 0;
  flex: 1 1 auto;
}
.cars-page .section-title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.section-meta {
  margin: .25rem 0 0;
  font-size: .95rem;
}

/* ตัวกรอง cars.html — แถวเดียว กระชับ ไม่มีกรอบ */
.cars-filter {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 .85rem;
}
.cars-filter.is-active {
  background: transparent;
}
.cars-filter__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .4rem;
}
.cars-filter__field {
  flex: 1 1 auto;
  min-width: 0;
}
.cars-filter__field--pair {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  flex: 1 1 14rem;
  min-width: min(100%, 13rem);
}
.cars-filter__field--pair select {
  flex: 1 1 0;
  min-width: 5.75rem;
}
.cars-filter__sep {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1;
  opacity: .7;
}
.cars-filter__field select {
  width: 100%;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  /* เผื่อลูกศร native ทางขวา ไม่ให้ตัดตัวไทย */
  padding: .35rem 1.65rem .35rem .55rem;
  min-height: 2rem;
  line-height: 1.25;
}
.cars-filter__field select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 2px var(--orange-soft);
}
.cars-filter__field--checks {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: .15rem;
  flex: 0 0 auto;
}
.cars-filter__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  margin: 0;
  padding: .25rem .4rem;
  min-height: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.cars-filter__check:has(input:checked) {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
}
.cars-filter__check input {
  width: .9rem;
  height: .9rem;
  margin: 0;
  accent-color: var(--orange);
}
.cars-filter__actions {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
  margin: 0;
  margin-left: auto;
}
.cars-filter__submit {
  min-width: 0 !important;
  padding: .35rem .85rem !important;
  min-height: 2rem;
  font-size: .82rem !important;
  border-radius: 8px !important;
  line-height: 1.2;
}
.cars-filter__reset {
  font-size: .8rem;
  font-weight: 700;
  color: var(--orange) !important;
  text-decoration: none !important;
  white-space: nowrap;
  padding: .25rem .35rem;
}
.cars-filter__reset:hover {
  text-decoration: underline !important;
}
/* brand field slightly wider */
.cars-filter__field:not(.cars-filter__field--pair):not(.cars-filter__field--checks) {
  flex: 1 1 8rem;
  max-width: 12rem;
  min-width: 6.5rem;
}
@media (max-width: 900px) {
  .cars-filter__field:not(.cars-filter__field--pair):not(.cars-filter__field--checks) {
    max-width: none;
    flex: 1 1 calc(50% - .25rem);
  }
  .cars-filter__field--pair {
    flex: 1 1 calc(50% - .25rem);
  }
  .cars-filter__actions {
    margin-left: 0;
    flex: 1 1 100%;
    justify-content: flex-end;
  }
}
@media (max-width: 520px) {
  .cars-filter__row {
    gap: .3rem;
  }
  .cars-filter__field:not(.cars-filter__field--pair):not(.cars-filter__field--checks),
  .cars-filter__field--pair {
    flex: 1 1 100%;
  }
  .cars-filter__field--checks {
    flex: 1 1 auto;
  }
  .cars-filter__actions {
    flex: 1 1 auto;
    justify-content: stretch;
  }
  .cars-filter__submit {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* จัดเรียงรายการรถ */
.cars-sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .65rem;
  flex: 0 1 auto;
  max-width: 100%;
}
.cars-sort__label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}
.cars-sort__control {
  position: relative;
  min-width: min(100%, 11.5rem);
}
.cars-sort__select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E")
    no-repeat right .85rem center / 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .55rem 2.1rem .55rem .85rem;
  min-height: 2.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.cars-sort__select:hover {
  border-color: rgba(255, 106, 0, .45);
}
.cars-sort__select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
/* ชิปบนจอใหญ่ — เลือกเร็วโดยไม่ต้องเปิด select */
.cars-sort__chips {
  display: none;
  flex-wrap: wrap;
  gap: .35rem;
}
.cars-sort__chip {
  display: inline-flex;
  align-items: center;
  padding: .4rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: .15s ease;
}
.cars-sort__chip:hover {
  border-color: rgba(255, 106, 0, .5);
  color: var(--orange);
}
.cars-sort__chip.is-active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange);
}
@media (min-width: 900px) {
  .cars-sort__control { display: none; }
  .cars-sort__chips { display: flex; }
  .cars-sort__label { margin-right: .15rem; }
}
@media (max-width: 640px) {
  .cars-page__head {
    flex-direction: column;
    align-items: stretch;
  }
  .cars-sort {
    width: 100%;
  }
  .cars-sort__control {
    flex: 1 1 auto;
    min-width: 0;
  }
  .cars-sort__select {
    width: 100%;
  }
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .55rem .75rem;
  margin-top: 2.25rem;
  padding-top: .5rem;
}
.pagination__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.pagination__btn,
.pagination__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  padding: .4rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none !important;
  transition: .15s ease;
}
.pagination__num {
  min-width: 2.4rem;
  padding: .4rem .55rem;
}
.pagination__btn:hover,
.pagination__num:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.pagination__num.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff !important;
}
.pagination__btn.is-disabled {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}
.pagination__ellipsis {
  color: var(--muted);
  padding: 0 .2rem;
  font-weight: 700;
}

/* Fleet cards — desktop 3 | tablet+mobile 2 (แบบ B: มือถือโฟกัสราคา+ไมล์) */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .fleet-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
.fleet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fleet-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.fleet-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: #e8eaed;
  overflow: hidden;
}
.fleet-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.fleet-card:hover .fleet-card__media img { transform: scale(1.04); }
.fleet-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #9ca3af;
}
/* ปีรถ — พื้นสีธีม + ตัวขาว อ่านชัดบนรูปทุกธีม (รวม charcoal) */
.fleet-card__year {
  position: absolute;
  top: .65rem;
  left: .75rem;
  background: var(--orange);
  color: #fff !important;
  font-size: 1.35rem;
  font-weight: 800;
  padding: .32rem .7rem;
  border-radius: 9px;
  letter-spacing: -.02em;
  line-height: 1;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
  font-variant-numeric: tabular-nums;
}
.fleet-card__media-badges {
  position: absolute;
  top: .55rem;
  right: .55rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .3rem;
  pointer-events: none;
}
.fleet-badge {
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: .2rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
  white-space: nowrap;
}
.fleet-badge--video {
  background: rgba(79, 70, 229, .92);
}
.fleet-badge--audio {
  background: rgba(5, 150, 105, .92);
}
@media (max-width: 640px) {
  .fleet-badge {
    font-size: .62rem;
    padding: .15rem .35rem;
  }
  .fleet-card__media-badges {
    top: .4rem;
    right: .4rem;
    gap: .22rem;
  }
}

.fleet-card__body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  flex: 1;
  min-width: 0;
}
.fleet-card__title {
  margin: 0;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fleet-card__title a {
  text-decoration: none !important;
  color: inherit;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fleet-card__title a:hover { color: var(--orange); }
.fleet-card__price {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  flex-wrap: wrap;
}
.fleet-card__price-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--orange);
}
.fleet-card__price-unit {
  color: var(--orange);
  font-size: .9rem;
  font-weight: 700;
}
.fleet-card__specs {
  list-style: none;
  margin: 0;
  padding: .65rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  border-top: 1px solid var(--line);
  align-items: start;
}
.fleet-card__specs li,
.fleet-card__spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .25rem;
  font-size: .82rem;
  color: var(--ink-2);
  font-weight: 600;
  text-align: center;
  min-width: 0;
}
.spec-ico {
  font-size: 1.1rem;
  opacity: .9;
  line-height: 1;
  display: block;
}
.spec-val {
  display: block;
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
  max-width: 100%;
}
/* แชร์โซเชียล บนการ์ดรายการรถ */
.fleet-share {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .15rem 0 .55rem;
  min-height: 2rem;
}
.fleet-share__label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.fleet-share__btns {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.fleet-share__btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: .15s ease;
  flex-shrink: 0;
}
.fleet-share__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(17,24,39,.1);
}
.fleet-share__btn--facebook { color: #1877f2; border-color: rgba(24,119,242,.35); }
.fleet-share__btn--facebook:hover { background: rgba(24,119,242,.1); color: #1877f2; }
.fleet-share__btn--ig { color: #e1306c; border-color: rgba(225,48,108,.35); }
.fleet-share__btn--ig:hover { background: rgba(225,48,108,.1); color: #e1306c; }
.fleet-share__btn--x { color: #111; border-color: rgba(17,17,17,.25); }
.fleet-share__btn--x:hover { background: #f3f4f6; color: #111; }
.fleet-share__btn--line { color: #06c755; border-color: rgba(6,199,85,.4); }
.fleet-share__btn--line:hover { background: rgba(6,199,85,.12); color: #06c755; }
.fleet-share__btn.is-copied {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange);
}

/* แชร์บนหน้ารายละเอียดรถ — ไอคอนอย่างเดียว จัดกลาง ไม่มีกรอบ */
.car-share {
  margin: .75rem 0 .9rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
}
.car-share__head {
  display: flex;
  justify-content: center;
  margin-bottom: .55rem;
}
.car-share__title {
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink);
}
.car-share__hint {
  display: none;
}
.car-share__btns {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .65rem 1rem;
}
.car-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  text-decoration: none !important;
  transition: transform .15s ease, color .15s ease;
}
.car-share__btn span {
  display: none !important;
}
.car-share__btn:hover {
  transform: scale(1.12);
}
.car-share__btn--facebook { color: #1877f2; }
.car-share__btn--ig { color: #e1306c; }
.car-share__btn--x { color: #111; }
.car-share__btn--line { color: #06c755; }
.car-share__btn--copy { color: #4b5563; }
.car-share__btn--copy:hover { color: var(--orange); }
.car-share__btn.is-copied {
  color: var(--orange) !important;
}
.car-share__btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* ดูรายละเอียด — ใช้สีธีม + ตัวขาว ชัดทุกโทน */
.fleet-card__btn,
a.btn.fleet-card__btn {
  margin-top: auto;
  width: 100%;
  background: var(--orange) !important;
  color: #fff !important;
  border: 1px solid transparent !important;
  border-color: transparent !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .12);
  text-shadow: none;
}
.fleet-card__btn:hover,
a.btn.fleet-card__btn:hover {
  background: var(--orange-hover) !important;
  color: #fff !important;
  border-color: transparent !important;
  filter: none;
  box-shadow: 0 4px 12px rgba(17, 24, 39, .16);
  transform: translateY(-1px);
}
.fleet-card__btn:active,
a.btn.fleet-card__btn:active {
  transform: none;
  box-shadow: 0 1px 4px rgba(17, 24, 39, .12);
}

/* แบบ B — มือถือ: 2 คอลัมน์ · ราคาเด่น · เหลือเฉพาะไมล์ */
@media (max-width: 640px) {
  .fleet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .65rem;
  }
  .fleet-card {
    border-radius: 12px;
  }
  .fleet-card__media {
    aspect-ratio: 4 / 3;
  }
  .fleet-card__year {
    top: .4rem;
    left: .4rem;
    font-size: .9rem;
    padding: .2rem .45rem;
    border-radius: 7px;
  }
  .fleet-card__body {
    padding: .65rem .6rem .7rem;
    gap: .35rem;
  }
  .fleet-card__title {
    font-size: .8rem;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: 2.1em;
  }
  .fleet-card__title a {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .fleet-card__price {
    gap: .2rem;
  }
  .fleet-card__price-num {
    font-size: 1.05rem;
    letter-spacing: -.02em;
  }
  .fleet-card__price-unit {
    font-size: .72rem;
  }
  /* ซ่อนเกียร์ + เชื้อเพลิง · เหลือไมล์แถวเดียว */
  .fleet-card__spec--gear,
  .fleet-card__spec--fuel {
    display: none !important;
  }
  .fleet-card__specs {
    grid-template-columns: 1fr;
    gap: 0;
    padding: .4rem 0 0;
    border-top: 1px solid var(--line);
  }
  .fleet-share {
    margin: .1rem 0 .35rem;
    gap: .25rem;
  }
  .fleet-share__label { display: none; }
  .fleet-share__btn {
    width: 1.7rem;
    height: 1.7rem;
  }
  .fleet-share__btn svg {
    width: 12px;
    height: 12px;
  }
  .fleet-card__spec--mileage {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    text-align: left;
  }
  .fleet-card__spec--mileage .spec-ico {
    font-size: .9rem;
  }
  .fleet-card__spec--mileage .spec-val {
    text-align: left;
  }
  .fleet-card__btn,
  a.btn.fleet-card__btn {
    margin-top: .15rem;
    min-height: 2.15rem;
    padding: .4rem .45rem;
    font-size: .78rem;
    border-radius: 8px;
  }
}
@media (max-width: 360px) {
  .fleet-card__price-num {
    font-size: .95rem;
  }
  .fleet-card__title {
    font-size: .76rem;
  }
  .fleet-card__btn,
  a.btn.fleet-card__btn {
    font-size: .72rem;
    padding: .35rem .3rem;
  }
}

/* How it works */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.how-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.15rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.how-item__ico {
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: var(--orange-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.how-item h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.how-item p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
@media (max-width: 900px) {
  .how-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .how-grid { grid-template-columns: 1fr; }
}

/* Contact page */
.contact-section {
  background: var(--bg-soft);
}
.contact-layout {
  display: grid;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.contact-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.contact-map iframe {
  display: block;
  width: 100% !important;
  min-height: 360px;
  height: 380px;
  border: 0;
}
.contact-card {
  background: #fff;
}
.contact-card__title {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
}
.contact-value {
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 600;
}
.contact-value--name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  margin: 0 0 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--line);
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.contact-item:last-child {
  border-bottom: 0;
}
.contact-item--social {
  align-items: center;
}
.contact-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  color: var(--orange);
  border: 1px solid var(--line);
}
.contact-icon--phone { color: var(--orange); background: var(--orange-soft); border-color: transparent; }
.contact-icon--line { color: #06c755; background: rgba(6, 199, 85, .12); border-color: transparent; }
.contact-icon--email { color: #2563eb; background: rgba(37, 99, 235, .1); border-color: transparent; }
.contact-icon--map { color: #dc2626; background: rgba(220, 38, 38, .1); border-color: transparent; }
.contact-icon--share { color: #7c3aed; background: rgba(124, 58, 237, .1); border-color: transparent; }
.contact-icon svg {
  display: block;
}
.contact-item__body {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 600;
  padding-top: .45rem;
}
.contact-item--social .contact-item__body {
  padding-top: 0;
}
.contact-phones {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.contact-link {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  word-break: break-word;
}
.contact-link:hover {
  color: var(--orange);
}
.contact-link--line:hover {
  color: #06c755;
}
.contact-link--alt {
  color: var(--muted);
  font-weight: 500;
  font-size: .98rem;
}
.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.contact-social-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: .15s ease;
}
.contact-social-btn:hover {
  transform: translateY(-1px);
  border-color: var(--orange);
  color: var(--orange);
  box-shadow: var(--shadow);
}
.contact-social-btn--facebook_url { color: #1877f2; }
.contact-social-btn--facebook_url:hover { color: #1877f2; border-color: #1877f2; }
.contact-social-btn--tiktok_url { color: #111; }
.contact-social-btn--x_url { color: #111; }
.contact-social-btn--ig_url { color: #e1306c; }
.contact-social-btn--ig_url:hover { color: #e1306c; border-color: #e1306c; }
.contact-social-btn--shop { color: var(--orange); }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 640px) {
  .contact-map iframe {
    min-height: 280px;
    height: 300px;
  }
  .contact-icon,
  .contact-social-btn {
    width: 40px;
    height: 40px;
  }
}

/* Empty / flash */
.empty-card, .empty {
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius);
  color: var(--muted);
  border: 1px solid var(--line);
}
.flash {
  padding: .85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.flash-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.muted { color: var(--muted); }

/* Public detail page */
.page-detail .site-main { background: var(--bg-soft); }
.detail-wrap {
  padding: 1.5rem 0 3.5rem;
  /* อย่าใช้ overflow บน parent — จะทำให้ sticky คอลัมน์ขวาพัง */
  overflow: visible;
}
.detail-crumb {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
  word-break: break-word;
}
.detail-crumb a { color: var(--muted); }
.detail-crumb a:hover { color: var(--orange); }
.detail-title {
  margin: 0 0 .35rem;
  font-size: clamp(1.35rem, 4.2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.25;
  word-break: break-word;
}
.detail-lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: clamp(.95rem, 2.5vw, 1.05rem);
}
/*
 * หน้ารถ: ซ้าย แกลเลอรี+ราคา/สเปก+รายละเอียด · ขวา เสียง+ค่างวด+ปุ่ม
 * มือถือ: เรียงตาม DOM (ซ้ายก่อน แล้วขวา)
 */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, .72fr);
  gap: 1.5rem;
  align-items: start;
}
.detail-grid > * { min-width: 0; }
.detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
/* Desktop: คอลัมน์ขวาติดจอเลื่อนตาม (sticky) */
.detail-side-col {
  min-width: 0;
  align-self: start;
}
@media (min-width: 901px) {
  .detail-side-col {
    position: sticky;
    top: calc(var(--header-h) + .75rem);
    z-index: 5;
  }
  .detail-side {
    position: static;
    max-width: 100%;
    max-height: none;
    overflow: visible;
  }
}
.detail-side {
  max-width: 100%;
  overflow: visible;
}
.detail-specs {
  margin: 0;
}
.detail-desc {
  margin: 0;
}
.price-xl--main {
  text-align: left;
  margin-bottom: .65rem;
}
/* สเปก — 4 คอลัมน์ desktop / 2 คอลัมน์มือถือ */
.detail-specs .spec-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem .65rem;
  margin: 0;
  list-style: none;
  padding: 0;
}
.detail-specs .spec-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  min-width: 0;
}
.detail-specs .spec-list span:first-child {
  min-width: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
}
.detail-specs .spec-list span:last-child {
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  font-size: .9rem;
  word-break: break-word;
  line-height: 1.35;
}
.detail-side .audio-block {
  margin-top: 0;
}
.detail-side .installment-box {
  margin-top: 10px;
}
.detail-side .installment-box--alone {
  margin-top: 0;
}
.detail-side .actions--detail {
  margin-top: 1rem;
}
.detail-brand-logo {
  margin: .75rem 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
  font-weight: 800;
}
.price-xl {
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -.02em;
  line-height: 1.2;
  word-break: break-word;
  text-align: right;
}
.detail-side .price-xl {
  text-align: right;
}
.spec-list {
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
}
.spec-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
}
.spec-list span:first-child {
  color: var(--muted);
  flex: 0 0 auto;
  min-width: 5.5rem;
}
.spec-list span:last-child {
  text-align: right;
  font-weight: 600;
  word-break: break-word;
  min-width: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1rem;
}
.actions .btn-cta {
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
}
.actions--detail {
  flex-direction: column;
  align-items: stretch;
}
.actions--detail .btn-cta {
  width: 100%;
  min-width: 0;
  justify-content: center;
}
.btn-cta--line {
  background: #06c755 !important;
  border-color: #06c755 !important;
  color: #fff !important;
}
.btn-cta--line:hover {
  background: #05a847 !important;
  color: #fff !important;
  filter: none;
}

/* ประมาณการค่างวด */
.installment-box {
  margin: 10px 0 1rem;
  padding: 1rem .95rem .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}
.installment-box__title {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
  font-weight: 800;
}
.installment-box__note {
  margin: 0 0 .75rem;
  font-size: .82rem;
  line-height: 1.45;
}
.installment-box__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
}
.installment-box__field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .25rem;
}
/* สลับโหมดดาวน์ % / บาท */
.inst-down-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  margin-bottom: .55rem;
  padding: .2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.inst-down-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  padding: .4rem .35rem;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
}
.inst-down-tab:hover {
  color: var(--orange);
}
.inst-down-tab.is-active {
  background: var(--orange);
  color: #fff;
}
.inst-down-hint {
  margin: .3rem 0 0;
  font-size: .75rem;
  line-height: 1.35;
}
.installment-box__row small {
  font-weight: 600;
  margin-left: .25rem;
}
.installment-box__field select {
  width: 100%;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .5rem .65rem;
  min-height: 2.45rem;
  background: #fff;
  color: var(--ink);
}
.inst-stepper {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2.5rem;
  gap: .3rem;
  align-items: center;
}
.inst-stepper__btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.inst-stepper__btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}
.inst-stepper__btn:active {
  background: var(--orange-soft);
}
.inst-stepper__input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .45rem .4rem;
  min-height: 2.5rem;
  background: #fff;
  color: var(--ink);
  /* ซ่อนลูกศร native บางเบราว์เซอร์ — ใช้ปุ่ม −/+ แทน */
  -moz-appearance: textfield;
  appearance: textfield;
}
.inst-stepper__input::-webkit-outer-spin-button,
.inst-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.inst-stepper__input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}
/* ดาวน์บาท: ช่องกว้าง พิมพ์ตัวเลขได้สะดวก */
.inst-stepper--baht .inst-stepper__input {
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.installment-box__result {
  margin-top: .75rem;
  padding-top: .65rem;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: .4rem;
}
.installment-box__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  font-size: .92rem;
}
.installment-box__row--main {
  margin-top: .15rem;
  padding: .55rem .65rem;
  border-radius: 10px;
  background: var(--orange-soft);
  font-size: 1rem;
}
.installment-box__row--main strong {
  color: var(--orange);
  font-size: 1.15rem;
  font-weight: 800;
}
.installment-box__formula {
  margin: .45rem 0 0;
  font-size: .78rem;
  line-height: 1.45;
}
.installment-box__docs {
  margin: .65rem 0 0;
  font-size: .88rem;
  font-weight: 600;
}
.installment-box__docs a {
  color: var(--orange) !important;
  text-decoration: none !important;
}

@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .detail-side-col {
    position: static;
    top: auto;
  }
  .detail-side {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
  .detail-specs .spec-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-wrap { padding: 1.15rem 0 4.5rem; }
  .panel { padding: 1.05rem 1.1rem; }
  .actions {
    flex-direction: column;
  }
  .actions .btn-cta {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }
  .gallery-main-wrap {
    aspect-ratio: 4 / 3;
  }
  .gallery-nav {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.1rem;
  }
  .gallery-nav--prev { left: .4rem; }
  .gallery-nav--next { right: .4rem; }
  .gallery-thumbs {
    gap: .4rem;
    padding: .55rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .gallery-thumb {
    width: 64px;
    height: 48px;
  }
  .player-row {
    gap: .4rem;
  }
  .player-btn {
    padding: .4rem .55rem;
    font-size: .82rem;
  }
  .player-time {
    min-width: 0;
    font-size: .8rem;
  }
  .lang-select {
    margin-left: 0;
    width: 100%;
  }
  .btn-listen {
    width: 100%;
    justify-content: center;
  }
  .gallery-lightbox__dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding: 3.5rem .35rem 4rem;
  }
  .gallery-lightbox__close {
    position: fixed;
    top: calc(.65rem + env(safe-area-inset-top, 0px));
    right: .65rem;
    z-index: 3;
  }
  .gallery-lightbox__nav {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.4rem;
  }
  .gallery-lightbox__nav--prev { left: .15rem; }
  .gallery-lightbox__nav--next { right: .15rem; }
  .gallery-lightbox__bar {
    position: fixed;
    left: 50%;
    bottom: calc(.85rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
  }
  .gallery-lightbox__hint { display: none; }
}

@media (max-width: 480px) {
  .detail-wrap { padding: 1rem 0 5rem; }
  .page-detail .detail-wrap {
    padding: .7rem 0 calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  .page-detail .detail-title {
    font-size: 1.18rem;
  }
  .page-detail .price-xl--main {
    font-size: 1.4rem;
  }
  .page-detail .panel {
    padding: .8rem .75rem;
  }
  .container { width: min(var(--container), 94%); }
  .page-detail .container {
    width: min(var(--container), 94%);
  }
  .spec-list li {
    flex-direction: column;
    gap: .15rem;
  }
  .spec-list span:first-child {
    min-width: 0;
    font-size: .82rem;
  }
  .spec-list span:last-child {
    text-align: left;
  }
  .price-xl { font-size: 1.4rem; }
  .detail-title { font-size: 1.28rem; }
}
.brand-logo {
  display: inline-block;
  width: 64px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  vertical-align: middle;
}
.brand-logo--lg { width: 120px; height: 48px; }
.brand-logo--sm { width: 40px; height: 20px; }
.brand-logo--table {
  width: 96px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #fff;
  padding: 2px;
  box-sizing: border-box;
}
.brand-logo-cell {
  display: flex;
  align-items: center;
  min-height: 48px;
}
body.is-admin .brand-table td {
  vertical-align: middle;
}
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: .18rem .5rem;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
}
.badge--green { background: #ecfdf5; color: #047857; }
.badge--gray { background: var(--bg-muted); color: var(--muted); }
.badge--red { background: #fef2f2; color: #b91c1c; }
.badge--warn { background: #fffbeb; color: #b45309; }
.badge--video {
  background: rgba(99, 102, 241, .18);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, .35);
}
body:not(.is-admin) .badge--video {
  background: #eef2ff;
  color: #4338ca;
  border-color: transparent;
}

/* Gallery */
.car-photo-gallery {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  outline: none;
}
.gallery-main-wrap {
  position: relative;
  background: #0b1220;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-main-wrap img,
.gallery-main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  background: #0b1220;
}
.gallery-main-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #0b1220;
}
/* ตอนโชว์วิดีโอ — รูป poster อย่ารับคลิกทับปุ่ม play */
.car-photo-gallery.is-showing-video [data-gallery-main] {
  pointer-events: none;
}
/* ตอนเล่น — ซ่อน poster แน่ชัด (กันค้างทับเฟรมวิดีโอ) */
.car-photo-gallery.is-video-playing [data-gallery-main] {
  display: none !important;
}
.car-photo-gallery.is-video-playing .gallery-main-video {
  z-index: 2;
}
.gallery-video-error {
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  z-index: 4;
  max-width: min(92%, 28rem);
  padding: .55rem .85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: .88rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}
.gallery-video-error[hidden] {
  display: none !important;
}
.gallery-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: .15s ease;
  backdrop-filter: blur(4px);
}
/* display:flex ทับ [hidden] ของเบราว์เซอร์ — ต้องบังคับซ่อน */
.gallery-play-btn[hidden],
.gallery-play-btn.is-hidden {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}
.car-photo-gallery.is-video-playing .gallery-play-btn {
  display: none !important;
}
.gallery-play-btn:hover {
  background: var(--orange);
  transform: translate(-50%, -50%) scale(1.06);
}
.gallery-play-btn__icon {
  font-size: 1.6rem;
  margin-left: 4px;
  line-height: 1;
}
.gallery-thumb.is-video {
  position: relative;
  overflow: hidden;
}
.gallery-thumb__badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: .12rem .35rem;
  border-radius: 4px;
  line-height: 1.2;
  pointer-events: none;
}
.gallery-thumb__video-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #111827;
  font-size: 1.4rem;
}
/* แสดงเฟรมแรกของวิดีโอในรูปย่อ (เมื่อยังไม่มี poster) */
.gallery-thumb__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b1220;
  pointer-events: none;
}
.gallery-lightbox__video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
  pointer-events: auto;
}
body.is-admin .dropzone--video {
  border-color: rgba(239, 68, 68, .35);
  min-height: 120px;
}
body.is-admin .gallery-item.is-video .gallery-thumb {
  position: relative;
}
body.is-admin .gallery-item .gallery-thumb__badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: .68rem;
  padding: .1rem .35rem;
  border-radius: 4px;
}
body.is-admin .gallery-item .gallery-thumb__video-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 54px;
  background: #0b1220;
  font-size: 1.5rem;
}
body.is-admin .gallery-item .gallery-thumb__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0b1220;
  pointer-events: none;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.gallery-nav:hover { background: var(--orange); }
.gallery-nav--prev { left: .6rem; }
.gallery-nav--next { right: .6rem; }
.gallery-counter {
  position: absolute;
  bottom: .6rem;
  right: .75rem;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .8rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  z-index: 2;
}
.gallery-thumbs {
  display: flex;
  gap: .45rem;
  padding: .65rem;
  overflow-x: auto;
  background: var(--bg-soft);
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #ddd;
  cursor: pointer;
  opacity: .75;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gallery-thumb.is-active { opacity: 1; border-color: var(--orange); }
.gallery-empty {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #9ca3af;
  background: #e8eaed;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* Lightbox */
body.gallery-lightbox-open { overflow: hidden; }
body.gallery-lightbox-open .site-float-contact { display: none !important; }
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox[hidden] { display: none !important; }
.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.88);
  cursor: zoom-out;
}
.gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  height: min(90vh, 900px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gallery-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  pointer-events: auto;
}
.gallery-lightbox__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  pointer-events: auto;
}
.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox__nav:hover { background: var(--orange); }
.gallery-lightbox__nav--prev { left: .25rem; }
.gallery-lightbox__nav--next { right: .25rem; }
.gallery-lightbox__bar {
  position: absolute;
  left: 50%;
  bottom: -2.4rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  pointer-events: none;
}
.gallery-lightbox__counter {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  padding: .3rem .75rem;
  border-radius: 999px;
}
.gallery-lightbox__hint { color: rgba(255,255,255,.55); font-size: .75rem; }

/* Audio */
.audio-block {
  margin-top: 1rem;
  text-align: center;
}
.audio-auto-label {
  margin: 0 0 .5rem;
  font-size: .9rem;
  color: var(--muted);
  text-align: center;
}
.audio-auto-label.is-error { color: #b45309; }
.btn-listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  max-width: 100%;
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 20px rgba(255,106,0,.28);
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.btn-listen:hover { background: var(--orange-hover); }
/* display:inline-flex ทับ [hidden] ของเบราว์เซอร์ */
.btn-listen[hidden],
.audio-auto-label[hidden] { display: none !important; }
.car-audio-player {
  margin-top: .85rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--line);
  text-align: left;
}
.car-audio-player[hidden] { display: none !important; }
.player-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.player-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
}
.player-btn.primary {
  background: var(--orange);
  border-color: transparent;
  color: #fff;
  min-width: 3rem;
}
.player-time { color: var(--muted); font-size: .85rem; min-width: 5.5rem; }
.player-progress {
  flex: 1 1 100%;
  height: 8px;
  appearance: none;
  background: #e5e7eb;
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin-top: .35rem;
}
.player-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--orange);
}
.lang-select {
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem .6rem;
  font-family: inherit;
}

/* Footer public */
.gs-footer {
  background: #111827;
  color: #d1d5db;
  padding: 3rem 0 1.25rem;
  margin-top: 0;
}
.gs-footer a { color: #d1d5db; text-decoration: none; }
.gs-footer a:hover { color: var(--orange); }
.gs-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 2rem;
}
.gs-footer__logo-link {
  display: inline-block;
  text-decoration: none !important;
  margin-bottom: .35rem;
}
.gs-footer__logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(100%, 20rem);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}
@media (max-width: 640px) {
  .gs-footer__logo { height: 40px; }
}
.gs-footer__name {
  display: inline-block;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff !important;
  text-decoration: none !important;
  margin-bottom: .25rem;
}
.gs-footer__name:hover {
  color: var(--orange) !important;
}
.gs-footer__desc {
  margin: .85rem 0 1rem;
  font-size: .92rem;
  line-height: 1.55;
  color: #9ca3af;
  max-width: 22rem;
}
.gs-footer__social { display: flex; gap: .55rem; flex-wrap: wrap; }
.gs-footer__social-btn {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.gs-footer__social-btn svg { display: block; }
.gs-footer__social-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.28);
}
.gs-footer__social-btn--facebook { background: #1877f2; }
.gs-footer__social-btn--tiktok { background: #111; }
.gs-footer__social-btn--x { background: #111; }
.gs-footer__social-btn--instagram {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.gs-footer__social-btn--line { background: #06c755; }
.gs-footer__col h4 {
  margin: 0 0 .85rem;
  color: #fff;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.gs-footer__col a,
.gs-footer__address {
  display: block;
  margin-bottom: .45rem;
  font-size: .92rem;
  color: #9ca3af;
}
.gs-footer__tel {
  display: flex !important;
  align-items: center;
  gap: .5rem;
  color: #e5e7eb;
  font-weight: 600;
  letter-spacing: .02em;
}
.gs-footer__tel-badge {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--orange, #9b1b2e);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.gs-footer__tel-badge svg { display: block; }
.gs-footer__tel:hover {
  color: var(--orange);
}
.gs-footer__tel:hover .gs-footer__tel-badge {
  filter: brightness(1.08);
}
.gs-footer__copy {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .85rem;
  color: #6b7280;
}
.dealer-map-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  background: #0b1220;
}
.dealer-map-frame iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  min-height: 280px;
  height: 320px;
  border: 0;
}
.dealer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .85rem;
}
.dealer-social {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  padding: .35rem .7rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none !important;
}
.dealer-social svg { flex: 0 0 auto; }
.dealer-social--facebook { color: #1877f2; }
.dealer-social--instagram { color: #e1306c; }
.dealer-social--tiktok,
.dealer-social--x { color: #111; }
.dealer-social--line { color: #06c755; }
.dealer-social:hover {
  border-color: currentColor;
  background: #fff;
}
@media (max-width: 800px) {
  .gs-footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* หน้าต่างลอยติดต่อ — แบบ 9chaichana.com
   Desktop: แผงลอยขวาล่าง | Mobile: แถบล่างเต็มจอ ไอคอนบน ข้อความล่าง */

.site-float-contact {
  position: fixed;
  z-index: 99999;
  display: flex;
  margin: 0;
}

.site-float-contact__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Sarabun", sans-serif;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none !important;
  color: #fff !important;
  transition: 0.2s ease;
}

.site-float-contact__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-float-contact__icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.site-float-contact__item.is-phone {
  background: var(--orange, #ff6a00);
  color: #fff !important;
}

.site-float-contact__item.is-phone:hover {
  background: var(--orange-hover, #e85f00);
  color: #fff !important;
}

.site-float-contact__item.is-line {
  background: #06c755;
  color: #fff !important;
}

.site-float-contact__item.is-line:hover {
  background: #05a847;
  color: #fff !important;
}

/* Desktop — ลอยมุมขวาล่าง ไม่มีกรอบพื้นหลัง */
@media (min-width: 992px) {
  .site-float-contact {
    right: 16px;
    bottom: 16px;
    left: auto;
    top: auto;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
  }

  .site-float-contact__item {
    min-width: 148px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  }
  .site-float-contact__item.is-line {
    min-width: 168px;
  }
}

/* Mobile — bottom menu bar เต็มความกว้าง (เหมือน 9chaichana) */
@media (max-width: 991px) {
  body.is-public {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  .site-float-contact {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    flex-direction: row;
    gap: 1px;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-radius: 0;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  }

  .site-float-contact__item {
    flex: 1;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 58px;
    padding: 8px 6px;
    border-radius: 0;
    font-size: 12px;
  }

  .site-float-contact__icon,
  .site-float-contact__icon svg {
    width: 24px;
    height: 24px;
  }
}

/* ========== ADMIN (dark) ========== */
body.is-admin {
  --bg: #0f1419;
  --bg-soft: #1a2332;
  --bg-muted: #243044;
  --card: #1a2332;
  --ink: #e8eef7;
  --ink-2: #e8eef7;
  --muted: #9aabbe;
  --line: rgba(255,255,255,.08);
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --admin-sidebar-w: 260px;
  --admin-topbar-h: 60px;
  background: linear-gradient(160deg, #0b1220 0%, #152238 50%, #0f1419 100%);
  color: var(--ink);
  min-height: 100vh;
}
body.is-admin .site-header {
  background: rgba(15,20,25,.96);
  border-bottom: 1px solid var(--line);
  position: fixed;
}
body.is-admin .logo-text,
body.is-admin .nav > a { color: var(--ink); }
body.is-admin .container.main {
  padding: calc(var(--header-h) + 1.5rem) 0 3rem;
}

/* Admin shell + sidebar */
body.is-admin-app {
  background: #0b1220;
}
body.is-admin-app .admin-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: var(--admin-sidebar-w);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0a101a;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 28px rgba(0,0,0,.25);
}
.admin-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  min-height: var(--admin-topbar-h);
}
.admin-sidebar__logo {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
}
.admin-sidebar__logo img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.admin-sidebar__close {
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.admin-sidebar__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: .85rem .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.admin-sidebar__label {
  margin: .85rem .55rem .35rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-sidebar__label:first-child { margin-top: .2rem; }
.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .8rem;
  border-radius: 10px;
  color: #c9d5e5 !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: .95rem;
  transition: .15s ease;
}
.admin-sidebar__link:hover {
  background: rgba(255,255,255,.06);
  color: #fff !important;
}
.admin-sidebar__link.is-active {
  background: rgba(255,106,0,.16);
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--orange);
}
.admin-sidebar__link--danger:hover {
  background: rgba(239,68,68,.14);
  color: #fecaca !important;
}
.admin-sidebar__ico {
  width: 1.4rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.admin-sidebar__foot {
  border-top: 1px solid var(--line);
  padding: .9rem 1rem 1.1rem;
}
.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none !important;
  color: inherit;
  border-radius: 10px;
  padding: .15rem;
  transition: .15s ease;
}
a.admin-sidebar__user:hover {
  background: rgba(255,255,255,.06);
}
a.admin-sidebar__user:hover .admin-sidebar__user-role {
  color: var(--orange);
}
.admin-sidebar__avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.admin-sidebar__user-name {
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  line-height: 1.2;
}
.admin-sidebar__user-role {
  font-size: .78rem;
  color: var(--muted);
}
.admin-shell__main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--admin-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--admin-topbar-h);
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1.25rem;
  background: rgba(10,16,26,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.admin-topbar__toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.admin-topbar__toggle span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}
.admin-topbar__title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar__actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}
.admin-shell__content {
  flex: 1 1 auto;
  /* desktop: ใช้เต็มความกว้างพื้นที่หลัง sidebar */
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  padding: 1.35rem 1.5rem 2.5rem;
}
@media (min-width: 961px) {
  .admin-shell__content {
    padding: 1.5rem 1.75rem 2.75rem;
  }
  .admin-shell__main {
    width: calc(100% - var(--admin-sidebar-w));
    max-width: none;
  }
  body.is-admin-app .admin-shell {
    width: 100%;
    max-width: none;
  }
}
.admin-shell__footer {
  border-top: 1px solid var(--line);
  padding: .85rem 1.25rem 1.25rem;
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
}
.admin-sidebar-backdrop {
  display: none;
}
body.is-admin-login .admin-login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
body.is-admin-login .login-box {
  width: min(420px, 100%);
}

@media (max-width: 960px) {
  .admin-sidebar {
    transform: translateX(-105%);
    transition: transform .22s ease;
    width: min(var(--admin-sidebar-w), 86vw);
  }
  .admin-shell.is-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }
  .admin-sidebar__close { display: inline-flex; align-items: center; justify-content: center; }
  .admin-shell__main { margin-left: 0; min-width: 0; }
  .admin-topbar__toggle { display: flex; }
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,.55);
  }
  .admin-sidebar-backdrop[hidden] { display: none !important; }
  body.admin-sidebar-lock { overflow: hidden; }
  .admin-topbar {
    padding: .55rem .75rem;
    gap: .5rem;
  }
  .admin-topbar__title {
    font-size: .9rem;
  }
  .admin-topbar__actions {
    gap: .3rem;
  }
  .admin-topbar__actions .btn {
    padding: .35rem .55rem;
    font-size: .78rem;
  }
  .admin-shell__content {
    padding: 1rem .75rem 2rem;
    width: 100%;
    max-width: 100%;
  }
}

body.is-admin .panel {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
}
body.is-admin .btn-secondary {
  background: var(--bg-muted);
  color: var(--ink) !important;
  border-color: var(--line);
}
body.is-admin .btn-primary,
body.is-admin .btn-success { background: var(--orange); }
body.is-admin input[type=text],
body.is-admin input[type=number],
body.is-admin input[type=password],
body.is-admin input[type=file],
body.is-admin select,
body.is-admin textarea {
  width: 100%;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: .6rem .75rem;
  font-family: inherit;
  font-size: 1rem;
}
/* ช่องรายละเอียดเต็ม (SEO หน้ารถ) — ใหญ่ขึ้น เขียนยาวได้สบาย */
body.is-admin textarea.input-description-seo {
  min-height: 18rem;
  resize: vertical;
  line-height: 1.55;
}
/* ช่องข้อความทั่วไปใน config — ความสูงปกติ ไม่ดึงสูงเกิน */
body.is-admin textarea.input-textarea-normal {
  min-height: 0;
  height: auto;
  field-sizing: fixed;
  resize: vertical;
  line-height: 1.45;
}
body.is-admin label {
  display: block;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .3rem;
}
body.is-admin label .req {
  color: #f87171;
  font-weight: 800;
}
body.is-admin .field {
  position: relative;
}
body.is-admin .field.is-invalid input,
body.is-admin .field.is-invalid select,
body.is-admin .field.is-invalid textarea {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}
body.is-admin .field.is-valid input,
body.is-admin .field.is-valid select,
body.is-admin .field.is-valid textarea {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .15);
}
body.is-admin .field-error {
  margin: .35rem 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: #fca5a5;
  min-height: 1.1em;
}
body.is-admin .field-error[hidden] {
  display: none !important;
}
body.is-admin .form-grid.two > .field--full {
  grid-column: 1 / -1;
}
body.is-admin .radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .15rem;
}
body.is-admin .radio-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .45rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-muted);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: .15s ease;
}
body.is-admin .radio-pill input {
  width: auto;
  margin: 0;
  accent-color: var(--orange);
}
body.is-admin .radio-pill:has(input:checked) {
  border-color: var(--orange);
  background: rgba(255, 106, 0, .16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 106, 0, .35);
}
body.is-admin .radio-pill:hover {
  border-color: rgba(255, 106, 0, .55);
}
@media (max-width: 700px) {
  body.is-admin .radio-pill {
    flex: 1 1 calc(50% - .5rem);
    justify-content: flex-start;
    min-width: calc(50% - .5rem);
  }
}
body.is-admin table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
body.is-admin table.data th,
body.is-admin table.data td {
  text-align: left;
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
body.is-admin table.data th { color: var(--muted); font-weight: 600; }
body.is-admin .admin-car-thumb-link {
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
}
body.is-admin .admin-car-cover-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 8px;
}
body.is-admin .admin-car-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #0b1220;
  border: 1px solid var(--line);
}
body.is-admin .admin-car-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: var(--muted);
  background: var(--bg-muted);
}
body.is-admin .admin-car-video-flag {
  position: absolute;
  left: 3px;
  bottom: 3px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: .15rem;
  padding: .12rem .35rem;
  border-radius: 5px;
  font-size: .62rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  color: #fff;
  background: rgba(79, 70, 229, .92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  pointer-events: none;
  white-space: nowrap;
}
body.is-admin .admin-car-media-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
}
body.is-admin .admin-car-media-badges .badge {
  white-space: nowrap;
}
body.is-admin .pagination--admin {
  margin-top: 1.5rem;
  padding-bottom: .25rem;
}
body.is-admin .pagination--admin .pagination__btn,
body.is-admin .pagination--admin .pagination__num {
  background: var(--bg-muted);
  border-color: var(--line);
  color: var(--ink);
}
body.is-admin .pagination--admin .pagination__num.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff !important;
}
body.is-admin .pagination--admin .pagination__btn:hover,
body.is-admin .pagination--admin .pagination__num:hover {
  border-color: var(--orange);
  color: var(--orange);
}
body.is-admin .flash-ok { background: rgba(34,197,94,.15); color: #86efac; border: 0; }
body.is-admin .flash-err { background: rgba(239,68,68,.15); color: #fca5a5; border: 0; }
body.is-admin .flash-info { background: rgba(59,158,255,.15); color: #93c5fd; border: 0; }
/* flash ที่ส่งให้ SweetAlert — ไม่แสดงแบนเนอร์ */
body.is-admin .flash.is-swal-source,
body.is-admin-login .flash.is-swal-source {
  display: none !important;
}
body.is-admin .admin-footer,
body.is-admin .dealer-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: .9rem;
}
body.is-admin .admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
body.is-admin h1 { font-size: 1.6rem; margin: 0 0 .35rem; }
body.is-admin .form-grid { display: grid; gap: .85rem; }
body.is-admin .form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) {
  body.is-admin .form-grid.two { grid-template-columns: 1fr; }
}
body.is-admin .dropzone {
  border: 2px dashed rgba(255,255,255,.28);
  border-radius: var(--radius);
  background: var(--bg-muted);
  padding: 1.25rem 1rem;
  cursor: copy;
  position: relative;
  min-height: 150px;
  overflow: hidden;
  z-index: 1;
}
body.is-admin .dropzone--gallery {
  min-height: 160px;
}
body.is-admin .dropzone.is-dragover,
body.is-admin .dropzone:hover {
  border-color: var(--orange);
  border-style: solid;
  background: rgba(255,106,0,.12);
  box-shadow: inset 0 0 0 2px rgba(255,106,0,.35);
}
body.is-admin .dropzone-inner {
  text-align: center;
  pointer-events: none;
  position: relative;
  z-index: 1;
  user-select: none;
}
body.is-admin .dropzone-icon {
  font-size: 1.8rem;
  margin-bottom: .35rem;
}
/*
 * input โปร่งใสทับทั้งกล่อง — มือถือแตะแล้วเปิดคลังรูป/วิดีโอได้โดยตรง
 * หมายเหตุ iOS: ห้าม font-size:0 (ทำให้พื้นที่แตะพัง) ต้องใช้ขนาดใหญ่
 */
body.is-admin .dropzone-file-input,
body.is-admin .dropzone > input[type="file"] {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  opacity: 0.01 !important; /* 0 บางเครื่อง iOS แตะไม่ได้ — ใช้เกือบโปร่ง */
  overflow: hidden !important;
  z-index: 5 !important;
  cursor: pointer !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 64px !important; /* iOS hit-area fix */
  line-height: 1 !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto !important;
}
/* Desktop ลากไฟล์: ปิด pointer ของ input ชั่วคราว ให้อีเวนต์ drop ไปที่ zone */
body.is-admin .dropzone.is-dragover > input[type="file"],
body.is-admin .dropzone.is-dragover .dropzone-file-input {
  pointer-events: none !important;
}
/* มือถือ / HarmonyOS / แท็บเล็ตสัมผัส: ห้ามปิด input — ไม่งั้นแตะเลือกไฟล์ไม่เข้า */
body.is-admin.is-touch-device .dropzone.is-dragover > input[type="file"],
body.is-admin.is-touch-device .dropzone.is-dragover .dropzone-file-input,
body.is-admin.is-harmony .dropzone.is-dragover > input[type="file"],
body.is-admin.is-harmony .dropzone.is-dragover .dropzone-file-input,
body.is-admin.is-file-dragging.is-touch-device .dropzone > input[type="file"] {
  pointer-events: auto !important;
}
/* ปุ่มเลือกไฟล์ชัด — ใช้เมื่อ overlay พัง (HarmonyOS / บาง WebView) */
body.is-admin .dropzone-pick-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 6;
  margin-top: .55rem;
  font-size: .92rem;
  padding: .45rem .9rem;
}
body.is-admin .dropzone-inner .dropzone-pick-btn {
  pointer-events: auto !important;
}
@media (max-width: 860px) {
  /* มือถือ: ไม่ใช้ drag-over ปิด input — ให้แตะเลือกไฟล์เสมอ */
  body.is-admin .dropzone.is-dragover > input[type="file"],
  body.is-admin .dropzone.is-dragover .dropzone-file-input {
    pointer-events: auto !important;
  }
  body.is-admin .dropzone {
    min-height: 148px;
    cursor: pointer;
  }
  body.is-admin .dropzone-pick-btn {
    min-height: 44px;
    font-size: 1rem;
  }
}
body.is-admin #gallery-section.is-file-drag .gallery-list {
  outline: 2px dashed rgba(255, 106, 0, .45);
  outline-offset: 4px;
  border-radius: 10px;
}
body.is-admin .gallery-item.is-dragging {
  opacity: .45;
  outline: 2px solid var(--orange);
}
body.is-admin .gallery-item-actions {
  position: relative;
  z-index: 3;
}
body.is-admin .cover-preview {
  margin-top: .75rem;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  pointer-events: none;
}
body.is-admin .cover-preview img { max-height: 220px; border-radius: 8px; }
/* รูปปก = รูปแรกในแกลเลอรี (พรีวิวเล็ก) */
body.is-admin .cover-from-gallery {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin: 0 0 1rem;
  padding: .75rem .9rem;
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}
body.is-admin .cover-preview--sm {
  margin: 0;
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid var(--line);
}
body.is-admin .cover-preview--sm img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}
body.is-admin .gallery-item.is-cover {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}
body.is-admin .gallery-thumb__badge--cover {
  background: var(--orange) !important;
  color: #fff !important;
}
body.is-admin .upload-status { min-height: 1.25rem; font-size: .9rem; color: var(--muted); margin: .5rem 0 0; }
body.is-admin .upload-status.is-error { color: #fca5a5; }
body.is-admin .gallery-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
/* ── พรีวิวก่อนบันทึก (เพิ่มรถยนต์) — แผงชัดใต้ dropzone ── */
body.is-admin .image-section--in-form {
  display: block;
  width: 100%;
  max-width: 100%;
}
body.is-admin #car-form.form-grid .image-section--in-form,
body.is-admin #car-form .image-section--in-form {
  grid-column: 1 / -1;
}
body.is-admin .dropzone-wrap {
  display: block;
  width: 100%;
}
body.is-admin .dropzone-preview-panel {
  display: none;
  margin-top: .75rem;
  padding: .85rem .9rem 1rem;
  border: 2px solid rgba(255, 106, 0, .55);
  border-radius: 12px;
  background: rgba(255, 106, 0, .08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
body.is-admin .dropzone-preview-panel.is-visible,
body.is-admin .dropzone-preview-panel:not([hidden]) {
  display: block !important;
}
body.is-admin .dropzone-preview-panel[hidden] {
  display: none !important;
}
body.is-admin .dropzone-preview-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem .75rem;
  margin-bottom: .65rem;
  font-size: .95rem;
}
body.is-admin .dropzone-preview-panel__head strong {
  color: #fff;
}
body.is-admin .gallery-list--pending {
  margin: 0 !important;
  min-height: 0;
}
body.is-admin .gallery-list--pending:empty {
  display: none;
}
body.is-admin .gallery-item.is-pending {
  border-style: solid;
  border-color: rgba(255, 106, 0, .55);
  background: #0f172a;
  cursor: grab;
  touch-action: manipulation;
  user-select: none;
}
body.is-admin .gallery-item.is-pending.is-dragging {
  opacity: .55;
  cursor: grabbing;
  outline: 2px solid var(--orange);
  z-index: 2;
}
body.is-admin .gallery-list--pending.is-reordering {
  outline: 2px dashed rgba(255, 106, 0, .35);
  outline-offset: 4px;
  border-radius: 10px;
}
body.is-admin .gallery-thumb__grip {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  font-size: .7rem;
  line-height: 1;
  letter-spacing: -2px;
  padding: .2rem .28rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  pointer-events: none;
}
body.is-admin .gallery-item-actions--reorder {
  grid-template-columns: 1fr 1fr 1.2fr !important;
}
body.is-admin .dropzone-preview-hint {
  color: #cbd5e1;
}
body.is-admin .gallery-item.is-uploading {
  opacity: .9;
}
body.is-admin .gallery-thumb__badge--pending {
  background: rgba(0, 0, 0, .72) !important;
  right: 4px;
  left: auto;
}
body.is-admin .gallery-item-name {
  font-size: .72rem;
  line-height: 1.25;
  padding: .25rem .4rem 0;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.is-admin .gallery-thumb__ph,
body.is-admin .gallery-item .gallery-thumb__video-ph.gallery-thumb__ph {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: #0b1220;
}
/* display:flex ทับ [hidden] — ต้องบังคับซ่อนเมื่อโหลดรูปแล้ว */
body.is-admin .gallery-thumb__ph[hidden],
body.is-admin .gallery-thumb__ph.is-hidden,
body.is-admin .gallery-item .gallery-thumb__video-ph[hidden],
body.is-admin .gallery-item .gallery-thumb__video-ph.is-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* รูปพรีวิวต้องอยู่เหนือ icon placeholder */
body.is-admin .gallery-item.is-pending .gallery-thumb img,
body.is-admin .gallery-list--pending .gallery-thumb img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background: #0b1220;
}
body.is-admin .gallery-item.is-pending .gallery-thumb img[hidden],
body.is-admin .gallery-list--pending .gallery-thumb img[hidden] {
  display: none !important;
}
body.is-admin .gallery-item.is-pending .gallery-thumb.has-preview .gallery-thumb__ph {
  display: none !important;
}
body.is-admin .gallery-list--video-pending {
  display: grid !important;
  grid-template-columns: minmax(180px, 280px);
  margin: 0 !important;
  list-style: none;
  padding: 0;
  gap: .75rem;
}
body.is-admin .gallery-list--video-pending .gallery-thumb {
  aspect-ratio: 16/10;
}
body.is-admin .gallery-list--video-pending .gallery-thumb__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
body.is-admin .gallery-item {
  background: var(--bg-muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
body.is-admin .gallery-thumb { aspect-ratio: 4/3; background: #0b1220; position: relative; }
body.is-admin .gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
body.is-admin .gallery-item-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 4px;
}
body.is-admin .bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
body.is-admin .bulk-check-all {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  color: var(--ink);
  cursor: pointer;
}
body.is-admin .audio-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) {
  body.is-admin .audio-modes { grid-template-columns: 1fr; }
}
body.is-admin .audio-mode__head { display: flex; gap: .75rem; align-items: flex-start; }
body.is-admin .audio-mode__num {
  flex-shrink: 0;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: #22c55e;
  color: #052e16;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.is-admin .audio-mode__num--ai {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
}
body.is-admin .audio-mode-pick { display: grid; gap: .65rem; }
body.is-admin .audio-mode-pick--row { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) {
  body.is-admin .audio-mode-pick--row { grid-template-columns: 1fr; }
}
body.is-admin .audio-mode-card {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-muted);
  cursor: pointer;
  margin: 0;
}
body.is-admin .audio-mode-card.is-active {
  border-color: var(--orange);
  background: rgba(255,106,0,.1);
}
body.is-admin .form-actions-bottom {
  position: sticky;
  bottom: 0;
  z-index: 15;
  background: rgba(26,35,50,.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
body.is-admin .fb-share-check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  border: 1px solid rgba(24, 119, 242, .45);
  background: rgba(24, 119, 242, .12);
  cursor: pointer;
  font-weight: 650;
  line-height: 1.35;
}
body.is-admin .fb-share-check input {
  width: auto;
  margin: .15rem 0 0;
  accent-color: #1877f2;
  flex: 0 0 auto;
}
body.is-admin .fb-share-check span { display: block; }
body.is-admin .fb-share-check small {
  display: block;
  font-weight: 500;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .15rem;
}
body.is-admin .fb-share-check small a { color: #8ab4ff; }
body.is-admin .fb-share-check.is-disabled {
  opacity: .78;
  cursor: default;
  border-color: var(--line);
  background: rgba(255,255,255,.04);
}
body.is-admin .fb-share-status {
  padding: .55rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-size: .9rem;
}
body.is-admin .fb-share-status.is-ok {
  border-color: rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .1);
}
body.is-admin .fb-howto {
  padding: .85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-size: .9rem;
  line-height: 1.55;
}
body.is-admin .fb-howto ol {
  margin: .5rem 0 0;
  padding-left: 1.25rem;
}
body.is-admin .fb-howto li { margin: .35rem 0; }
body.is-admin .fb-howto .fb-redirect {
  display: inline-block;
  margin: .25rem .35rem .25rem 0;
  padding: .2rem .45rem;
  word-break: break-all;
  background: rgba(0,0,0,.25);
  border-radius: 6px;
}
body.is-admin .fb-advanced {
  padding: .65rem .85rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
}
body.is-admin .fb-advanced summary {
  cursor: pointer;
  font-weight: 700;
}
body.is-admin .login-box { max-width: 400px; margin: 3rem auto; }
body.is-admin .dropzone--audio { border-color: rgba(34,197,94,.35); }
body.is-admin .audio-list-item {
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
body.is-admin .detail-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.25rem;
}
@media (max-width: 800px) {
  body.is-admin .detail-grid { grid-template-columns: 1fr; }
}

/* ========== Admin responsive (RWD) ========== */
body.is-admin-app,
body.is-admin {
  overflow-x: hidden;
}
body.is-admin .panel {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body.is-admin .panel--cars-list {
  overflow: visible;
}
body.is-admin .admin-top {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: .75rem 1rem;
}
body.is-admin .admin-top--cars {
  align-items: center;
}
body.is-admin .admin-top__text {
  min-width: 0;
  flex: 1 1 auto;
}
body.is-admin .admin-top .actions,
body.is-admin .admin-top__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
}
body.is-admin .admin-top .actions .btn {
  flex: 0 1 auto;
  min-width: min(100%, 8.5rem);
  justify-content: center;
  text-align: center;
}
body.is-admin .bulk-toolbar {
  flex-wrap: wrap;
  gap: .55rem .75rem;
}
body.is-admin .bulk-toolbar--sticky {
  position: sticky;
  top: calc(var(--admin-topbar-h, 60px) + .25rem);
  z-index: 20;
  background: rgba(26, 35, 50, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0 0 1rem;
  padding: .65rem .15rem .75rem;
  border-bottom: 1px solid var(--line);
}
body.is-admin .bulk-check-all__hint {
  color: var(--muted);
  font-weight: 400;
}
body.is-admin .bulk-count {
  margin-right: auto;
}
body.is-admin table.data:not(.admin-cars-table) {
  min-width: 640px;
}
body.is-admin .table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -.15rem;
  padding: 0 .15rem;
}
body.is-admin .table-scroll--cars {
  overflow: visible;
  margin: 0;
  padding: 0;
}
/* ── รายการรถ: desktop table ── */
body.is-admin .admin-cars-table {
  min-width: 0;
  width: 100%;
}
body.is-admin .admin-car-row__title {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}
body.is-admin .admin-car-row__meta {
  display: block;
  margin-top: .15rem;
  font-size: .88rem;
}
body.is-admin .admin-car-row__btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
body.is-admin .admin-car-row__check input.car-check {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--orange);
  cursor: pointer;
}
body.is-admin .btn,
body.is-admin .btn-sm {
  min-height: 2.4rem;
  touch-action: manipulation;
}
body.is-admin .btn-sm {
  min-height: 2.15rem;
  padding: .4rem .65rem;
}
body.is-admin .gallery-list {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
body.is-admin .form-actions-bottom .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  width: 100%;
}
body.is-admin .form-actions-bottom .actions .btn {
  flex: 1 1 auto;
  min-width: min(100%, 9rem);
  justify-content: center;
}
body.is-admin .pagination--admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .25rem .15rem 1rem;
  margin-top: 1.25rem;
}
body.is-admin .pagination--admin .pagination__pages {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
  align-items: center;
}
body.is-admin .brand-logo--table {
  width: 72px;
  height: 40px;
}

/* Tablet: ตารางเล็กลง + ปุ่มกระชับ */
@media (max-width: 960px) {
  body.is-admin .admin-cars-table {
    font-size: .9rem;
  }
  body.is-admin .admin-cars-table th,
  body.is-admin .admin-cars-table td {
    padding: .55rem .4rem;
  }
  body.is-admin .admin-car-thumb {
    width: 64px;
    height: 48px;
  }
  body.is-admin .admin-top--cars {
    flex-direction: column;
    align-items: stretch;
  }
  body.is-admin .admin-top--cars .admin-top__actions {
    width: 100%;
  }
  body.is-admin .admin-top--cars .admin-top__actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* มือถือ: แปลงตารางรายการรถเป็นการ์ด */
@media (max-width: 700px) {
  body.is-admin h1 {
    font-size: 1.25rem;
  }
  body.is-admin .admin-top {
    margin-bottom: .85rem;
  }
  body.is-admin .admin-top .muted {
    font-size: .88rem;
  }
  body.is-admin .panel {
    padding: 1rem .9rem;
    border-radius: 12px;
  }
  body.is-admin .panel--cars-list {
    padding: .85rem .7rem 1rem;
  }
  body.is-admin .form-grid.two {
    grid-template-columns: 1fr;
  }
  body.is-admin table.data:not(.admin-cars-table) {
    min-width: 560px;
    font-size: .88rem;
  }
  body.is-admin table.data:not(.admin-cars-table) th,
  body.is-admin table.data:not(.admin-cars-table) td {
    padding: .55rem .4rem;
  }

  body.is-admin .bulk-toolbar--sticky {
    top: calc(var(--admin-topbar-h, 60px) - 2px);
    margin: -.35rem 0 .85rem;
    padding: .55rem .35rem .65rem;
    border-radius: 10px;
    background: rgba(26, 35, 50, .94);
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    gap: .5rem .65rem;
  }
  body.is-admin .bulk-toolbar--sticky .bulk-count {
    margin-right: 0;
    flex: 1 1 auto;
    font-size: .88rem;
  }
  body.is-admin .bulk-toolbar--sticky #btn-bulk-delete {
    flex: 0 0 auto;
    min-width: 7.5rem;
  }
  body.is-admin .bulk-check-all {
    flex: 1 1 100%;
    font-size: .92rem;
  }

  /* Card layout for car list */
  body.is-admin .admin-cars-table,
  body.is-admin .admin-cars-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  body.is-admin .admin-cars-table thead {
    display: none;
  }
  body.is-admin .admin-cars-table tbody {
    display: flex;
    flex-direction: column;
    gap: .7rem;
  }
  body.is-admin .admin-car-row {
    display: grid;
    grid-template-columns: 1.5rem 4.5rem minmax(0, 1fr);
    grid-template-areas:
      "check cover info"
      "check cover price"
      "status status status"
      "media media media"
      "actions actions actions";
    gap: .35rem .65rem;
    align-items: start;
    padding: .8rem .75rem;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-muted);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
  }
  body.is-admin .admin-car-row > td {
    border: 0 !important;
    padding: 0 !important;
    vertical-align: top;
  }
  body.is-admin .admin-car-row__check {
    grid-area: check;
    padding-top: .15rem !important;
  }
  body.is-admin .admin-car-row__cover {
    grid-area: cover;
  }
  body.is-admin .admin-car-row__info {
    grid-area: info;
    min-width: 0;
  }
  body.is-admin .admin-car-row__price {
    grid-area: price;
    min-width: 0;
  }
  body.is-admin .admin-car-row__status {
    grid-area: status;
    display: inline-flex;
    align-items: center;
  }
  body.is-admin .admin-car-row__media,
  body.is-admin .admin-car-row__audio {
    grid-area: media;
  }
  body.is-admin .admin-car-media-badges {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .3rem;
  }
  body.is-admin .admin-car-row__actions {
    grid-area: actions;
  }
  body.is-admin .admin-car-video-flag {
    font-size: .58rem;
    padding: .1rem .3rem;
  }

  body.is-admin .admin-car-row__title {
    font-size: .95rem;
  }
  body.is-admin .admin-car-row__meta {
    font-size: .82rem;
  }
  body.is-admin .admin-car-row__price-val {
    display: inline-block;
    font-weight: 700;
    color: var(--orange);
    font-size: .95rem;
    margin-top: .1rem;
  }
  body.is-admin .admin-car-thumb {
    width: 4.5rem;
    height: 3.35rem;
    border-radius: 8px;
  }
  body.is-admin .admin-car-thumb-link {
    display: block;
    width: 100%;
  }
  body.is-admin .admin-car-row__btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    width: 100%;
    margin-top: .15rem;
  }
  body.is-admin .admin-car-row__btns .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  body.is-admin .gallery-list {
    grid-template-columns: repeat(2, 1fr);
    gap: .55rem;
  }
  body.is-admin .gallery-item-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  body.is-admin .audio-modes {
    grid-template-columns: 1fr;
  }
  body.is-admin .dropzone {
    min-height: 130px;
    padding: 1rem .85rem;
  }
  body.is-admin .dropzone p {
    font-size: .92rem;
  }
  body.is-admin .form-actions-bottom {
    padding: .75rem;
    border-radius: 12px;
    position: sticky;
    bottom: .5rem;
  }
  body.is-admin-login .login-box {
    margin: 1.25rem auto;
    width: min(420px, 100%);
  }
  .admin-topbar__actions a[href*="index.html"],
  .admin-topbar__actions a[href*="logout"] {
    display: none;
  }
  body.is-admin .pagination--admin {
    gap: .35rem;
  }
  body.is-admin .pagination__btn,
  body.is-admin .pagination__num {
    min-height: 2.5rem;
    min-width: 2.5rem;
    font-size: .85rem;
    padding: .35rem .55rem;
  }
  body.is-admin .pagination--admin .pagination__btn {
    flex: 1 1 auto;
    max-width: 9rem;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body.is-admin-app .admin-shell__content {
    padding: .75rem .55rem 1.75rem;
  }
  body.is-admin h1 {
    font-size: 1.15rem;
  }
  body.is-admin .admin-top .actions .btn {
    width: 100%;
    min-width: 0;
  }
  body.is-admin .bulk-toolbar--sticky {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  body.is-admin .bulk-toolbar--sticky #btn-bulk-delete {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  body.is-admin .admin-car-row {
    grid-template-columns: 1.35rem 4rem minmax(0, 1fr);
    padding: .7rem .65rem;
    gap: .3rem .55rem;
  }
  body.is-admin .admin-car-thumb {
    width: 4rem;
    height: 3rem;
  }
  body.is-admin .admin-car-row__title {
    font-size: .9rem;
  }
  body.is-admin .admin-car-row__btns .btn {
    font-size: .82rem;
    padding: .4rem .4rem;
  }
  body.is-admin table.data:not(.admin-cars-table) {
    min-width: 520px;
    font-size: .84rem;
  }
  body.is-admin .gallery-list {
    grid-template-columns: 1fr 1fr;
  }
  body.is-admin .brand-logo--table {
    width: 64px;
    height: 36px;
  }
  .admin-topbar__title {
    max-width: 42vw;
  }
  body.is-admin .pagination--admin .pagination__btn {
    max-width: none;
    font-size: .8rem;
    padding: .35rem .45rem;
  }
}

/* sticky toolbar under fixed topbar on mobile shell */
@media (max-width: 960px) {
  body.is-admin .bulk-toolbar--sticky {
    top: calc(var(--admin-topbar-h, 60px) + .15rem);
  }
}

/* ── รับซื้อรถมือสอง ── */
.buy-section {
  padding: 2rem 0 4rem;
  background: var(--bg-soft);
}
/* แกลเลอรีบังคับอย่างน้อย 1 รูป */
body.is-admin #gallery-section.is-gallery-invalid .dropzone--gallery {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, .25);
}
body.is-admin #gallery-required-error {
  color: #fca5a5;
  font-size: .9rem;
}

/* บล็อกแนะนำรับซื้อ — กรอบขาว (panel ปกติ) */
.buy-intro {
  margin-bottom: 2rem;
}
.buy-intro__title {
  margin: 0 0 .75rem;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.buy-intro__lead {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}
.buy-highlights {
  margin: 0;
  padding: 0 0 0 1.15rem;
  line-height: 1.75;
  color: var(--ink);
}
.buy-highlights li { margin: .25rem 0; }
.buy-steps { margin: 2.5rem 0; }
.buy-steps .section-title,
.buy-steps > h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 800;
  text-align: center;
}
.buy-steps__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.buy-step {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.buy-step__num {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}
.buy-step h3 {
  margin: 0 0 .3rem;
  font-size: 1.02rem;
  font-weight: 800;
}
.buy-step p {
  margin: 0;
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.5;
}
.buy-cta {
  text-align: center;
  margin-top: 1.5rem;
}
.buy-cta h2 {
  margin: 0 0 .35rem;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
}
.buy-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin: 1.15rem 0 .75rem;
}
.buy-cta__addr {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
}
@media (max-width: 600px) {
  .buy-cta__actions { flex-direction: column; align-items: stretch; }
  .buy-cta__actions .btn { width: 100%; }
}

/* ── เอกสารการจัดไฟแนนซ์ ── */
.finance-section {
  padding: 2rem 0 4rem;
  background: var(--bg-soft);
}
.finance-intro {
  margin-bottom: 1.5rem;
}
.finance-intro__title {
  margin: 0 0 .65rem;
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.finance-intro__lead {
  margin: 0 0 .65rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
}
.finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.finance-card__title {
  margin: 0 0 1rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1.35;
}
.finance-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: fdoc;
}
.finance-docs li {
  counter-increment: fdoc;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  line-height: 1.5;
}
.finance-docs li:last-child { border-bottom: 0; }
.finance-docs__name {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 1.75rem;
  position: relative;
}
.finance-docs__name::before {
  content: counter(fdoc) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 800;
  color: var(--orange);
  min-width: 1.4rem;
}
.finance-docs__qty {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.finance-note h3 { font-weight: 800; }
.finance-tips {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.7;
}
.finance-tips li { margin: .25rem 0; }
@media (max-width: 800px) {
  .finance-grid { grid-template-columns: 1fr; }
  .finance-docs li {
    flex-direction: column;
    gap: .2rem;
  }
  .finance-docs__qty { align-self: flex-start; padding-left: 1.75rem; }
}

/* ========== บทความ / คำแนะนำ ========== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.articles-grid--related {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
/* hover ตามธีม — ขอบ/พื้น soft + เงา (ไม่ hardcode ส้ม) */
.article-card:hover {
  border-color: var(--orange);
  background: #fff;
  box-shadow:
    0 10px 28px rgba(17, 24, 39, .1),
    0 0 0 3px var(--orange-soft);
  transform: translateY(-2px);
}
.article-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .75rem;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .55rem;
}
.article-card__cat {
  display: inline-block;
  font-weight: 700;
  font-size: .75rem;
  color: var(--orange);
  background: var(--orange-soft);
  padding: .15rem .5rem;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.article-card:hover .article-card__cat {
  color: #fff;
  background: var(--orange);
}
.article-card__title {
  margin: 0 0 .45rem;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
}
.article-card__title a {
  color: inherit;
  transition: color .15s ease;
}
.article-card__title a:hover,
.article-card:hover .article-card__title a {
  color: var(--orange);
}
.article-card__excerpt {
  margin: 0 0 .85rem;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.55;
  flex: 1;
}
.article-card__more {
  font-weight: 700;
  color: var(--orange);
  font-size: .92rem;
  transition: color .15s ease, letter-spacing .15s ease;
}
.article-card__more:hover,
.article-card:hover .article-card__more {
  color: var(--orange-hover);
  text-decoration: none;
  letter-spacing: .02em;
}

.article-detail__wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-top: .5rem;
  padding-bottom: 2rem;
}
.article-detail--after-hero .article-detail__wrap {
  padding-top: 1.25rem;
}
.article-detail__head--compact {
  margin-bottom: .85rem;
}
.article-detail__head--compact .article-detail__lead {
  font-size: 1rem;
}
.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.article-breadcrumb a { color: var(--muted); }
.article-breadcrumb a:hover { color: var(--orange); }
.article-detail__head { margin-bottom: 1.25rem; }
.article-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
  margin-bottom: .65rem;
  font-size: .88rem;
  color: var(--muted);
}
.article-detail__title {
  margin: 0 0 .55rem;
  font-size: clamp(1.45rem, 2.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}
.article-detail__lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}
.article-prose h2 {
  margin: 1.5rem 0 .55rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--orange);
}
.article-prose p {
  margin: 0 0 .85rem;
  line-height: 1.7;
  font-size: 1.02rem;
}
.article-prose ul,
.article-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.7;
}
.article-prose li { margin-bottom: .35rem; }
.article-note {
  margin: 1rem 0 1.15rem;
  padding: .75rem .95rem;
  border-left: 4px solid var(--orange);
  background: var(--orange-soft);
  border-radius: 0 10px 10px 0;
  line-height: 1.6;
  font-size: .98rem;
}
.article-cta {
  margin: 1.5rem 0 0;
  padding: 1.1rem 1.15rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.article-cta__text {
  margin: 0 0 .75rem;
  font-weight: 700;
  font-size: 1.05rem;
}
.article-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.article-detail__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.article-related {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--line);
}
.article-related__title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 800;
}
.articles-home { background: var(--bg); }
/* ไม่ดันระยะเพิ่มจาก .section มาตรฐานบนหน้าแรก — คุมด้วยกฎ .page-home ด้านบน */

@media (max-width: 900px) {
  .articles-grid,
  .articles-grid--related {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ธีมแดง-ทอง: ปุ่ม/ราคาแดง · ป้ายปี/จุดเด่นทอง */
body.theme-redgold {
  --brand-accent: #c9a227;
  --brand-accent-hover: #b08c1c;
}
body.theme-redgold .btn-primary,
body.theme-redgold .header-cta.btn-primary,
body.theme-redgold .fleet-card__btn,
body.theme-redgold .cars-filter__submit,
body.theme-redgold .btn-listen {
  background: linear-gradient(180deg, #c41e3a 0%, #9b1b2e 100%);
  box-shadow: 0 8px 18px rgba(155, 27, 46, .28), inset 0 0 0 1px rgba(201, 162, 39, .55);
}
body.theme-redgold .btn-primary:hover,
body.theme-redgold .header-cta.btn-primary:hover,
body.theme-redgold .fleet-card__btn:hover,
body.theme-redgold .cars-filter__submit:hover,
body.theme-redgold .btn-listen:hover {
  background: linear-gradient(180deg, #9b1b2e 0%, #7f1625 100%);
}
body.theme-redgold .fleet-card__price-num,
body.theme-redgold .fleet-card__price-unit,
body.theme-redgold .price-xl,
body.theme-redgold .installment-box [class*="pay"],
body.theme-redgold .installment-result strong {
  color: var(--orange) !important;
}
body.theme-redgold .section-link,
body.theme-redgold .article-card__more,
body.theme-redgold .article-card__title a:hover {
  color: var(--brand-accent) !important;
}
body.theme-redgold .fleet-card__year {
  background: linear-gradient(180deg, #e0c15a 0%, #c9a227 100%);
  color: #3b2a08 !important;
  border-color: rgba(255, 248, 220, .45);
  text-shadow: none;
}
body.theme-redgold .home-intro {
  border-left-color: var(--brand-accent);
}
body.theme-redgold .site-nav a.is-active,
body.theme-redgold .site-nav a[aria-current="page"] {
  color: var(--brand-accent);
}
/* ชื่อเว็บ (fallback ถ้าไม่มีโลโก้รูป): ทองบนพื้นมืด · แดงเข้มบนพื้นขาว */
body.theme-redgold .site-brand--text .site-brand__mark {
  display: none !important;
}
body.theme-redgold .site-brand--text .site-brand__name {
  color: #7f1625 !important;
  -webkit-text-stroke: 0;
  font-weight: 800;
  text-shadow: none;
}
body.theme-redgold .site-header--transparent .site-brand--text .site-brand__name,
body.theme-redgold .site-header--transparent .site-brand--text:hover .site-brand__name {
  color: #f0d48a !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
body.theme-redgold .site-header.is-scrolled .site-brand--text .site-brand__name,
body.theme-redgold .site-header--transparent.is-scrolled .site-brand--text .site-brand__name,
body.theme-redgold .site-header.is-scrolled .site-brand--text:hover .site-brand__name,
body.theme-redgold .site-header--transparent.is-scrolled .site-brand--text:hover .site-brand__name {
  color: #7f1625 !important;
  text-shadow: none;
}
body.theme-redgold .gs-footer__name,
body.theme-redgold .gs-footer__name:hover {
  color: #f0d48a !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
