/* Gabriel SRP — search results layout.
   Consumes CarGurus' own design tokens (loaded by the real CSS bundles) with
   literal fallbacks so the page still renders if a bundle fails. */
:root{
  --g-brand:var(--surface-brand-blue,#0763d3);
  --g-navy:var(--surface-brand-darkest-blue,#05317b);
  --g-btn:var(--button-bg-color,#0655b8);
  --g-btn-active:var(--button-primary-active-bg-color,#054a9d);
  --g-ink:var(--text-almost-black,#0c0c11);
  --g-mid:var(--text-mid,#666);
  --g-line:var(--borders-light,#e4e4e5);
  --g-line-dark:var(--borders-dark,#c3c3c3);
  --g-soft:var(--surface-neutral-lighter,#f5f5f5);
  --g-font:Graphik,"Rund Display",Helvetica,Arial,system-ui,sans-serif;
}
.g-srp{font-family:var(--g-font);color:var(--g-ink);background:#fff}
.g-srp *,.g-srp *::before,.g-srp *::after{box-sizing:border-box}

/* ---------- hero ---------- */
.g-hero{background:var(--g-navy);color:#fff;padding:26px 0 30px}
.g-hero-in{max-width:1480px;margin:0 auto;padding:0 24px;display:flex;align-items:center;
  justify-content:space-between;gap:32px;flex-wrap:wrap}
.g-hero-kicker{margin:0;font-size:13px;font-weight:600;opacity:.92}
.g-hero-title{margin:2px 0 0;font-size:26px;line-height:1.15;font-weight:700}
.g-searchbar{flex:1 1 440px;max-width:560px}
.g-searchbar input{width:100%;height:44px;border-radius:999px;border:0;padding:0 20px 0 44px;
  font-size:15px;font-family:inherit;color:var(--g-ink);background:#fff
  url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23666'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E")
  no-repeat 16px center/16px 16px}
.g-searchbar input:focus{outline:2px solid var(--g-brand);outline-offset:2px}

/* ---------- category nav ---------- */
.g-catnav{max-width:1480px;margin:0 auto;padding:12px 24px 0;display:flex;gap:8px;flex-wrap:wrap}
.g-cat{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:1px solid var(--g-line);
  border-radius:999px;font-size:13px;font-weight:600;color:var(--g-ink);text-decoration:none;background:#fff}
.g-cat span{color:var(--g-mid);font-weight:500}
.g-cat:hover{border-color:var(--g-brand);color:var(--g-brand)}
.g-cat.is-active{background:var(--g-brand);border-color:var(--g-brand);color:#fff}
.g-cat.is-active span{color:#dbe9fb}

/* ---------- page frame ---------- */
.g-srp ._pageContent_zc8f7_29{max-width:1480px;margin:0 auto;padding:18px 24px 56px}
.g-srp ._coreContent_zc8f7_40{display:grid;grid-template-columns:286px minmax(0,1fr);gap:24px;align-items:start}

/* ---------- sidebar (CarGurus' original wrappers) ---------- */
/* Measured off cargurus.ca/Cars/l-Used-Sedan-bg6 at 1440px: the rail itself
   carries nothing. It is a column of separate cards -- a bordered card for the
   applied chips and Save search, then a grey panel holding one white card per
   filter. We had it as a single bordered box with hairline dividers, which is
   what made it look busier than the original. */
.g-srp ._sidebar_zc8f7_48{display:flex;flex-direction:column;background:none;
  border:0;border-radius:0;padding:0}

/* chips + Save search, their own 16px-radius card */
.g-srp ._card_wgn24_1{display:flex;flex-direction:column;gap:16px;padding:8px;
  border:1px solid #d8dbde;border-radius:16px;background:none}
#g-chips:empty{display:none}
.g-srp ._space_1mkt7_1{height:12px;flex:none}

/* the grey panel every filter sits on */
.g-srp ._panel_il8d3_1{background:#e8ebed;border:1px solid #d8dbde;border-radius:16px;padding:8px}
.g-srp ._filtersAccordionWrapper_il8d3_11{display:flex;flex-direction:column;gap:8px}
.g-srp ._row_wgn24_31{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.g-srp ._row_wgn24_31 h2{margin:0;font-size:17px;font-weight:700}
#g-filter-count{color:var(--g-mid);font-weight:500}
.g-clear{background:none;border:0;color:var(--g-brand);font:600 13px var(--g-font);cursor:pointer;padding:4px}
.g-clear:hover{text-decoration:underline}
.g-chips{display:flex;flex-wrap:wrap;gap:6px}
#g-save-search{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;
  min-height:34px;padding:4px 12px;border:0;border-radius:60px;background:#000049;color:#fff;
  font:600 14px var(--g-font);cursor:pointer}
#g-save-search:hover{background:#001a6b}
.g-chip{display:inline-flex;align-items:center;gap:4px;padding:7px 12px;border-radius:16px;
  background:var(--surface-brand-lightest-blue,#e4f5fe);color:var(--g-navy);font-size:13px;font-weight:600}
.g-chip button{background:none;border:0;cursor:pointer;color:inherit;font-size:14px;line-height:1;padding:0}

/* used/new toggle */
.g-srp ._newUsedToggle_kxaob_1{display:flex;gap:4px;min-height:45px;padding:4px;border-radius:50px;
  background:#f5f5f5;margin:0}
.g-srp ._toggleItem_5um8m_1{flex:1;padding:9px 10px;border:0;border-radius:50px;background:transparent;
  font:600 13px var(--g-font);color:var(--g-mid);cursor:pointer}
.g-srp ._toggleItem_5um8m_1[data-state="on"]{background:var(--g-ink);color:#fff}

/* location card */
.g-srp ._categoryHeading_bgabc_1{display:flex;align-items:flex-end;min-height:28px;margin:0;padding:4px 2px 0}
.g-srp ._categoryHeading_bgabc_1 p{margin:0;font:700 14px var(--g-font);color:var(--g-ink)}
.g-srp ._withoutAccordion_1ppwn_10{background:#fff;border:0;border-radius:8px;padding:14px;margin:0}
.g-srp ._zipWrapper_fxoal_9{display:flex;justify-content:space-between;gap:8px;font-size:13px}
.g-srp ._zipWrapper_fxoal_9 > span{color:var(--g-mid)}
.g-srp ._buttonText_dbebg_41{font-weight:600}
.g-locnote{margin:4px 0 0;font-size:12px;color:var(--g-mid)}

/* accordions */
.g-srp ._accordionCard_1ppwn_1{background:#fff;border:0;border-radius:8px;overflow:hidden}
.g-srp ._accordionCard_1ppwn_1 fieldset{border:0;margin:0;padding:0}
.g-srp ._accordionTrigger_1ppwn_36{width:100%;display:flex;align-items:center;justify-content:space-between;
  gap:8px;min-height:57px;padding:0 14px;background:none;border:0;cursor:pointer;text-align:left}
.g-srp ._accordionTrigger_1ppwn_36 p{margin:0;font:600 14px var(--g-font);color:var(--g-ink)}
.g-srp ._chevronWrapper_1ppwn_43{display:flex;color:var(--g-mid);transition:transform .18s ease}
.g-srp ._chevronWrapper_1ppwn_43 svg{width:13px;height:13px}
.g-srp [data-state="open"] > ._accordionTrigger_1ppwn_36 ._chevronWrapper_1ppwn_43,
.g-srp ._accordionTrigger_1ppwn_36[data-state="open"] ._chevronWrapper_1ppwn_43{transform:rotate(180deg)}
.g-srp ._accordionContent_1ppwn_16[hidden]{display:none}
.g-facet{padding:0 14px 14px}
.g-facet-scroll{max-height:260px;overflow-y:auto;padding-right:4px}
.g-facet-row{display:flex;align-items:center;gap:8px;padding:5px 2px;font-size:13px;cursor:pointer}
.g-facet-row input{width:15px;height:15px;accent-color:var(--g-brand);flex:none;cursor:pointer}
.g-facet-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.g-facet-count{color:var(--g-mid);font-size:12px;flex:none}
.g-facet-row.g-facet-more{display:none}
.g-facet.show-all .g-facet-row.g-facet-more{display:flex}
.g-facet-showall{background:none;border:0;color:var(--g-brand);font:600 13px var(--g-font);
  cursor:pointer;padding:6px 2px}
.g-facet-showall:hover{text-decoration:underline}
.g-range{display:flex;gap:10px;flex-wrap:wrap}
.g-range label{flex:1 1 100px;font-size:12px;color:var(--g-mid);display:flex;flex-direction:column;gap:4px}
.g-range input{height:36px;border:1px solid var(--g-line-dark);border-radius:7px;padding:0 10px;
  font:14px var(--g-font);color:var(--g-ink);width:100%}
.g-range input:focus{outline:2px solid var(--g-brand);outline-offset:1px;border-color:var(--g-brand)}

/* ---------- results header ---------- */
.g-results ._subheader_zc8f7_82{display:flex;align-items:center;justify-content:space-between;
  gap:16px;flex-wrap:wrap;margin-bottom:14px}
#g-count{font-size:15px;font-weight:600}
.g-sortwrap{display:flex;align-items:center;gap:8px;font-size:14px}
.g-sortwrap label{color:var(--g-mid)}
#g-sort{height:36px;border:1px solid var(--g-line-dark);border-radius:7px;padding:0 30px 0 10px;
  font:14px var(--g-font);background:#fff;cursor:pointer;color:var(--g-ink)}

/* ---------- tile grid ---------- */
.g-srp ._tileLayout_iidfw_1{display:grid;grid-template-columns:repeat(auto-fill,minmax(282px,1fr));gap:18px}
.g-srp ._tileFrame_iidfw_8,.g-srp ._tileSlot_iidfw_18{height:100%}
.g-srp [data-testid="srp-listing-tile"]{position:relative;display:flex;flex-direction:column;height:100%;
  border:1px solid var(--g-line);border-radius:12px;overflow:hidden;background:#fff;
  transition:box-shadow .16s ease,border-color .16s ease}
.g-srp [data-testid="srp-listing-tile"]:hover{box-shadow:0 6px 20px #0000001f;border-color:var(--g-line-dark)}
.g-srp ._propertiesList_7inth_1{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.g-srp [data-testid="tile-link"]{position:absolute;inset:0;z-index:2;text-indent:-9999px;overflow:hidden}
.g-srp [data-testid="srp-tile-media"]{position:relative;aspect-ratio:4/3;background:var(--g-soft)}
.g-srp [data-testid="srp-tile-image-native-lazy"]{position:absolute;inset:0}
.g-srp [data-testid="srp-listing-tile-image"]{width:100%;height:100%;object-fit:cover;display:block}
.g-nophoto{display:flex;align-items:center;justify-content:center;height:100%;color:var(--g-mid);font-size:13px}
.g-srp ._northEast_r20bb_20{position:absolute;top:8px;right:8px;z-index:3}
.g-srp [data-testid="listing-save-button"]{width:34px;height:34px;border-radius:50%;border:0;cursor:pointer;
  background:#ffffffe6;display:flex;align-items:center;justify-content:center;color:var(--g-ink)}
.g-srp [data-testid="listing-save-button"]:hover{background:#fff;color:var(--g-brand)}
.g-srp [data-testid="listing-save-button"] svg{width:16px;height:16px}
.g-srp [data-testid="listing-save-button"][aria-pressed="true"]{color:#bd1a2e}

.g-srp [data-testid="srp-tile-body"]{display:flex;flex-direction:column;gap:9px;padding:13px 14px 14px;flex:1}
.g-srp ._mainBody_has0r_17{display:flex;flex-direction:column;gap:7px;flex:1}
.g-srp [data-testid="srp-listing-blade-title"]{margin:0;font-size:15px;font-weight:700;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.g-srp ._infoWrapper_2e3ca_38{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--g-mid);min-width:0}
.g-srp ._infoWrapper_2e3ca_38 p{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.g-srp ._trim_15e7s_1{min-width:0;flex:0 1 auto}
.g-srp ._mileage_2e3ca_48{flex:none}
.g-srp ._titleSeparator_2e3ca_19{width:3px;height:3px;border-radius:50%;background:var(--g-line-dark);flex:none}
.g-srp [data-testid="srp-tile-location-section"]{font-size:12.5px;line-height:1.45;min-width:0}
.g-srp [data-testid="LocationSection-secondLine"] span{color:var(--g-mid)}
.g-srp ._textEllipsis_1oejt_1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.g-srp ._content_1s4fl_1{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:auto;padding-top:4px}
.g-srp ._columnLeft_1s4fl_42{display:flex;flex-wrap:wrap;align-items:flex-start;
  align-content:flex-start;gap:4px;min-width:0;flex:1 1 auto}
.g-srp [data-testid="srp-tile-price"]{margin:0;font-size:20px;font-weight:700;white-space:nowrap}
.g-cta{flex:1;display:flex;align-items:center;justify-content:center;height:40px;border-radius:8px;
  background:var(--g-btn);color:#fff;font:600 14px var(--g-font);text-decoration:none;position:relative;z-index:3}
.g-cta:hover{background:var(--g-btn-active)}

/* ---------- pager / empty ---------- */
.g-pager{display:flex;flex-direction:column;align-items:center;gap:8px;padding:30px 0 0}
.g-morebtn{padding:11px 26px;border-radius:8px;border:1px solid var(--g-btn);background:#fff;
  color:var(--g-btn);font:600 14px var(--g-font);cursor:pointer}
.g-morebtn:hover{background:var(--surface-brand-lightest-blue,#e4f5fe)}
.g-shown{margin:0;color:var(--g-mid);font-size:13px}
.g-empty{padding:56px 20px;text-align:center;color:var(--g-mid)}
.g-empty button{margin-top:12px;padding:10px 20px;border-radius:8px;border:1px solid var(--g-btn);
  background:#fff;color:var(--g-btn);font:600 14px var(--g-font);cursor:pointer}

@media (max-width:1080px){
  .g-srp ._coreContent_zc8f7_40{grid-template-columns:1fr}
  .g-sidebar{position:static;max-height:none}
}
@media (max-width:620px){
  .g-hero-in{padding:0 16px}
  .g-srp ._pageContent_zc8f7_29{padding:14px 16px 40px}
  .g-catnav{padding:12px 16px 0}
  .g-srp ._tileLayout_iidfw_1{grid-template-columns:1fr}
}

/* ---------------------------------------------------- header + location
   The results header stacks the two lines on the left with the search box on
   the right, which is how the page reads on arrival. These rules only fill in
   the bits the original drives from page state (the live search input in the
   typeahead slot, the label/value rows in the location card). */
.g-typeahead{width:100%;height:44px;border-radius:999px;border:0;padding:0 20px;
  font:inherit;font-size:15px;color:var(--g-ink);background:#fff;
  box-shadow:0 1px 3px #0000002e}
.g-typeahead::placeholder{color:var(--g-mid)}
.g-typeahead:focus{outline:2px solid var(--g-brand);outline-offset:2px}

.g-locrow{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:7px 0;font-size:13.5px}
.g-loclabel{color:var(--g-mid)}
.g-locvalue{color:var(--g-ink);font-weight:600}
.g-locrow + .g-locrow{border-top:1px solid var(--g-line)}

/* the seller line in the tile footer, where the original shows a phone number */
.g-seller{font-size:12.5px;color:var(--g-mid);display:block;max-width:190px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.g-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* The applied-filter badge is laid out with display:flex, which beats the
   hidden attribute, so an untouched panel showed a blue dot. */
._appliedFilterBadge_1ppwn_72[hidden]{display:none !important}

/* The tile footer: one full-width button, matching the original. Both the
   server-rendered and the browser-rendered tiles land on these rules. */
.g-srp ._contactSellerContainer_i1zpf_1,
.g-srp ._contactSellerContainer_2lg3o_1{display:flex;gap:8px;margin-top:10px}
.g-srp ._contactSellerContainer_i1zpf_1 > a,
.g-srp ._contactSellerContainer_2lg3o_1 > a{flex:1 1 auto;white-space:nowrap}

/* Filter panels open but showed nothing: the stylesheet animates the panel's
   height from a custom property the original's accordion script sets, so with
   that script gone every open panel sat at height:0 with its contents clipped.
   Give an open panel its natural height and drop the animation. */
.g-srp ._accordionContent_1ppwn_16[data-state="open"]{
  height:auto !important;
  animation:none !important;
  overflow-y:auto;
}
.g-srp ._accordionContent_1ppwn_16[data-state="closed"]{display:none}

/* New stock, badged where the original puts its "New arrival" flag */
.g-badge-new{display:inline-block;background:var(--surface-brand-darkest-blue,#05317b);
  color:#fff;font-size:11.5px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;
  padding:4px 10px;border-radius:4px;box-shadow:0 1px 3px #00000033}
.g-srp ._southWest_r20bb_31{position:absolute;left:10px;bottom:10px;z-index:2}

/* Both badges sit in the same corner slot, so let them sit side by side. */
.g-srp ._southWest_r20bb_31{display:flex;gap:6px;align-items:center;flex-wrap:wrap;
  max-width:calc(100% - 20px)}
