/* vehicle details */

.vehicle-details-page {
  background-color: #f8f9fb;
}

.vehicle-details-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  color: #667085;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.vehicle-details-back:hover,
.vehicle-details-back:focus-visible {
  color: var(--color-primary);
}

.vehicle-details-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.vehicle-details-title {
  margin: 8px 0 0;
  color: #111827;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
}

.vehicle-details-subtitle {
  margin: 12px 0 0;
  color: #667085;
  font-size: 16px;
  line-height: 1.5;
}

.vehicle-details-reference {
  flex-shrink: 0;
  color: #98a2b3;
  font-size: 12px;
}

.vehicle-details-reference strong {
  color: #667085;
}

/* layout */

.vehicle-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  align-items: start;
  gap: 32px;
}

.vehicle-details-main {
  display: grid;
  min-width: 0;
  gap: 24px;
}

/* gallery */

.vehicle-details-section,
.vehicle-purchase-card {
  border: 1px solid #eaecf0;
  border-radius: 18px;
  background-color: #ffffff;
  box-shadow: 0 4px 18px rgb(17 24 39 / 5%);
}

.vehicle-gallery {
  display: grid;
  gap: 12px;
}

.vehicle-gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 24px;
  background-color: #111827;
  box-shadow: 0 18px 38px rgb(17 24 39 / 14%);
  scroll-behavior: smooth;
}

.vehicle-gallery-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.vehicle-gallery-slide {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  transition:
    opacity 0.4s ease,
    display 0.4s allow-discrete;
}

.vehicle-gallery-radio:checked + .vehicle-gallery-slide {
  display: block;
  opacity: 1;
}

@starting-style {
  .vehicle-gallery-radio:checked + .vehicle-gallery-slide {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vehicle-gallery-slide {
    transition: none;
  }
}

.vehicle-gallery-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vehicle-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(0 0 0 / 48%), transparent 42%);
  pointer-events: none;
}

.vehicle-gallery-placeholder {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #98a2b3;
}

.vehicle-gallery-placeholder i {
  font-size: 64px;
}

.vehicle-gallery-badges {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.vehicle-details-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding-inline: 12px;
  border-radius: 999px;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.vehicle-details-badge-accent {
  background-color: var(--color-accent);
}

.vehicle-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgb(0 0 0 / 52%);
  color: #ffffff;
  font-size: 21px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgb(0 0 0 / 18%);
  cursor: pointer;
  user-select: none;
  transform: translateY(-50%);
  transition: background-color 0.2s ease;
}

.vehicle-gallery-arrow:hover,
.vehicle-gallery-arrow:focus-visible {
  background-color: rgb(0 0 0 / 80%);
  color: #ffffff;
}

.vehicle-gallery-arrow-previous {
  left: 16px;
}

.vehicle-gallery-arrow-next {
  right: 16px;
}

.vehicle-gallery-counter {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background-color: rgb(0 0 0 / 60%);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.vehicle-gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vehicle-gallery-thumbnail {
  display: none;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background-color: #eef1f5;
  opacity: 0.62;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.vehicle-gallery-thumbnail:hover,
.vehicle-gallery-thumbnail:focus-visible {
  border-color: var(--color-primary);
  opacity: 1;
  transform: translateY(-1px);
}

.vehicle-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* content */

.vehicle-details-section {
  padding: 30px;
}

.vehicle-details-section h2 {
  margin: 0 0 22px;
  color: #111827;
  font-size: 21px;
  font-weight: 800;
}

.vehicle-specifications {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.vehicle-specification {
  display: flex;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  padding: 14px;
  border-radius: 13px;
  background-color: #f8f9fb;
}

.vehicle-specification dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.vehicle-specification dt i {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background-color:
    color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-size: 14px;
}

.vehicle-specification dd {
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.vehicle-details-description {
  color: #667085;
  font-size: 15px;
  line-height: 1.75;
}

.vehicle-details-description > :first-child {
  margin-top: 0;
}

.vehicle-details-description > :last-child {
  margin-bottom: 0;
}

.vehicle-equipment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vehicle-equipment-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #475467;
  font-size: 14px;
  line-height: 1.45;
}

.vehicle-equipment-list i {
  color: var(--color-primary);
  font-size: 16px;
}

/* purchase */

.vehicle-purchase-card {
  position: sticky;
  top: 112px;
  padding: 28px;
}

.vehicle-purchase-label {
  margin: 0 0 6px;
  color: #98a2b3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vehicle-purchase-price {
  margin: 0 0 10px;
  color: #111827;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.1;
}

.vehicle-purchase-tax {
  margin: 0 0 24px;
  color: #667085;
  font-size: 12px;
}

.vehicle-purchase-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
  padding-inline: 18px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.vehicle-purchase-button-primary {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: #ffffff;
}

.vehicle-purchase-button-primary:hover,
.vehicle-purchase-button-primary:focus-visible {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: #ffffff;
}

.vehicle-purchase-button-secondary {
  border-color: #e4e7ec;
  color: #344054;
}

.vehicle-purchase-button-secondary:hover,
.vehicle-purchase-button-secondary:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.vehicle-purchase-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eaecf0;
  color: #667085;
}

.vehicle-purchase-note i {
  color: var(--color-primary);
  font-size: 18px;
}

.vehicle-purchase-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

/* tablet */

@media (max-width: 960px) {
  .vehicle-details-layout {
    grid-template-columns: 1fr;
  }

  .vehicle-purchase-card {
    position: static;
  }
}

/* mobile */

@media (max-width: 600px) {
  .vehicle-details-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .vehicle-details-reference {
    align-self: flex-start;
  }

  .vehicle-gallery-thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .vehicle-gallery-main {
    border-radius: 16px;
  }

  .vehicle-gallery-arrow {
    width: 38px;
    height: 38px;
  }

  .vehicle-gallery-arrow-previous {
    left: 10px;
  }

  .vehicle-gallery-arrow-next {
    right: 10px;
  }

  .vehicle-details-section,
  .vehicle-purchase-card {
    padding: 22px;
    border-radius: 14px;
  }

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

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

.vehicle-purchase-company {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  background-color: #f8f9fb;
}

.vehicle-purchase-company-name {
  margin: 0 0 10px;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

.vehicle-purchase-company-info {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 8px;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.vehicle-purchase-company-info:last-child {
  margin-bottom: 0;
}

.vehicle-purchase-company-info i {
  color: var(--color-primary);
  font-size: 15px;
}


/* similar vehicles */

.vehicle-similar {
  margin-top: 64px;
}

.vehicle-similar-title {
  margin: 0 0 28px;
  color: #111827;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.2;
}

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

@media (max-width: 900px) {
  .vehicle-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .vehicle-similar {
    margin-top: 48px;
  }

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

.vehicle-gallery-lightbox-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.vehicle-gallery-lightbox-trigger {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.vehicle-gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgb(0 0 0 / 52%);
  color: #ffffff;
  font-size: 21px;
  cursor: pointer;
  user-select: none;
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked) .vehicle-gallery-lightbox-close {
  display: inline-flex;
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked) .vehicle-gallery-main {
  position: fixed;
  inset: 40px 60px;
  aspect-ratio: auto;
  z-index: 1100;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 85%);
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked) .vehicle-gallery-slide > img {
  object-fit: contain;
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked) .vehicle-gallery-lightbox-trigger {
  cursor: zoom-out;
}

html:has(.vehicle-gallery-lightbox-toggle:checked) {
  overflow: hidden;
}

@media (max-width: 768px) {
  .vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked) .vehicle-gallery-main {
    inset: 24px 16px;
  }
}

/* Fix slide positioning and dimensions */
.vehicle-gallery-main > .vehicle-gallery-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

/* The image is nested inside a label */
.vehicle-gallery-slide > .vehicle-gallery-lightbox-trigger {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.vehicle-gallery-slide > .vehicle-gallery-lightbox-trigger > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Fullscreen mode */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-main {
  position: fixed;
  inset: 16px;
  width: auto;
  height: auto;
  margin: 0;
  aspect-ratio: auto;
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-lightbox-trigger > img {
  object-fit: contain;
}

/* Remove the image overlay in fullscreen mode */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-overlay {
  display: none;
}

/* Keep the close button above the image */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-lightbox-close {
  display: inline-flex;
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

/* Add a subtle dimmed background in fullscreen mode */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-main {
  background: rgb(0 0 0 / 40%);
  box-shadow: 0 0 0 9999px rgb(0 0 0 / 40%);
  border-radius: 0;
}

/* Center the fullscreen photo counter to avoid floating widgets */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-counter {
  left: 50%;
  right: auto;
  bottom: 16px;
  transform: translateX(-50%);
}

/* Round the visible photo corners in fullscreen mode */
.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-lightbox-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vehicle-gallery:has(.vehicle-gallery-lightbox-toggle:checked)
.vehicle-gallery-lightbox-trigger > img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 16px;
}

/* unavailable vehicle */

.vehicle-unavailable {
  text-align: center;
}

.vehicle-unavailable-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: clamp(24px, 6vw, 56px) 0 32px;
  color: var(--color-primary);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  text-transform: uppercase;
}

.vehicle-unavailable-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.vehicle-unavailable-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-inline: 20px;
  border: 1px solid var(--color-primary);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.vehicle-unavailable-button:hover,
.vehicle-unavailable-button:focus-visible {
  background-color: var(--color-primary);
  color: #ffffff;
}
