/* Keep the language switch and contact actions in separate header columns. */
@media (min-width: 701px) and (max-width: 1660px) {
  .site-header:has(> .main-nav > .language-switch):has(> .header-action) {
    display: grid !important;
    grid-template-columns: minmax(150px, 250px) minmax(0, 1fr) max-content !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    gap: 8px clamp(14px, 1.1vw, 20px) !important;
    box-sizing: border-box !important;
    min-height: 104px !important;
    padding: 10px clamp(16px, 1.6vw, 28px) !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .brand {
    grid-area: 1 / 1 !important;
    justify-self: start !important;
    width: 100% !important;
    max-width: 250px !important;
    margin: 0 !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .brand img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .main-nav {
    grid-area: 1 / 2 !important;
    position: static !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px clamp(10px, 1vw, 16px) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .main-nav > a:not(.language-switch) {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    min-height: 40px !important;
    padding-block: 6px !important;
    font-size: clamp(12px, 1vw, 14px) !important;
    white-space: nowrap !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .main-nav > a.active::after {
    bottom: 3px !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .main-nav > .language-switch {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 44px !important;
    box-sizing: border-box !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 5px !important;
    border: 1px solid #bfd8e8 !important;
    border-radius: 50% !important;
    background: #f4f9fc !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .language-switch:is(:hover, :focus-visible) {
    border-color: #54ad2b !important;
    background: #fff !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .language-switch:focus-visible {
    outline: 2px solid #0877b9;
    outline-offset: 2px;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .language-switch__flag {
    position: static !important;
    display: block !important;
    box-sizing: border-box !important;
    flex: 0 0 28px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    border-width: 1px !important;
    box-shadow: none !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .language-switch__text {
    position: absolute !important;
    display: block !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .header-action {
    grid-area: 1 / 3 !important;
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .header-action .phone {
    min-width: 0 !important;
    grid-template-columns: 24px auto !important;
    column-gap: 6px !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .header-action .phone-icon {
    font-size: 23px !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .header-action .phone strong {
    font-size: clamp(13px, 1.02vw, 16px) !important;
    white-space: nowrap !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .header-action .phone small {
    font-size: 10px !important;
    white-space: nowrap !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) .header-action .quote-button {
    min-width: 0 !important;
    min-height: 44px !important;
    padding-inline: 13px !important;
    font-size: clamp(12px, .93vw, 14px) !important;
    white-space: nowrap !important;
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  .site-header:has(> .main-nav > .language-switch):has(> .header-action) {
    grid-template-columns: minmax(0, 1fr) max-content !important;
    grid-template-rows: auto auto !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .brand {
    max-width: clamp(155px, 25vw, 220px) !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .main-nav {
    grid-area: 2 / 1 / 3 / -1 !important;
  }

  .site-header:has(> .main-nav > .language-switch):has(> .header-action) > .header-action {
    grid-area: 1 / 2 !important;
  }
}

/* Give the alert filters the same label-to-field spacing at every width. */
.best-price-alert__form .best-price-alert__filters > label {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 8px;
}

.best-price-alert__form .best-price-alert__filters > label > :is(input, select) {
  box-sizing: border-box;
  min-width: 0;
  margin-top: 0;
}

.vehicle-picker .vehicle-search-feedback,
.vehicle-picker .vehicle-id-search > #vehicleIdFeedback {
  grid-column: 1 / -1;
  min-height: 0;
  margin: 0;
  color: #173955;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.5;
}

.vehicle-picker .vehicle-search-feedback:not(:empty) {
  padding: .7rem .85rem;
  border-left: 3px solid #54ad2b;
  border-radius: 6px;
  background: #f4f9fc;
}

.vehicle-picker :is(.vehicle-search-feedback, #vehicleIdFeedback):empty {
  position: absolute;
}

/* Size the picture wrapper before fitting the complete photo inside it. */
.overview-page .overview-grid .vehicle-card .vehicle-card__image-stage > .vehicle-card__picture {
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
}
.overview-page .overview-grid .vehicle-card :is(.vehicle-card__image-stage, .vehicle-card__image-link) img,
.overview-page .overview-grid .vehicle-card:is(:hover, :focus-within) :is(.vehicle-card__image-stage, .vehicle-card__image-link) img {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}
