/* Shared mobile layout owner. Leave intentional editorial carousels alone. */
@media (max-width: 48rem) {
  /* Reset the legacy carousel's implicit columns as well as its template. */
  body.drive-ma-site .drive-brand-block__grid,
  body.drive-ma-site .drive-vehicle-grid {
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    overflow-x: visible !important;
    scroll-snap-type: none !important;
    padding-bottom: 0;
  }
  body.drive-ma-site .drive-vehicle-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.drive-ma-site :is(.drive-brand-block__card, .drive-vehicle-card) {
    min-width: 0;
    scroll-snap-align: none;
  }
  body.drive-ma-site .drive-brand-block__grid {
    gap: .75rem !important;
  }
  body.drive-ma-site .drive-brand-block__main {
    min-width: 0;
    text-align: start;
  }
  body.drive-ma-site .drive-brand-block__logo {
    height: 4.75rem !important;
    padding: .75rem;
  }
  body.drive-ma-site .drive-brand-block__logo img {
    width: 100% !important;
    height: 3.25rem !important;
  }
  body.drive-ma-site .drive-brand-block__details {
    min-width: 0;
    padding: .65rem .15rem .75rem .7rem;
    padding-inline: .7rem .15rem;
  }
  body.drive-ma-site .drive-brand-block__details strong {
    font-size: .9rem;
    overflow-wrap: anywhere;
  }
  body.drive-ma-site .drive-brand-block__arrow {
    padding-inline: .25rem .6rem;
  }
  body.drive-ma-site .drive-brand-block__models {
    gap: .3rem;
    padding: .55rem;
  }
  body.drive-ma-site .drive-brand-block__models a {
    align-items: center;
    display: inline-flex;
    max-width: 100%;
    min-height: 32px;
    font-size: .75rem;
    overflow-wrap: anywhere;
    padding: .3rem .4rem;
  }
  /* The page already has its title. Retain the block heading for screen readers. */
  body.drive-ma-site.page-template-brands .drive-brand-block__header > div {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  body.drive-ma-site.page-template-brands .drive-brand-block__search {
    margin-top: 0;
  }
  body.drive-ma-site.page-template-brands .drive-brand-block {
    padding-block: 1rem !important;
  }
  body.drive-ma-site .drive-brand-directory-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }
  body.drive-ma-site .drive-brand-directory-stats > div:last-child {
    grid-column: 1 / -1;
  }

  /* The drawer includes the same catalogue links; give search room to type. */
  body.drive-ma-site .drive-catalog-toolbar__inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: .5rem;
    padding-block: .4rem !important;
  }
  body.drive-ma-site .drive-catalog-toolbar .drive-explore-menu {
    display: none;
  }
  body.drive-ma-site .drive-catalog-toolbar .drive-quick-search {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 44px;
    margin: 0;
  }
  body.drive-ma-site .drive-catalog-toolbar .drive-toolbar-actions {
    display: flex;
    width: 44px;
    margin: 0;
  }
  body.drive-ma-site .drive-catalog-toolbar .drive-toolbar-actions > :not(.drive-appearance-toggle) {
    display: none;
  }
  body.drive-ma-site .drive-catalog-toolbar .drive-appearance-toggle {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
  }
  body.drive-ma-site .drive-quick-search button {
    flex: 0 0 44px;
    min-width: 44px;
    min-height: 44px;
  }
  body.drive-ma-site :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="submit"]), select, textarea) {
    box-sizing: border-box;
    font-size: max(1rem, 1em) !important;
    max-width: 100%;
    min-width: 0;
  }

  /* Keep the selection and Clear action, without a second fixed reading overlay. */
  html[data-drive-theme] body.drive-ma-site .drive-comparison-tray {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: auto;
    max-width: calc(100% - 2rem);
    margin: 1rem auto;
  }
  body.drive-ma-site .drive-comparison-tray :is(a, button) {
    min-height: 44px;
  }
  body.drive-ma-site .drive-market-mobile-nav a {
    min-width: 0;
    min-height: 48px;
    padding-inline: .15rem;
  }
  body.drive-ma-site :is(.drive-container, .drive-entry-content) > * {
    min-width: 0;
  }
}

@media (max-width: 48rem) {
  /* Put the showroom filters beside the introduction, not below a full screen. */
  body.drive-ma-site .drive-showroom-hero,
  body.drive-ma-site .drive-showroom-hero__inner {
    min-height: 0 !important;
  }
  body.drive-ma-site .drive-showroom-hero__inner {
    display: grid;
    gap: 1rem;
    padding-block: 1rem 1.25rem;
  }
  body.drive-ma-site .drive-showroom-hero__content {
    max-width: none;
    margin: 0;
    animation: none;
    transform: none;
    opacity: 1;
  }
  body.drive-ma-site .drive-showroom-hero h1 {
    font-size: clamp(1.8rem, 8.5vw, 2.2rem) !important;
  }
  body.drive-ma-site .drive-showroom-hero__media {
    opacity: .22;
  }
  body.drive-ma-site .drive-showroom-hero__media :is(figure, img) {
    animation: none;
    transform: none;
    opacity: 1;
  }
  body.drive-ma-site.page-template-default:not(.home) .site-main article.page .entry-content {
    box-sizing: border-box;
    max-width: 72ch;
    width: 100%;
    margin-inline: auto;
    padding: 1.25rem 1rem;
  }
}

@media (max-width: 48rem) {
  body.drive-ma-site .drive-showroom-hero__content { padding-bottom: 0; }
  body.drive-ma-site .drive-showroom-hero__content > p { margin-block: .5rem; }
  body.drive-ma-site .drive-showroom-hero__content > p:not(.drive-showroom-hero__kicker) { font-size: 1rem; line-height: 1.5; }
  body.drive-ma-site .drive-showroom-hero__meta { margin-top: .75rem; }
  body.drive-ma-site .drive-showroom-finder { animation: none; opacity: 1; transform: none; gap: .65rem; }
  body.drive-ma-site .drive-showroom-finder :is(select, button) { min-height: 44px; }
}
@media (min-width: 24rem) and (max-width: 48rem) {
  body.drive-ma-site .drive-showroom-finder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.drive-ma-site .drive-showroom-finder label { grid-column: auto; }
  body.drive-ma-site .drive-showroom-finder :is(label:first-child, button) { grid-column: 1 / -1; }
}

@media (max-width: 48rem) {
  body.drive-ma-site .drive-showroom-finder select { padding-inline: .4rem !important; }
}
@media (max-width: 30rem) {
  body.drive-ma-site .drive-native-lead__grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: .75rem;
  }
  body.drive-ma-site .drive-native-lead__grid > label {
    grid-column: 1 / -1 !important;
    min-width: 0;
  }
}
