:root {
  --primary: #14233f;
  --primary-dark: #0d1830;
  --primary-soft: #dfe7f4;
  --primary-pale: #f1f5fb;
  --ink: #1e2733;
  --muted: #5d6b7e;
  --line: #dde5ef;
  --white: #fff;
  --green: #1db954;
  --accent: #d62f33;
  --accent-dark: #b21f23;
  --accent-bright: #ff5a5f;
  --shadow: 0 18px 48px rgba(20, 35, 63, 0.12);
  --radius: 22px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Anuphan", "Thonburi", "Noto Sans Thai", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand strong,
.stat-item strong,
.car-price strong,
.modal-price {
  font-family: "Mitr", "Anuphan", "Thonburi", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

body.has-compare {
  padding-bottom: 76px;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 80px;
  border-bottom: 1px solid rgba(234, 219, 210, 0.75);
  background: rgba(255, 253, 251, 0.95);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  line-height: 1.05;
}

.site-header .brand {
  padding: 2px 9px;
}

.brand-logo {
  width: 242px;
  height: 72px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  color: #5d514a;
  font-size: 0.94rem;
  font-weight: 650;
  transition: color 0.2s ease;
}

.main-nav a::after {
  position: absolute;
  right: 50%;
  bottom: -9px;
  left: 50%;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  content: "";
  transition: inset 0.2s ease;
}

.main-nav a:hover {
  color: var(--primary-dark);
}

.main-nav a:hover::after {
  right: 0;
  left: 0;
}

.header-phone {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.round-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: var(--primary-soft);
}

.round-icon svg {
  width: 18px;
}

.header-phone small,
.header-phone strong {
  display: block;
}

.header-phone small {
  color: var(--muted);
  font-size: 0.72rem;
}

.header-phone strong {
  font-size: 0.94rem;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--primary-soft);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  border-radius: 2px;
  background: var(--primary-dark);
}

.hero {
  position: relative;
  display: grid;
  min-height: 680px;
  overflow: hidden;
  align-items: center;
  background: #10203a;
}

.hero-backdrop,
.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-backdrop {
  display: none;
}

.hero-image {
  object-fit: cover;
  object-position: center 54%;
  filter: saturate(0.95) contrast(1.03) brightness(0.96);
  transform: scale(1.002);
}

.hero-overlay {
  background:
    radial-gradient(130% 95% at 86% 48%, rgba(13, 24, 48, 0.22), transparent 58%),
    linear-gradient(
      270deg,
      rgba(11, 21, 40, 0.96) 0%,
      rgba(13, 24, 48, 0.9) 30%,
      rgba(16, 32, 58, 0.64) 49%,
      rgba(16, 32, 58, 0.2) 72%,
      rgba(16, 32, 58, 0.04) 100%
    ),
    linear-gradient(0deg, rgba(11, 21, 40, 0.55) 0%, transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-block: 78px 100px;
}

.hero-copy {
  width: min(620px, 55%);
  text-align: right;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  color: #d7e3ff;
  font-size: 0.9rem;
  font-weight: 750;
}

.eyebrow b {
  font: inherit;
}

.eyebrow span {
  width: 30px;
  height: 2px;
  background: var(--accent-bright);
}

.hero h1 {
  max-width: 620px;
  margin: 20px 0 18px;
  color: #fff;
  font-size: clamp(3rem, 6.4vw, 5.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--accent-bright);
  font-style: normal;
}

.hero p {
  width: min(100%, 590px);
  max-width: 590px;
  margin: 0;
  color: #fff;
  background: transparent;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.7;
  white-space: normal;
  text-shadow: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 24px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 750;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.btn svg {
  width: 18px;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, #e8413f, #c81e22);
  box-shadow: 0 12px 24px rgba(200, 30, 34, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 16px 30px rgba(200, 30, 34, 0.36);
}

.btn-light {
  color: #243247;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.94);
}

.btn-line {
  color: #168d42;
  border-color: #b9e9c8;
  background: #f2fff6;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-end;
  text-align: right;
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.91);
  font-size: 0.85rem;
  font-weight: 650;
}

.hero-points span::first-letter {
  color: var(--accent-bright);
}

.quick-stats {
  position: relative;
  z-index: 3;
  margin-top: -44px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid rgba(234, 219, 210, 0.85);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.stat-item {
  position: relative;
  display: flex;
  min-height: 114px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.stat-item:not(:last-child)::after {
  position: absolute;
  top: 26px;
  right: 0;
  bottom: 26px;
  width: 1px;
  background: var(--line);
  content: "";
}

.stat-item strong {
  color: var(--primary);
  font-size: 2.05rem;
  font-weight: 500;
}

.stat-item span {
  max-width: 100px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.section {
  padding: 108px 0;
}

.cars-section {
  background: linear-gradient(180deg, #fff 0, #e7eef8 100%);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 32px;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(214, 47, 51, 0.1);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.section-heading h2,
.center-heading h2,
.contact-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
  font-weight: 500;
}

.section-heading p,
.center-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.text-link {
  flex: none;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 750;
}

.text-link span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s;
}

.text-link:hover span {
  transform: translateX(4px);
}

.filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}

.filters input,
.filters select {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: #5b4e47;
  background: var(--white);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.filters input {
  padding: 0 15px 0 46px;
}

.filters select {
  padding: 0 38px 0 16px;
  cursor: pointer;
}

.filters input:focus,
.filters select:focus {
  border-color: #6f8bbf;
  box-shadow: 0 0 0 4px rgba(31, 58, 99, 0.13);
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  width: 20px;
  color: #8a96a8;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.cars-loading {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.cars-loading span {
  width: 32px;
  height: 32px;
  border: 3px solid var(--primary-soft);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}

.cars-loading.error span {
  display: none;
}

.cars-loading.error strong {
  color: var(--accent-dark);
}

.cars-loading.error small {
  display: block;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.car-card {
  overflow: hidden;
  border: 1px solid #d6e0ee;
  border-radius: 19px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(20, 35, 63, 0.1);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.car-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(20, 35, 63, 0.13);
}

.car-card.is-comparing {
  border-color: #6f8bbf;
  box-shadow: 0 0 0 2px rgba(31, 58, 99, 0.11), 0 18px 40px rgba(20, 35, 63, 0.13);
}

.car-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 2.75;
  background: #eef2f8;
  cursor: pointer;
}

.car-image-wrap:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.car-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-card:hover .car-image-wrap img {
  transform: scale(1.035);
}

.car-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  border-radius: 9px;
  color: var(--white);
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(214, 47, 51, 0.32);
  font-size: 0.7rem;
  font-weight: 800;
}

.car-tag.status-reserved,
.modal-status.status-reserved {
  color: #78531f;
  background: #f5cf82;
}

.car-tag.status-sold,
.modal-status.status-sold {
  color: #fff;
  background: #847b75;
}

.photo-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border-radius: 9px;
  color: #fff;
  background: rgba(13, 24, 48, 0.72);
  backdrop-filter: blur(6px);
  font-size: 0.69rem;
  font-weight: 700;
}

.car-card.is-sold .car-image-wrap img {
  filter: grayscale(0.55);
}

.car-body {
  padding: 19px 20px 20px;
}

.car-year {
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 750;
}

.car-body h3 {
  margin: 3px 0 11px;
  overflow: hidden;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.car-specs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 0.76rem;
}

.car-specs span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.car-specs span:not(:last-child)::after {
  width: 3px;
  height: 3px;
  margin-left: 7px;
  border-radius: 50%;
  background: #c2ccdb;
  content: "";
}

.cash-only-badge {
  display: inline-flex;
  width: fit-content;
  margin: 2px 0 12px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #8a2f00;
  background: #fff1dc;
  font-size: 0.68rem;
  font-weight: 800;
}

.compare-select {
  width: 100%;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px dashed #aebdd2;
  border-radius: 10px;
  color: var(--primary-dark);
  background: #f7f9fc;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.compare-select:hover,
.compare-select.selected {
  border-style: solid;
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.car-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid #e8edf5;
}

.car-price small,
.car-price strong {
  display: block;
}

.car-price small {
  color: var(--muted);
  font-size: 0.68rem;
}

.car-price strong {
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 500;
}

.detail-btn {
  padding: 8px 13px;
  border: 1px solid #cdd9ea;
  border-radius: 10px;
  color: var(--primary-dark);
  background: var(--primary-pale);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.detail-btn:hover {
  color: var(--white);
  background: var(--primary);
}

.empty-state {
  padding: 65px 20px;
  text-align: center;
}

.empty-state span {
  font-size: 3rem;
}

.empty-state h3 {
  margin: 10px 0 4px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.why-section {
  background: linear-gradient(180deg, #16284a 0%, #0d1830 100%);
}

.why-section .section-kicker {
  color: #ff9da0;
  background: rgba(255, 90, 95, 0.16);
}

.why-section .center-heading h2 {
  color: #fff;
}

.why-section .center-heading p {
  color: #aebbce;
}

.center-heading {
  max-width: 650px;
  margin: 0 auto 45px;
  text-align: center;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.benefit-card {
  padding: 30px 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.045);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.benefit-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 157, 160, 0.45);
}

.benefit-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #e8413f, #c81e22);
  box-shadow: 0 10px 22px rgba(200, 30, 34, 0.3);
}

.benefit-icon svg {
  width: 28px;
}

.benefit-card h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
}

.benefit-card p {
  margin: 0;
  color: #aebbce;
  font-size: 0.84rem;
}

.contact-section {
  position: relative;
  overflow: hidden;
  background: #eef3fb;
}

.contact-section::before {
  position: absolute;
  top: -180px;
  left: -130px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: rgba(31, 58, 99, 0.08);
  content: "";
}

.contact-layout {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 70px;
}

.contact-intro {
  max-width: 480px;
  margin: 16px 0 30px;
  color: var(--muted);
}

.contact-list {
  display: grid;
  gap: 13px;
}

.contact-list > div {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid rgba(31, 58, 99, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.contact-icon {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 13px;
  color: var(--primary-dark);
  background: linear-gradient(145deg, #dfe7f4, #cdd9ea);
  box-shadow: inset 0 0 0 1px rgba(20, 35, 63, 0.1);
}

.contact-icon svg {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 22px;
  height: 22px;
  margin: 0;
  transform: translate(-50%, -50%);
  transform-origin: center;
  stroke-width: 1.75;
}

.contact-icon-phone svg {
  transform: translate(-49%, -49%);
}

.contact-list p {
  padding-top: 1px;
  margin: 0;
}

.contact-list strong,
.contact-list span {
  display: block;
}

.contact-list strong {
  margin-bottom: 1px;
  font-size: 0.84rem;
}

.contact-list span,
.contact-list a {
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.55;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.line-qr-card {
  display: flex;
  width: min(100%, 390px);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #ccebd5;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.line-qr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(47, 111, 70, 0.1);
}

.line-qr-card img {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
}

.line-qr-card strong,
.line-qr-card small {
  display: block;
}

.line-qr-card strong {
  color: #168d42;
  font-size: 0.88rem;
}

.line-qr-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.map-wrap {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  border: 8px solid var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 35px;
  text-align: center;
  color: var(--muted);
  background:
    radial-gradient(circle at 70% 25%, rgba(31, 58, 99, 0.12), transparent 25%),
    linear-gradient(145deg, #f5f8fc, #e4ecf6);
}

.map-placeholder > span {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 18px;
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 10px 24px rgba(20, 35, 63, 0.1);
  font-size: 1.7rem;
}

.map-placeholder strong,
.map-placeholder small {
  display: block;
}

.map-placeholder small {
  max-width: 310px;
  font-size: 0.75rem;
}

.map-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.7) contrast(1.02);
}

.map-link {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 13px 18px;
  border-radius: 12px;
  text-align: center;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(20, 35, 63, 0.16);
  font-size: 0.86rem;
  font-weight: 750;
}

footer {
  padding: 65px 0 25px;
  color: #aeb8c6;
  background: #0e1726;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 1fr;
  gap: 70px;
  padding-bottom: 44px;
}

.footer-brand strong {
  color: var(--white);
}

.footer-brand {
  padding: 8px;
  border-radius: 14px;
  background: #fff;
}

.footer-brand .brand-logo {
  width: 235px;
}

.footer-main > div:first-child p {
  max-width: 330px;
  margin: 20px 0 0;
  color: #9aa4b4;
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
}

.footer-links strong {
  margin-bottom: 5px;
  color: var(--white);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #8fb3ff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 22px;
  border-top: 1px solid #26324a;
  color: #7c8798;
  font-size: 0.7rem;
}

.mobile-call {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: 16px;
  display: none;
  height: 50px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 25px;
  color: var(--white);
  background: var(--primary-dark);
  box-shadow: 0 10px 26px rgba(20, 35, 63, 0.3);
  font-size: 0.84rem;
  font-weight: 750;
}

.mobile-call svg {
  width: 19px;
}

.car-modal {
  width: min(1120px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 0;
  overflow: hidden auto;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(13, 24, 48, 0.32);
}

.car-modal::backdrop {
  background: rgba(13, 20, 34, 0.6);
  backdrop-filter: blur(5px);
}

.modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #28344a;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.modal-grid,
.modal-detail-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.modal-image {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
}

.modal-gallery {
  min-width: 0;
  padding: 18px;
  background: #eef2f8;
}

.modal-main-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: min(72vh, 640px);
  border-radius: 16px;
  background: #e3e9f2;
}

.modal-main-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  cursor: zoom-in;
}

.gallery-arrow {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0 0 4px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(13, 24, 48, 0.72);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: transform 0.2s, background 0.2s;
}

.gallery-arrow:hover {
  transform: translateY(-50%) scale(1.06);
  background: rgba(13, 24, 48, 0.92);
}

.gallery-prev {
  left: 14px;
}

.gallery-next {
  right: 14px;
}

.gallery-counter {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(13, 24, 48, 0.74);
  font-size: 0.72rem;
  font-weight: 750;
  backdrop-filter: blur(5px);
}

.gallery-expand {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(13, 24, 48, 0.72);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: transform 0.2s, background 0.2s;
}

.gallery-expand:hover {
  transform: scale(1.06);
  background: rgba(13, 24, 48, 0.92);
}

.modal-status {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 12px;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.modal-thumbnails {
  display: flex;
  gap: 9px;
  margin-top: 10px;
  padding-bottom: 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.modal-thumb {
  flex: 0 0 calc(25% - 7px);
  overflow: hidden;
  padding: 0;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #e3e9f2;
  cursor: pointer;
}

.modal-thumb.active {
  border-color: var(--primary-dark);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: #0b1322;
}

.photo-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox::backdrop {
  background: rgba(5, 10, 20, 0.96);
}

.lightbox-image {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: transform 0.2s, background 0.2s;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 1.9rem;
  line-height: 1;
}

.lightbox-arrow {
  top: 50%;
  width: 52px;
  height: 52px;
  padding: 0 0 4px;
  transform: translateY(-50%);
  font-size: 2.4rem;
  line-height: 1;
}

.lightbox-arrow:hover {
  transform: translateY(-50%) scale(1.06);
}

.lightbox-prev {
  left: 16px;
}

.lightbox-next {
  right: 16px;
}

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 0.78rem;
  font-weight: 700;
  backdrop-filter: blur(5px);
}

.modal-copy {
  padding: 36px 34px;
}

.car-switcher {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
}

.car-switcher button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #cdd9ea;
  border-radius: 10px;
  color: var(--primary-dark);
  background: var(--primary-pale);
  font-size: 0.72rem;
  font-weight: 750;
  text-align: center;
  cursor: pointer;
}

.car-switcher span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.modal-copy .car-year {
  display: inline-block;
  margin-bottom: 6px;
}

.modal-copy h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  line-height: 1.3;
}

.modal-price {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.7rem;
  font-weight: 500;
}

.installment-note {
  margin: 2px 0 22px;
  color: var(--muted);
  font-size: 0.76rem;
}

.installment-note strong {
  color: var(--primary-dark);
}

.modal-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.modal-specs div {
  padding: 12px 13px;
  border-radius: 11px;
  background: var(--primary-pale);
}

.modal-specs small,
.modal-specs strong {
  display: block;
}

.modal-specs small {
  color: var(--muted);
  font-size: 0.68rem;
}

.modal-specs strong {
  font-size: 0.86rem;
}

.modal-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.modal-actions .share-car {
  grid-column: 1 / -1;
}

.compare-bar {
  position: fixed;
  z-index: 60;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 11px 0;
  border-top: 1px solid #d7e0ed;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -12px 35px rgba(13, 24, 48, 0.16);
  backdrop-filter: blur(14px);
}

.compare-bar-inner {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto auto;
  align-items: center;
  gap: 13px;
}

.compare-bar-inner > div:first-child {
  display: grid;
  min-width: 130px;
}

.compare-bar-inner > div:first-child strong {
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.compare-bar-inner > div:first-child span {
  color: var(--muted);
  font-size: 0.68rem;
}

.compare-selected {
  display: flex;
  gap: 9px;
  min-width: 0;
}

.compare-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 26px;
  width: min(230px, 50%);
  min-width: 0;
  height: 44px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f8fc;
}

.compare-chip img {
  width: 38px;
  height: 44px;
  object-fit: cover;
}

.compare-chip b {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip button,
.compare-clear {
  border: 0;
  color: #7c8798;
  background: transparent;
  cursor: pointer;
}

.compare-chip button {
  width: 26px;
  height: 36px;
  padding: 0;
  font-size: 1.2rem;
}

.compare-clear {
  padding: 8px 4px;
  font-size: 0.72rem;
  text-decoration: underline;
}

.compare-bar .btn {
  min-height: 44px;
  padding: 0 18px;
}

.compare-bar .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compare-modal {
  width: min(980px, calc(100% - 30px));
  max-height: calc(100vh - 30px);
  padding: 30px;
  overflow: hidden auto;
  border: 0;
  border-radius: 22px;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(13, 24, 48, 0.32);
}

.compare-modal::backdrop {
  background: rgba(13, 20, 34, 0.6);
  backdrop-filter: blur(5px);
}

.compare-heading {
  padding: 4px 45px 22px 4px;
}

.compare-heading h2 {
  margin: 8px 0 2px;
  font-size: 1.8rem;
}

.compare-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.compare-difference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0 4px 18px;
  padding: 12px 16px;
  border: 1px solid #d6e0ee;
  border-radius: 12px;
  color: var(--primary-dark);
  background: var(--primary-pale);
}

.compare-difference span {
  font-size: 0.76rem;
  font-weight: 700;
}

.compare-difference strong {
  font-family: "Mitr", "Anuphan", sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
}

.compare-cars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.compare-swipe-hint {
  display: none;
}

.compare-car {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.compare-car > :not(.compare-car-image) {
  margin-right: 20px;
  margin-left: 20px;
}

.compare-car-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 17px;
  object-fit: cover;
  background: #eef2f8;
}

.compare-car h3 {
  margin-top: 3px;
  margin-bottom: 5px;
  font-size: 1.1rem;
  line-height: 1.35;
}

.compare-car .modal-price {
  margin-bottom: 15px;
  font-size: 1.35rem;
}

.compare-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.compare-specs div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--primary-pale);
}

.compare-specs small,
.compare-specs strong {
  display: block;
}

.compare-specs small {
  color: var(--muted);
  font-size: 0.63rem;
}

.compare-specs strong {
  overflow-wrap: anywhere;
  font-size: 0.77rem;
}

.compare-description {
  margin-bottom: 18px;
  padding: 13px 14px;
  border-radius: 11px;
  background: #f7f9fc;
}

.compare-description > strong {
  color: var(--primary-dark);
  font-size: 0.78rem;
}

.compare-description p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.compare-view-detail {
  width: calc(100% - 40px);
  margin-bottom: 20px !important;
}

.finance-disclaimer {
  display: block;
  margin-top: 11px;
  color: #8a94a4;
  font-size: 0.62rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1020px) {
  .main-nav {
    gap: 20px;
  }

  .header-phone {
    display: none;
  }

  .hero {
    min-height: 610px;
  }

  .hero-overlay {
    background: linear-gradient(
      270deg,
      rgba(15, 29, 48, 0.95),
      rgba(15, 29, 48, 0.8) 52%,
      rgba(15, 29, 48, 0.16)
    );
  }

  .hero-copy {
    width: min(610px, 66%);
  }

  .cars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-layout {
    gap: 38px;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 30px), var(--container));
  }

  .site-header {
    height: 70px;
  }

  .brand-logo {
    width: 194px;
    height: 58px;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: 70px;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    padding: 15px;
    border-top: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 15px 25px rgba(20, 35, 63, 0.1);
  }

  .main-nav.open {
    display: grid;
  }

  .main-nav a {
    padding: 11px 12px;
    border-radius: 10px;
  }

  .main-nav a:hover {
    background: var(--primary-pale);
  }

  .main-nav a::after {
    display: none;
  }

  .hero {
    min-height: 760px;
    align-items: end;
    background: #10203a;
  }

  .hero-image {
    object-fit: contain;
    object-position: center top;
    filter: saturate(0.98) contrast(1.02);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 29%, rgba(0, 0, 0, 0.68) 38%, transparent 49%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 29%, rgba(0, 0, 0, 0.68) 38%, transparent 49%);
  }

  .hero-backdrop {
    display: none;
  }

  .hero-overlay {
    background: linear-gradient(
      0deg,
      rgba(23, 37, 58, 1) 0%,
      rgba(23, 37, 58, 1) 47%,
      rgba(23, 37, 58, 0.92) 58%,
      rgba(23, 37, 58, 0.14) 83%,
      transparent 100%
    );
  }

  .hero-content {
    padding-block: 0 74px;
  }

  .hero-copy {
    width: 100%;
    text-align: right;
  }

  .hero h1 {
    margin-top: 14px;
    font-size: clamp(2.55rem, 13vw, 4rem);
  }

  .hero p {
    width: 100%;
    max-width: 560px;
    font-size: 0.79rem;
    line-height: 1.7;
    white-space: normal;
  }

  .hero p br {
    display: none;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .hero-points {
    display: grid;
    gap: 5px;
    justify-content: end;
    text-align: right;
    margin-top: 22px;
  }

  body.has-compare {
    padding-bottom: 166px;
  }

  body.has-compare .mobile-call {
    bottom: 166px;
  }

  .compare-bar-inner {
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
  }

  .compare-bar-inner > div:first-child {
    min-width: 0;
  }

  .compare-selected {
    grid-column: 1 / -1;
  }

  .compare-chip {
    width: 50%;
  }

  .compare-bar .btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
  }

  .compare-clear {
    grid-column: 2;
    grid-row: 1;
  }

  .compare-modal {
    padding: 16px;
  }

  .compare-heading {
    padding: 4px 42px 16px 2px;
  }

  .compare-heading h2 {
    font-size: 1.45rem;
  }

  .compare-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }

  .compare-cars {
    min-width: 620px;
    gap: 12px;
  }

  .compare-car {
    scroll-snap-align: start;
  }

  .compare-swipe-hint {
    display: block;
    margin: -6px 0 10px;
    color: var(--primary-dark);
    font-size: 0.68rem;
    font-weight: 750;
    text-align: center;
  }

  .quick-stats {
    margin-top: -35px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-item {
    min-height: 90px;
  }

  .stat-item::after {
    display: none;
  }

  .stat-item:nth-child(1),
  .stat-item:nth-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .stat-item strong {
    font-size: 1.6rem;
  }

  .section {
    padding: 78px 0;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2,
  .center-heading h2,
  .contact-copy h2 {
    font-size: 2rem;
  }

  .text-link {
    display: none;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    min-height: 400px;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-main > div:first-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    display: grid;
  }

  .mobile-call {
    display: flex;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-detail-layout {
    grid-template-columns: 1fr;
  }

  .modal-image {
    min-height: auto;
    aspect-ratio: 4 / 2.6;
  }

  .modal-copy {
    padding: 28px 22px 24px;
  }

  .modal-gallery {
    padding: 10px;
  }

  .modal-main-image-wrap {
    height: 58vh;
  }

  .gallery-expand {
    top: 52px;
  }
}

@media (max-width: 540px) {
  .cars-grid,
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .car-card {
    border-radius: 17px;
  }

  .contact-actions {
    display: grid;
  }

  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-main > div:first-child {
    grid-column: auto;
  }

  .modal-thumbnails {
    gap: 7px;
  }

  .modal-thumb {
    flex-basis: 31%;
  }

  .gallery-arrow {
    width: 40px;
    height: 40px;
  }

  .gallery-prev {
    left: 9px;
  }

  .gallery-next {
    right: 9px;
  }

  .car-switcher {
    margin-bottom: 16px;
  }

  .car-switcher button {
    padding-inline: 7px;
    font-size: 0.67rem;
  }

  .lightbox-arrow {
    width: 42px;
    height: 42px;
    font-size: 2rem;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 1.6rem;
  }

  .lightbox-image {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
