:root {
  --bg: #f6f8ff;
  --surface: rgba(255, 255, 255, .72);
  --surface-strong: rgba(255, 255, 255, .92);
  --text: #111827;
  --muted: #667085;
  --line: rgba(17, 24, 39, .12);
  --blue: #1167ff;
  --purple: #7c3aed;
  --dark: #151923;
  --shadow: 0 24px 70px rgba(17, 24, 39, .14);
  --radius: 8px;
}

[data-theme="dark"] {
  --bg: #0c1018;
  --surface: rgba(21, 25, 35, .74);
  --surface-strong: rgba(21, 25, 35, .96);
  --text: #f8fafc;
  --muted: #a5adbd;
  --line: rgba(255, 255, 255, .14);
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 5%, rgba(17, 103, 255, .18), transparent 28rem),
    radial-gradient(circle at 80% 15%, rgba(124, 58, 237, .14), transparent 24rem),
    var(--bg);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.gallery img, .car-media img { user-select: none; -webkit-user-drag: none; }
button, input, textarea, select { font: inherit; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 54px);
  background: rgba(255,255,255,.64);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .site-header { background: rgba(12,16,24,.72); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a, .icon-btn, .nav-toggle {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.site-nav a:hover, .site-nav a.is-active, .icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.nav-toggle { display: none; }

.hero {
  min-height: 86vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  align-items: center;
  gap: 34px;
  padding: clamp(42px, 7vw, 92px) clamp(16px, 5vw, 72px);
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 4% 4% auto auto;
  width: min(560px, 70vw); aspect-ratio: 1.45;
  border-radius: 44px;
  background:
    linear-gradient(90deg, rgba(11, 16, 24, .16), rgba(11, 16, 24, .02)),
    url("../img/showroom-hero.png") center / cover;
  box-shadow: var(--shadow);
  opacity: .86;
  transform: rotate(-3deg);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.36);
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(14px);
  animation: floaty 7s ease-in-out infinite;
}
.hero::before { width: 160px; height: 96px; right: 20%; top: 18%; border-radius: 24px; }
.hero::after { width: 98px; height: 98px; right: 8%; bottom: 22%; border-radius: 50%; animation-delay: -2s; }
.hero-content { position: relative; max-width: 760px; }
.eyebrow { display: inline-flex; color: var(--blue); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: 0; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { font-size: clamp(44px, 8vw, 92px); line-height: .94; margin: 14px 0 22px; letter-spacing: 0; }
.hero p, .page-hero p { max-width: 640px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.hero-actions, .detail-actions, .card-actions, .quick-actions, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  padding: 12px 18px;
  min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(17, 103, 255, .22);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  position: relative;
  overflow: hidden;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(124, 58, 237, .28); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.small { min-height: 38px; padding: 9px 12px; font-size: 13px; }
.glow { box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset, 0 18px 46px rgba(17,103,255,.28); }
.hero-dashboard {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hero-dashboard div, .feature-card, .category-card, .car-card, .filter-bar, .detail-panel, .detail-copy, .cta-band {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-dashboard div { padding: 22px; }
.hero-dashboard span { display: block; font-size: 38px; font-weight: 900; }
.hero-dashboard small, .car-kicker, .car-info small { color: var(--muted); }

.section, .catalog-shell { padding: clamp(42px, 7vw, 80px) clamp(16px, 5vw, 72px); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; }
.section-head h2, .page-hero h1 { font-size: clamp(30px, 4vw, 54px); line-height: 1.04; margin: 8px 0 0; }
.section-head a { color: var(--blue); font-weight: 800; }
.car-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.car-card { overflow: hidden; transition: transform .24s ease, border-color .24s ease; }
.car-card:hover { transform: translateY(-6px); border-color: rgba(17,103,255,.38); }
.car-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: rgba(17,24,39,.08); }
.car-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.car-card:hover .car-media img { transform: scale(1.06); }
.car-info { padding: 14px; display: grid; gap: 8px; }
.car-info h3 { margin: 0; font-size: 22px; }
.car-info p { min-height: 42px; color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.badge {
  position: absolute;
  z-index: 2;
  padding: 7px 9px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: rgba(17,24,39,.78);
  backdrop-filter: blur(12px);
}
.badge.featured { top: 10px; left: 10px; background: linear-gradient(135deg, #f59e0b, #ef4444); }
.badge.status { top: 10px; right: 10px; }
.badge.available { background: #08996f; }
.badge.sold { background: #475467; }
.badge.reserved { background: #b45309; }
.badge.hot_deal, .badge.promo { background: #dc2626; }
.badge.new_arrival { background: #1167ff; }
.badge.limited { background: #6d28d9; }

.category-grid, .feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.category-card, .feature-card { padding: 20px; min-height: 150px; transition: transform .24s ease, border-color .24s ease; }
.category-card:hover, .feature-card:hover { transform: translateY(-5px); border-color: rgba(124,58,237,.32); }
.category-card span { display: block; font-weight: 900; color: var(--blue); margin-bottom: 16px; }
.category-card strong, .feature-card strong { display: block; font-size: 22px; margin-bottom: 8px; }
.category-card p, .feature-card p { color: var(--muted); line-height: 1.6; margin: 0; }
.category-card.large { min-height: 220px; overflow: hidden; }
.category-card.large img { height: 130px; width: 100%; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.cta-band { margin: clamp(20px, 5vw, 60px) clamp(16px, 5vw, 72px); padding: clamp(28px, 5vw, 56px); display: flex; justify-content: space-between; align-items: center; gap: 20px; }

.page-hero { padding: clamp(42px, 8vw, 94px) clamp(16px, 5vw, 72px) 24px; }
.page-hero.compact { min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.filter-bar { display: grid; grid-template-columns: 1.3fr repeat(5, minmax(120px, .7fr)) auto auto; gap: 10px; padding: 12px; margin-bottom: 22px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
.check-pill { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); }
.check-pill input { width: auto; }
.empty-state, .image-empty {
  grid-column: 1 / -1;
  display: grid; place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.detail-shell { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 22px; padding: clamp(26px, 5vw, 72px); align-items: start; }
.gallery { min-width: 0; }
.main-image { aspect-ratio: 16/10; border-radius: 16px; overflow: hidden; background: rgba(17,24,39,.08); box-shadow: var(--shadow); cursor: zoom-in; }
.main-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .28s ease; }
.main-image.is-zoomed img { transform: scale(1.8); cursor: zoom-out; }
.thumb-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.thumb-row button { border: 1px solid var(--line); padding: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; cursor: pointer; background: var(--surface); }
.thumb-row img { width: 100%; height: 100%; object-fit: cover; }
.detail-panel { position: sticky; top: 86px; padding: 22px; }
.detail-panel h1 { font-size: clamp(42px, 5vw, 68px); margin: 8px 0; }
.detail-price { font-size: 28px; display: block; margin-bottom: 14px; }
.detail-panel dl { margin: 22px 0 0; display: grid; gap: 10px; }
.detail-panel dl div { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.detail-panel dt { color: var(--muted); }
.detail-copy { margin: 0 clamp(16px, 5vw, 72px); padding: 24px; }
.mobile-wa { display: none; }
.recent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.recent-grid a { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.recent-grid img { width: 56px; height: 44px; object-fit: cover; border-radius: 6px; }
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.88); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; padding: 24px; }
.lightbox img { max-height: 90vh; width: 100%; object-fit: contain; }
.lightbox button { border: 0; color: white; background: rgba(255,255,255,.12); border-radius: var(--radius); min-height: 54px; font-size: 32px; cursor: pointer; }
.lightbox [data-lightbox-close] { position: absolute; top: 16px; right: 16px; width: 54px; }

.floating-wa, .back-top {
  position: fixed; right: 18px; z-index: 40;
  border: 0; border-radius: var(--radius);
  color: white; background: #0ea86b;
  padding: 13px 16px; font-weight: 900;
  box-shadow: var(--shadow);
}
.floating-wa { bottom: 20px; }
.back-top { bottom: 78px; background: var(--dark); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.back-top.is-visible { opacity: 1; pointer-events: auto; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 34px clamp(16px, 5vw, 72px); color: var(--muted); border-top: 1px solid var(--line); }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

@media (max-width: 1080px) {
  .hero, .detail-shell { grid-template-columns: 1fr; }
  .hero-bg { opacity: .34; }
  .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-grid, .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-panel { position: static; }
}

@media (max-width: 680px) {
  .site-header { padding: 12px 14px; }
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; top: 62px; left: 12px; right: 12px; display: none; flex-direction: column; align-items: stretch; padding: 12px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .hero { min-height: 78vh; padding-top: 44px; }
  .hero h1 { font-size: 46px; }
  .hero-dashboard { grid-template-columns: repeat(3, 1fr); padding: 8px; }
  .hero-dashboard div { padding: 12px; }
  .hero-dashboard span { font-size: 24px; }
  .section-head, .cta-band, .site-footer { flex-direction: column; align-items: flex-start; }
  .car-grid { gap: 10px; }
  .car-info { padding: 10px; }
  .car-info h3 { font-size: 18px; }
  .car-info p { font-size: 12px; min-height: 36px; }
  .card-actions .btn { width: 100%; }
  .category-grid, .feature-grid, .filter-bar { grid-template-columns: 1fr; }
  .thumb-row { grid-template-columns: repeat(3, 1fr); }
  .detail-shell { padding: 16px; }
  .mobile-wa { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; justify-content: center; border-radius: var(--radius); background: #0ea86b; color: white; padding: 14px; font-weight: 900; box-shadow: var(--shadow); }
  .floating-wa { display: none; }
  .back-top { bottom: 76px; }
  .lightbox { grid-template-columns: 44px 1fr 44px; padding: 12px; }
}

/* CPM gaming catalog refinements */
select option {
  color: #111827;
  background: #ffffff;
}

.hero {
  min-height: calc(100vh - 74px);
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  isolation: isolate;
}

.hero-bg {
  top: 7%;
  right: clamp(16px, 4vw, 64px);
  width: min(760px, 48vw);
  aspect-ratio: 16 / 10;
  border-radius: 24px;
  opacity: .95;
  transform: none;
  background:
    linear-gradient(90deg, rgba(246, 248, 255, .05), rgba(246, 248, 255, 0)),
    url("../img/showroom-hero.png") center / cover;
  z-index: -1;
}

.hero-content {
  z-index: 2;
}

.section-head.stacked {
  display: grid;
  justify-content: start;
  align-items: start;
  gap: 10px;
  max-width: 780px;
  margin-inline: auto;
  text-align: center;
}

.section-head.stacked .eyebrow {
  justify-self: center;
}

.section-head.stacked p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}

.why {
  position: relative;
  overflow: hidden;
}

.why::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: 12%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(17, 103, 255, .18), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
}

.feature-grid {
  align-items: stretch;
}

.feature-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feature-card::after,
.showroom-stat::after,
.cta-band::after {
  content: "";
  position: absolute;
  inset: auto -35% -45% auto;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(124, 58, 237, .22), transparent 68%);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
}

.feature-card:hover::after,
.showroom-stat:hover::after,
.cta-band:hover::after {
  opacity: 1;
  transform: translate(-12px, -12px);
}

.feature-icon,
.stat-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  margin-bottom: 18px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(17, 103, 255, .24);
}

.feature-icon svg,
.stat-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.feature-card strong {
  font-size: 20px;
}

.feature-card p {
  margin-top: auto;
}

.stats-section {
  padding-top: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.showroom-stat {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 20px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .24s ease, border-color .24s ease;
}

.showroom-stat:hover {
  transform: translateY(-5px);
  border-color: rgba(17, 103, 255, .34);
}

.showroom-stat strong {
  display: block;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}

.showroom-stat small {
  color: var(--muted);
  font-weight: 700;
}

.cta-band {
  position: relative;
  overflow: hidden;
}

.cta-band h2 {
  margin-bottom: 10px;
}

.cta-band p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer {
  align-items: center;
  background: rgba(255, 255, 255, .42);
  backdrop-filter: blur(16px);
}

.site-footer p {
  margin: 8px 0 0;
}

.site-footer nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer nav a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  grid-template-columns: 86px minmax(0, 1fr) 86px;
}

.lightbox img {
  justify-self: center;
  max-width: min(100%, 1100px);
  background: #0b0f17;
}

.lightbox button {
  font-size: 14px;
  font-weight: 900;
}

.lightbox [data-lightbox-close] {
  z-index: 2;
}

.is-lightbox-open {
  overflow: hidden;
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-bg {
    width: min(760px, 82vw);
    opacity: .28;
  }

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

@media (max-width: 680px) {
  .hero {
    min-height: 76vh;
  }

  .hero-bg {
    inset: 10% auto auto 10%;
    width: 118vw;
    opacity: .16;
  }

  .section-head.stacked {
    text-align: left;
    margin-inline: 0;
  }

  .section-head.stacked .eyebrow {
    justify-self: start;
  }

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

  .feature-card {
    min-height: 190px;
  }

  .cta-actions {
    width: 100%;
    justify-content: stretch;
  }

  .cta-actions .btn {
    width: 100%;
  }

  .lightbox {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
  }
}
