:root {
  --ink: #f7f7f7;
  --muted: #aaa7a8;
  --line: rgba(255, 255, 255, 0.14);
  --paper: #070707;
  --soft: #121212;
  --dark: #e10613;
  --accent: #e10613;
  --accent-deep: #97000a;
  --panel: rgba(10, 10, 10, 0.86);
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.48);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 12%, rgba(225, 6, 19, 0.12), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
}

.site-header {
  position: fixed;
  top: 10px;
  right: clamp(12px, 2.2vw, 30px);
  left: clamp(12px, 2.2vw, 30px);
  z-index: 10;
  height: 62px;
  padding: 0 clamp(14px, 3vw, 34px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(225, 6, 19, 0.34);
  border-radius: 16px;
  background: rgba(5, 5, 5, 0.88);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.brand {
  width: 124px;
  padding-inline-start: 10px;
  border-inline-start: 3px solid var(--accent);
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 100%;
  display: block;
  filter: brightness(0) invert(1);
}

.model-nav,
.header-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

.model-nav {
  min-width: 0;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.model-nav::-webkit-scrollbar {
  display: none;
}

.model-nav a,
.header-nav a {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.model-nav a:hover,
.header-nav a:hover {
  color: var(--accent);
}

.model-nav a.is-current {
  color: var(--accent);
  text-decoration: none;
}

.model-nav a.is-current::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: var(--accent);
}

.language-toggle {
  width: 42px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(225, 6, 19, 0.12);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.language-toggle:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.vehicle-hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 98px 18px 30px;
  border-bottom: 1px solid rgba(225, 6, 19, 0.18);
  isolation: isolate;
}

.hero-image,
.hero-shade,
.hero-gallery {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-gallery {
  overflow: hidden;
  background: #030303;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.hero-gallery.is-dragging {
  cursor: grabbing;
}

.hero-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--image-position, center 55%);
}

/* Tesla-like stacked crossfade — opacity only, no zoom jitter */
.hero-gallery .hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.hero-gallery .hero-image.is-active {
  opacity: 1;
  z-index: 1;
}

/* Segmented progress rail (in-flow, above actions — no overlap) */
.hero-gallery-rail {
  width: min(100%, 520px);
  margin: 0 auto 4px;
  padding: 4px 0 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  z-index: 2;
}

.hero-gallery-controls {
  width: fit-content;
  margin: 0 auto -4px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 3;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: blur(12px);
}

.hero-gallery-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-gallery-controls button:hover {
  background: var(--accent);
}

.hero-gallery-controls svg {
  width: 16px;
  height: 16px;
}

html[dir="ltr"] .hero-gallery-controls svg {
  transform: scaleX(-1);
}

.hero-gallery-controls span {
  min-width: 52px;
  color: #fff;
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.hero-seg {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.hero-seg::before {
  content: "";
  position: absolute;
  inset: -10px 0;
}

.hero-seg-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right center;
  pointer-events: none;
}

html[dir="ltr"] .hero-seg-fill {
  transform-origin: left center;
}

.hero-seg.is-past {
  background: rgba(225, 6, 19, 0.58);
}

.hero-seg.is-past .hero-seg-fill {
  transform: scaleX(0);
  animation: none;
}

.hero-seg.is-active .hero-seg-fill {
  animation: gallery-seg-fill 4.5s linear forwards;
}

.vehicle-hero.is-gallery-paused .hero-seg.is-active .hero-seg-fill {
  animation-play-state: paused;
}

@keyframes gallery-seg-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.hero-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.08) 38%, rgba(0, 0, 0, 0.88) 100%),
    linear-gradient(90deg, rgba(225, 6, 19, 0.1), transparent 42%, rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.vehicle-hero.has-gallery .hero-gallery {
  z-index: 0;
}

.vehicle-hero.has-gallery .hero-shade {
  z-index: 1;
  /* Lighter center so car photos stay vivid; keep readable text zones */
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.08) 34%, rgba(0, 0, 0, 0.18) 58%, rgba(0, 0, 0, 0.9) 100%),
    linear-gradient(90deg, rgba(225, 6, 19, 0.12), transparent 40%, rgba(0, 0, 0, 0.16));
}

.vehicle-hero.has-gallery .hero-copy,
.vehicle-hero.has-gallery .hero-bottom {
  position: relative;
  z-index: 2;
}

.vehicle-hero.has-gallery {
  /* Keep car more centered in tall viewports */
  --image-position: center 48%;
  --mobile-image-position: center 50%;
}

.hero-copy {
  align-self: start;
  justify-self: center;
  max-width: 860px;
  text-align: center;
}

.hero-copy p,
.section-heading p,
.three-d-header p,
.version-item p,
.drawer-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.hero-copy p {
  color: #ff3541;
  letter-spacing: 0.06em;
}

.hero-copy h1 {
  margin: 5px 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 7.8vw, 5.55rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.035em;
  text-shadow: 0 5px 26px rgba(0, 0, 0, 0.5);
}

.hero-copy span {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.12rem);
  font-weight: 800;
}

.hero-bottom {
  align-self: end;
  justify-self: center;
  width: min(100%, 980px);
  display: grid;
  gap: 14px;
}

.vehicle-hero.has-gallery .hero-bottom {
  gap: 12px;
}

.hero-actions {
  width: min(100%, 620px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 88px;
  gap: 12px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  text-decoration: none;
}

.primary-action {
  background: linear-gradient(135deg, #f10a18, var(--accent-deep));
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(225, 6, 19, 0.28);
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--panel);
  color: var(--ink);
}

.primary-action:hover,
.secondary-action:hover {
  border-color: var(--accent);
  background: var(--accent-deep);
  color: #fff;
}

.primary-action svg,
.secondary-action svg,
.close-button svg,
.inventory-item svg {
  width: 18px;
  height: 18px;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-color: rgba(225, 6, 19, 0.3);
  background: rgba(7, 7, 7, 0.84);
  box-shadow: var(--shadow);
  border-radius: 16px;
  overflow: hidden;
}

.spec-strip div {
  min-height: 76px;
  padding: 14px 12px;
  display: grid;
  place-items: center;
  text-align: center;
  border-left: 1px solid var(--line);
}

.spec-strip div:last-child {
  border-left: 0;
}

.spec-strip strong,
.detail-row strong,
.version-item strong,
.drawer-price,
.inventory-item strong {
  color: var(--ink);
  font-weight: 900;
}

.spec-strip span,
.detail-row span,
.version-item small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.inventory-section {
  width: min(calc(100% - 28px), 1100px);
  margin: 72px auto 90px;
  padding-top: 22px;
}

.section-heading {
  margin-bottom: 20px;
  text-align: center;
}

.section-heading h2 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.12;
}

.section-heading::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.inventory-count {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.filter-rail {
  margin: 0 auto 16px;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 18, 18, 0.92);
  scrollbar-width: none;
}

.filter-rail::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.filter-chip.is-active {
  background: var(--dark);
  color: #ffffff;
}

.inventory-list {
  display: grid;
  gap: 12px;
}

.empty-state {
  min-height: 150px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--soft);
  font-weight: 900;
}

.inventory-item {
  min-height: 132px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 46px;
  align-items: center;
  gap: 18px;
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(110deg, #151515, #0c0c0c);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.inventory-item:hover {
  border-color: rgba(225, 6, 19, 0.58);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.32);
  transform: translateY(-2px);
}

.inventory-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

.inventory-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.inventory-item h3 {
  margin: 4px 0;
  font-size: clamp(1.15rem, 3vw, 1.8rem);
  line-height: 1.1;
}

.inventory-item strong {
  display: block;
}

.inventory-item a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--dark);
  color: #fff;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(5px);
}

.details-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 20;
  width: min(520px, 100vw);
  overflow-y: auto;
  border-inline-start: 1px solid rgba(225, 6, 19, 0.42);
  background: #090909;
  box-shadow: var(--shadow);
  transform: translateX(105%);
  visibility: hidden;
  transition:
    transform 220ms ease,
    visibility 0s linear 220ms;
}

.details-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 220ms ease;
}

.close-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: rgba(18, 18, 18, 0.94);
  color: var(--ink);
}

.details-drawer > .close-button {
  position: sticky;
  top: 12px;
  z-index: 2;
  margin: 12px;
}

.drawer-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #050505;
}

.drawer-gallery {
  display: grid;
  gap: 10px;
  padding-bottom: 4px;
}

.drawer-gallery-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #050505;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.drawer-gallery-stage.is-dragging {
  cursor: grabbing;
}

.drawer-gallery-stage > .drawer-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  opacity: 0;
  transition: opacity 450ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}

.drawer-gallery-stage > .drawer-image.is-active {
  opacity: 1;
  z-index: 1;
}

.drawer-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 6, 19, 0.34);
  background: rgba(8, 8, 8, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(23, 26, 32, 0.18);
  transform: translateY(-50%);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.drawer-gallery-nav:hover {
  background: var(--accent);
}

.drawer-gallery-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.drawer-gallery-nav.is-prev {
  left: 10px;
}

.drawer-gallery-nav.is-next {
  right: 10px;
}

/* Arabic/RTL: mirror controls so next sits on the start side (left) */
html[dir="rtl"] .drawer-gallery-nav.is-prev {
  left: auto;
  right: 10px;
}

html[dir="rtl"] .drawer-gallery-nav.is-next {
  right: auto;
  left: 10px;
}

html[dir="rtl"] .drawer-gallery-nav svg {
  transform: scaleX(-1);
}

.drawer-gallery-nav svg {
  width: 20px;
  height: 20px;
}

.drawer-gallery-count {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(23, 26, 32, 0.72);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.drawer-thumbs {
  display: flex;
  gap: 8px;
  padding: 0 12px 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.drawer-thumbs::-webkit-scrollbar {
  height: 4px;
}

.drawer-thumbs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(225, 6, 19, 0.42);
}

.drawer-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #050505;
  scroll-snap-align: center;
  cursor: pointer;
  opacity: 0.72;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.drawer-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.drawer-thumb:hover {
  opacity: 0.92;
}

.drawer-thumb.is-active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.drawer-body {
  padding: 22px;
}

.drawer-body h2 {
  margin: 6px 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.1;
}

.drawer-price {
  display: block;
  margin-bottom: 18px;
  font-size: 1.25rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

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

.detail-row {
  min-height: 62px;
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.details-grid:not(.compact) .detail-row:nth-child(odd) {
  margin-left: 20px;
}

.details-grid:not(.compact) .detail-row:nth-child(even) {
  margin-right: 20px;
}

.detail-row strong {
  text-align: left;
}

.drawer-versions {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.version-item {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #151515, #0d0d0d);
}

.version-item h3 {
  margin: 3px 0 14px;
  color: var(--ink);
  font-size: 1.08rem;
}

.version-item strong,
.version-item small {
  display: block;
}

.version-item strong {
  font-size: 1.45rem;
}

.version-item ul {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.version-item li {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.drawer-contact {
  width: 100%;
}

.three-d-modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  place-items: center;
  padding: 14px;
}

.three-d-modal.is-open {
  display: grid;
}

.three-d-dialog {
  width: min(100%, 1000px);
  height: min(86vh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(225, 6, 19, 0.4);
  background: #090909;
  box-shadow: var(--shadow);
}

.three-d-header {
  min-height: 66px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.three-d-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.2rem;
}

.three-d-dialog model-viewer {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background:
    radial-gradient(circle at 50% 72%, rgba(225, 6, 19, 0.18), transparent 25rem),
    #101010;
}

.toast-stack {
  position: fixed;
  right: 50%;
  bottom: 18px;
  z-index: 30;
  display: grid;
  justify-items: center;
  pointer-events: none;
  transform: translateX(50%);
}

.hidden-admin-entry {
  position: fixed;
  left: 9px;
  bottom: 8px;
  z-index: 8;
  padding: 5px 7px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
  direction: ltr;
  transition: color 160ms ease, background 160ms ease;
}

.hidden-admin-entry:hover,
.hidden-admin-entry:focus-visible {
  background: rgba(0, 0, 0, 0.76);
  color: rgba(255, 255, 255, 0.68);
  outline: 1px solid rgba(225, 6, 19, 0.4);
}

.toast {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 800;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease;
}

.toast svg {
  width: 16px;
  height: 16px;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 860px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    top: 8px;
    right: 8px;
    left: 8px;
    height: 56px;
    padding: 0 12px;
    gap: 9px;
    border-radius: 13px;
  }

  .header-nav {
    display: none;
  }

  .model-nav {
    justify-content: flex-start;
    gap: 16px;
    padding: 0;
  }

  .language-toggle {
    width: 38px;
    height: 32px;
    font-size: 0.74rem;
  }

  .brand {
    width: 96px;
    flex-shrink: 0;
  }

  .model-nav a {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.8rem;
  }

  .model-nav a.is-current {
    background: transparent;
    color: var(--accent);
    text-decoration: none;
  }

  .vehicle-hero {
    min-height: 100svh;
    padding: 78px 12px max(14px, env(safe-area-inset-bottom));
    background: #050505;
  }

  .hero-image {
    object-position: var(--mobile-image-position, center 46%);
  }

  .hero-gallery .hero-image {
    transform: scale(1.01);
  }

  .hero-gallery-rail {
    width: 100%;
    gap: 4px;
    margin-bottom: 2px;
  }

  .hero-gallery-controls {
    margin-bottom: -2px;
  }

  .hero-seg {
    height: 2.5px;
  }

  .hero-copy {
    max-width: 100%;
    padding-top: 2px;
  }

  .hero-copy p {
    font-size: 0.76rem;
  }

  .hero-copy h1 {
    max-width: 11ch;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(2.15rem, 11vw, 3.35rem);
    line-height: 0.98;
  }

  .hero-copy span {
    display: block;
    max-width: 23ch;
    margin: 0 auto;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .hero-bottom {
    gap: 10px;
  }

  .hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-actions .primary-action {
    grid-column: 1 / -1;
  }

  .primary-action,
  .secondary-action {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.88rem;
  }

  .spec-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
  }

  .spec-strip div {
    min-height: 68px;
    padding: 10px 8px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .spec-strip strong {
    font-size: 0.94rem;
  }

  .spec-strip span {
    font-size: 0.76rem;
  }

  .filter-rail {
    width: 100%;
    justify-content: flex-start;
  }

  .spec-strip div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .details-grid:not(.compact) .detail-row,
  .details-grid:not(.compact) .detail-row:nth-child(odd),
  .details-grid:not(.compact) .detail-row:nth-child(even) {
    margin: 0;
  }
}

@media (max-width: 520px) {
  .site-header {
    height: 54px;
  }

  .brand {
    width: 92px;
  }

  .vehicle-hero {
    min-height: 100svh;
    padding-top: 72px;
  }

  .vehicle-hero.has-gallery .hero-shade {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.74) 0%, rgba(0, 0, 0, 0.06) 30%, rgba(0, 0, 0, 0.22) 55%, rgba(0, 0, 0, 0.94) 88%),
      linear-gradient(90deg, rgba(225, 6, 19, 0.12), transparent 45%, rgba(0, 0, 0, 0.12));
  }

  .hero-copy h1 {
    max-width: 13ch;
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .hero-actions {
    width: 100%;
  }

  .inventory-item {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 12px;
    padding: 8px;
  }

  .inventory-item img {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
    object-position: center 48%;
  }

  .drawer-gallery-stage {
    min-height: 42svh;
  }

  .drawer-gallery-stage > .drawer-image {
    object-fit: contain;
    background: #050505;
  }
}
