:root {
  --navy: #17182f;
  --navy-deep: #101122;
  --blue: #1769e0;
  --blue-hover: #0d56c2;
  --text: #232534;
  --muted: #6b6f7b;
  --surface: #f2f4f7;
  --surface-alt: #e3e7ec;
  --border: #d9dde4;
  --white: #fff;
  --shadow: 0 18px 45px rgba(19, 24, 44, 0.12);
  --body: "Poppins", sans-serif;
  --display: "Rajdhani", sans-serif;
  --container: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--surface);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

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

button,
select,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--white);
  background: var(--blue);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--white);
  background: #222238;
  border-bottom: 1px solid #39394e;
}

.header-inner {
  height: 82px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  margin-right: auto;
  height: 64px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.brand-logo {
  display: block;
  width: 190px;
  height: 64px;
  object-fit: cover;
  object-position: center;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 25px;
  font-size: 0.89rem;
  font-weight: 500;
}

.main-nav a:hover,
.main-nav .nav-active {
  color: #8bbcff;
}

.menu-toggle {
  display: none;
  border: 0;
  background: none;
  padding: 10px;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px;
}

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

.button {
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease;
}

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

.button-primary {
  color: var(--white);
  background: var(--blue);
}

.header-cta {
  min-height: 50px;
  padding: 12px 24px;
  background: #004aad;
  font-size: 0.88rem;
}

.button-primary:hover {
  background: var(--blue-hover);
}

.button-small {
  min-height: 42px;
  padding-inline: 16px;
}

.catalog-hero {
  padding: 74px 0 66px;
  color: var(--white);
  background: linear-gradient(125deg, var(--navy), #262849);
}

.eyebrow {
  margin: 0 0 8px;
  color: #8bbcff;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.eyebrow.blue {
  color: var(--blue);
}

.catalog-hero h1,
.vehicle-info h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 0.95;
}

.catalog-hero h1 {
  max-width: 900px;
  font-size: clamp(3.2rem, 7vw, 6rem);
}

.catalog-hero p:last-child {
  max-width: 700px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.75);
}

.catalog-section {
  padding: 48px 0 92px;
}

.filter-bar {
  position: sticky;
  top: 104px;
  z-index: 20;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.filter-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.availability-filter {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
}

.availability-filter input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.filter-reset {
  min-height: 48px;
  padding: 0 14px;
  color: var(--blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.catalog-results-heading {
  margin: 38px 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
}

.catalog-results-heading p {
  margin: 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.vehicle-card {
  position: relative;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vehicle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.vehicle-card:focus-within {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.catalog-card .vehicle-body .button::after {
  content: "";
  position: absolute;
  inset: 0;
}

.vehiculo-card--vendido {
  background: #eceef1;
  border-color: #cfd3da;
}

.vehiculo-card--vendido .vehicle-image img {
  filter: grayscale(1);
  opacity: 0.6;
}

.vehiculo-card--vendido .vehicle-name,
.vehiculo-card--vendido .vehicle-specs {
  color: var(--text);
}

.vehicle-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-alt);
}

.vehicle-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 62%;
}

.vehicle-image b {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  color: var(--text);
  background: var(--white);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.vehiculo-card--vendido .vehicle-status-chip {
  color: #fff;
  background: #555b66;
}

.placeholder-media {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.vehicle-body {
  min-height: 275px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vehicle-body > * {
  margin: 0;
}

.vehicle-name {
  font-family: var(--display);
  font-size: 1.85rem;
  line-height: 1.05;
}

.vehicle-version,
.vehicle-body small {
  color: var(--muted);
}

.vehicle-version,
.vehicle-specs {
  font-size: 0.88rem;
}

.vehicle-body small {
  min-height: 42px;
  font-size: 0.78rem;
}

.vehicle-body .button {
  margin-top: auto;
}

.catalog-message,
.vehicle-loading,
.empty-results {
  grid-column: 1 / -1;
  padding: 58px 24px;
  color: var(--muted);
  text-align: center;
  background: var(--white);
  border: 1px solid var(--border);
}

.catalog-message {
  margin: 0;
}

.vehicle-loading {
  margin-inline: auto;
}

.vehicle-loading:not(.error) {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(23, 105, 224, 0.22);
}

.vehicle-loading:not(.error)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: loading-glass 1.8s ease-in-out infinite;
}

.catalog-message:not(.error) {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(23, 105, 224, 0.22);
}

.catalog-message:not(.error)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: loading-glass 1.8s ease-in-out infinite;
}

@keyframes loading-glass {
  to { transform: translateX(100%); }
}

.catalog-message.error,
.vehicle-loading.error {
  color: #8b1e1e;
}

.empty-results h2 {
  margin: 0 0 8px;
  font: 700 2rem var(--display);
}

.empty-results p {
  margin: 0;
}

.vehicle-detail-page {
  min-height: calc(100vh - 260px);
  padding: 22px 0 92px;
}

.breadcrumbs {
  padding: 18px 0 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumbs a:hover {
  color: var(--blue);
}

.vehicle-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.75fr);
  gap: 42px;
  align-items: start;
}

.gallery-main {
  position: relative;
  height: clamp(480px, calc(100svh - 190px), 760px);
  overflow: hidden;
  background: var(--surface-alt);
}

.gallery-main img,
.gallery-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center 62%;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(16, 17, 34, 0.78);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transform: translateY(-50%);
}

.gallery-arrow--previous { left: 14px; }
.gallery-arrow--next { right: 14px; }
.gallery-arrow svg { width: 28px; height: 28px; fill: currentColor; }
.gallery-arrow:disabled { opacity: 0.4; cursor: not-allowed; }
.gallery-arrow:not(:disabled):hover { background: var(--blue); }
.gallery-arrow:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.gallery-thumb img { object-fit: cover; }

.gallery-thumbs {
  margin-top: 12px;
  padding-bottom: 8px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.gallery-thumb {
  width: 140px;
  min-width: 140px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
}

.gallery-thumb.active {
  border: 2px solid var(--blue);
}

.vehicle-info {
  position: sticky;
  top: 112px;
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.status-badge {
  margin-bottom: 28px;
  padding: 6px 10px;
  display: inline-flex;
  color: var(--white);
  background: var(--blue);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge--vendido {
  background: #555b66;
}

.button.is-disabled {
  color: #5f6570;
  background: #d9dde4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

.vehicle-info h1 {
  color: var(--text);
  font-size: clamp(3.2rem, 6vw, 5.4rem);
}

.detail-version {
  margin: 6px 0 0;
  color: var(--muted);
}

.vehicle-spec-list {
  margin: 28px 0;
}

.vehicle-spec-list div {
  padding: 11px 0;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--border);
}

.vehicle-spec-list dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.vehicle-spec-list dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.vehicle-description {
  margin: -8px 0 24px;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: pre-line;
}

.detail-cta {
  width: 100%;
}

.detail-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.footer {
  padding: 42px 0;
  color: rgba(255, 255, 255, 0.75);
  background: var(--navy-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.footer-logo {
  width: 190px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
  font-size: 0.82rem;
}

.footer-contact a:hover {
  color: var(--white);
}

@media (max-width: 1000px) {
  .header-cta { display: none; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 82px;
    left: 0;
    right: 0;
    padding: 24px;
    flex-direction: column;
    align-items: flex-start;
    color: #fff;
    background: #222238;
    border-bottom: 1px solid #39394e;
  }
  .main-nav.open { display: flex; }

  .filter-bar {
    top: 100px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .vehicle-info {
    position: static;
  }
}

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

  .header-inner {
    height: 70px;
  }

  .brand-logo {
    width: 155px;
    height: 56px;
  }

  .header-cta {
    display: none;
  }

  .main-nav { top: 70px; }

  .catalog-hero {
    padding: 52px 0 48px;
  }

  .catalog-hero h1 {
    font-size: clamp(2.9rem, 14vw, 4.2rem);
  }

  .catalog-section {
    padding: 28px 0 70px;
  }

  .filter-bar {
    position: static;
    grid-template-columns: 1fr;
  }

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

  .vehicle-body {
    min-height: 0;
  }

  .gallery-main {
    height: clamp(280px, calc(100svh - 150px), 620px);
  }

  .gallery-thumb {
    width: 116px;
    min-width: 116px;
    height: 82px;
  }

  .vehicle-info {
    padding: 26px 22px;
  }

  .footer-inner,
  .footer-contact {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}


.gallery-zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-zoom:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

body.photo-dialog-open { overflow: hidden; }

.photo-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 64px 16px 20px;
  border: 0;
  background: transparent;
}

.photo-dialog::backdrop { background: rgba(0, 0, 0, 0.92); }

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

.photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.photo-dialog-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #202020;
  font-size: 30px;
  cursor: pointer;
}

.photo-dialog-close:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
