/* Shared mobile overflow fixes — stacked/wrapped strips (max-width: 768px) */

@media (max-width: 768px) {
  body[class$="-page"],
  body.home-page {
    overflow-x: clip;
  }

  body[class$="-page"] main,
  body.home-page main {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  body[class$="-page"] .container,
  body.home-page .container {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  /* ── Empty state panels ───────────────────────────────────── */
  .sav-empty,
  .cmp-empty,
  .trk-empty,
  .blg-empty,
  body.stock-page .stock-empty {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
  }

  .sav-empty > p,
  .cmp-empty > p,
  .trk-empty > p,
  .blg-empty > p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }

  .sav-empty-actions,
  .cmp-empty-actions,
  .blg-empty-actions,
  body.stock-page .stock-empty-actions {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .sav-empty-actions .btn,
  .cmp-empty-actions .btn,
  .blg-empty-actions .btn,
  body.stock-page .stock-empty-actions .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Empty step strips */
  .sav-empty-steps,
  .cmp-empty-steps,
  .trk-empty-steps {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    max-width: 100% !important;
    min-width: 0;
    width: 100%;
  }

  .sav-empty-step,
  .cmp-empty-step,
  .trk-empty-step {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: none;
  }

  /* Sidebar card strips */
  .sav-sidebar,
  .blg-sidebar,
  .cmp-sidebar,
  .cnt-sidebar {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .sav-side-card,
  .blg-side-card,
  .cmp-side-card {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
  }

  .blg-side-card > p,
  .blg-side-btn,
  .blg-side-link {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .blg-side-card > p {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .blg-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .blg-tags span {
    flex: 0 1 auto !important;
    white-space: normal;
    max-width: 100%;
  }

  .blg-layout,
  .blg-main,
  .blg-content {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .cnt-channel,
  .cnt-hours {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Hero step / highlight strips */
  .pay-hero-steps,
  .trk-hero-steps,
  .trm-hero-steps,
  .prv-hero-highlights {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pay-step,
  .trk-step,
  .trm-step,
  .prv-highlight {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    scroll-snap-align: none;
  }

  /* Compare hero slots */
  .cmp-slots {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .cmp-slot {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: none;
  }

  /* Compare vehicle cards */
  .cmp-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    overflow: visible !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .cmp-vehicle-card {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    scroll-snap-align: none;
  }

  .cmp-table-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 14px !important;
    max-width: 100%;
    overflow-x: auto;
  }

  /* Quote stock chips */
  .sav-quote-stocks,
  .cmp-quote-stocks {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  .sav-quote-stocks span,
  .cmp-quote-stocks span {
    flex: 0 1 auto;
    white-space: normal;
    max-width: 100%;
  }

  /* About market + credentials */
  .abt-markets .container,
  .abt-creds .container {
    padding-right: 16px !important;
  }

  .abt-market-chips {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .abt-market-chip {
    flex: 0 1 auto;
    white-space: normal;
    max-width: 100%;
  }

  .abt-creds {
    overflow-x: clip;
  }

  .abt-creds-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: flex-start !important;
  }

  .abt-cred {
    flex: 0 1 auto;
    white-space: normal;
    max-width: 100%;
  }

  /* Legal TOC chips */
  .trm-toc,
  .prv-toc {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  .trm-toc a,
  .prv-toc a {
    flex: 0 1 auto;
    max-width: 100%;
  }

  /* Homepage brands */
  body.home-page .hp-brands .container {
    padding-right: 16px !important;
  }

  body.home-page .hp-brands-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  body.home-page .hp-brand {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    scroll-snap-align: none;
  }
}

@media (max-width: 480px) {
  .sav-empty-step,
  .cmp-empty-step,
  .trk-empty-step,
  .sav-side-card,
  .blg-side-card,
  .cmp-side-card,
  .cmp-slot,
  .cmp-vehicle-card,
  .pay-step,
  .trk-step,
  .trm-step,
  .prv-highlight {
    flex: none !important;
    width: 100%;
    max-width: 100%;
  }

  .pay-hero-steps,
  .trk-hero-steps,
  .trm-hero-steps,
  .prv-hero-highlights {
    grid-template-columns: 1fr !important;
  }

  body.home-page .hp-brands-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
