/* v5.8.0 conditional CSS: catalogue route/layout + filter/empty-state layer (v2.9–v3.0) */
/* v2.9.0 — catalogue route + layout stabilisation */
.catalog-section .catalog-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:24px;align-items:start}
.catalog-section .catalog-main{width:100%;min-width:0}
.catalog-section .filters-panel-v17{width:100%;min-width:0;overflow:visible}
.catalog-section .filters-panel-v17 form{min-width:0}
.catalog-section .filters-panel-v17 .filter-grid{grid-template-columns:minmax(0,1fr)}
.catalog-section .filters-panel-v17 input,.catalog-section .filters-panel-v17 select{min-width:0;max-width:100%}
.catalog-section .filters-panel-v17 .checkline{display:flex!important;align-items:center;gap:9px}
.catalog-section .filters-panel-v17 .checkline input{width:auto;min-height:0;flex:0 0 auto}
.catalog-section .catalog-top-v17{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-width:0;min-height:58px}
.catalog-section .catalog-count{display:flex;align-items:baseline;gap:7px;min-width:0}
.catalog-section .catalog-count strong{display:inline!important;margin:0;font-size:30px;line-height:1}
.catalog-section .catalog-count span{min-width:0;line-height:1.35}
.catalog-section .catalog-top-v17 .sort-form{width:auto;min-width:220px;flex:0 0 auto}
.catalog-section .catalog-top-v17 .sort-form select{width:100%;min-width:220px}
.catalog-section .active-picks{min-width:0;margin:-2px 0 18px}
.catalog-section .catalog-car-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;width:100%;min-width:0}
.catalog-section .catalog-car-grid>.car-card{width:100%;min-width:0}
@media(min-width:1081px){
  /* v7.7.0: let the page scroll naturally. The old internal scrollbar made
     the filter look clipped and hid lower controls from users. */
  .catalog-section .filters-panel-v17{position:static;max-height:none;overflow:visible;overscroll-behavior:auto;scrollbar-gutter:auto}
}
@media(max-width:1180px){
  .catalog-section .catalog-layout{grid-template-columns:280px minmax(0,1fr);gap:18px}
  .catalog-section .catalog-car-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:901px) and (max-width:1080px){
  .catalog-section .catalog-layout{grid-template-columns:260px minmax(0,1fr);gap:18px}
  .catalog-section .filters-panel-v17{position:static;top:auto;max-height:none;overflow:visible;overscroll-behavior:auto;scrollbar-gutter:auto}
  .catalog-section .catalog-top-v17 .sort-form{min-width:190px}
  .catalog-section .catalog-top-v17 .sort-form select{min-width:190px}
}
@media(max-width:900px){
  .catalog-section .catalog-layout{grid-template-columns:minmax(0,1fr);gap:16px}
  .catalog-section .filters-panel-v17{position:static;max-height:none;overflow:visible;order:0}
  .catalog-section .catalog-main{order:1}
  .catalog-section .catalog-car-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .catalog-section .catalog-top-v17{display:flex;align-items:center}
  .catalog-section .catalog-top-v17 .sort-form{width:auto;min-width:190px}
  .catalog-section .catalog-top-v17 .sort-form select{min-width:190px}
}
@media(max-width:720px){
  .catalog-section .catalog-car-grid{grid-template-columns:minmax(0,1fr)!important}
  .catalog-section .catalog-top-v17{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-items:start}
  .catalog-section .catalog-count{display:flex}
  .catalog-section .catalog-top-v17 .sort-form{width:100%;min-width:0}
  .catalog-section .catalog-top-v17 .sort-form select{width:100%;min-width:0}
  .catalog-section .active-picks{display:flex;flex-wrap:nowrap;overflow-x:auto;padding-bottom:5px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .catalog-section .active-picks a{flex:0 0 auto;white-space:nowrap}
}
@media(max-width:420px){
  .catalog-section .catalog-count{display:grid;gap:2px}
  .catalog-section .catalog-count strong{font-size:28px}
}


/* v3.0.0 — filter transparency, empty states, dealer onboarding and performance polish */
.active-filters{display:grid;gap:10px;margin:0 0 18px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 24px rgba(15,23,42,.045)}
.active-filters-head{display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:13px}.active-filters-head strong{color:#334155}.active-filters-head a{color:var(--blue);font-weight:800;white-space:nowrap}
.active-filter-chips{display:flex;flex-wrap:wrap;gap:8px}.active-filter-chip{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-height:36px;padding:7px 10px 7px 12px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-size:13px;font-weight:750;transition:.16s}.active-filter-chip:hover{background:#dbeafe}.active-filter-chip span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.active-filter-chip b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:rgba(37,99,235,.11);font-size:16px;line-height:1}
.catalog-empty-state{grid-column:1/-1;display:grid;justify-items:center;text-align:center;padding:44px 28px;background:#fff;border:1px dashed #cbd5e1;border-radius:24px;box-shadow:0 12px 34px rgba(15,23,42,.045)}.catalog-empty-state h2{margin:8px 0 8px!important;font-size:clamp(24px,3vw,32px)!important;letter-spacing:-.035em}.catalog-empty-state p{max-width:650px;margin:0;color:var(--muted);line-height:1.65}.empty-state-icon{display:grid;place-items:center;width:54px;height:54px;border-radius:17px;background:#eff6ff;color:var(--blue);font-size:30px;font-weight:700}.empty-state-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:20px}
.dealer-onboarding-section{padding-top:0}.dealer-onboarding{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(360px,.9fr);gap:26px;align-items:center;padding:30px;background:linear-gradient(135deg,#fff,#f8fafc);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow)}.dealer-onboarding h2{margin:0 0 12px}.dealer-onboarding p{max-width:680px;margin:0 0 20px;color:var(--muted);line-height:1.65}.dealer-onboarding-points{display:grid;gap:10px}.dealer-onboarding-points div{padding:15px 16px;background:#fff;border:1px solid var(--line);border-radius:16px}.dealer-onboarding-points strong{display:block;margin-bottom:4px}.dealer-onboarding-points span{display:block;color:var(--muted);font-size:13px;line-height:1.45}
@media(max-width:900px){.active-filters{margin-bottom:14px}.dealer-onboarding{grid-template-columns:1fr;padding:22px}.dealer-onboarding-points{grid-template-columns:repeat(3,minmax(0,1fr))}.catalog-empty-state{padding:34px 20px}}
@media(max-width:720px){.active-filters-head{align-items:flex-start}.active-filter-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:3px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}.active-filter-chip{flex:0 0 auto;max-width:86vw}.empty-state-actions{width:100%}.empty-state-actions .btn{flex:1 1 220px}.dealer-onboarding-points{grid-template-columns:1fr}}
@media(max-width:520px){.catalog-empty-state{padding:28px 15px;border-radius:20px}.empty-state-actions{display:grid;grid-template-columns:1fr}.empty-state-actions .btn{width:100%}.dealer-onboarding{padding:18px;border-radius:20px}.dealer-onboarding .hero-actions{grid-template-columns:1fr}.dealer-onboarding .hero-actions .btn{width:100%}}



/* v7.8.0 — hard containment for catalogue controls.
   Some Core/plugin styles can give native fields an intrinsic width larger
   than the sidebar. Force every filter control to stay inside its grid track. */
.catalog-section .catalog-layout,
.catalog-section .filters-panel-v17,
.catalog-section .filters-panel-v17 form,
.catalog-section .filters-panel-v17 .filter-grid,
.catalog-section .filters-panel-v17 .filter-grid>label{
  min-width:0;
  max-width:100%;
}
.catalog-section .filters-panel-v17 .filter-grid>label{
  display:block;
  width:100%;
}
.catalog-section .filters-panel-v17 .filter-grid input,
.catalog-section .filters-panel-v17 .filter-grid select,
.catalog-section .filters-panel-v17 .filter-grid textarea{
  display:block;
  box-sizing:border-box;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
@media(min-width:901px){
  .catalog-section .filters-panel-v17{z-index:2}
  .catalog-section .catalog-main{position:relative;z-index:1}
}

/* v7.10.0 — keep the catalogue filter heading compact.
   The generic `.section h2` rule is intentionally large for content sections,
   but it must not win inside the narrow filter sidebar. */
.catalog-section #catalog-filters .filter-head{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin-bottom:16px}
.catalog-section #catalog-filters .filter-head h2{min-width:0;margin:0;font-size:24px;line-height:1.08;letter-spacing:-.035em;white-space:nowrap}
.catalog-section #catalog-filters .filter-head .reset-link{font-size:14px;line-height:1.2;white-space:nowrap}
@media(min-width:901px) and (max-width:1180px){
  .catalog-section #catalog-filters .filter-head h2{font-size:21px}
  .catalog-section #catalog-filters .filter-head .reset-link{font-size:13px}
}
