/*
 * WEBDEV-2643 - Parts listing: one sticky toolbar, Fitment and Filters flyouts, no sidebar.
 *
 * Loaded after listing-ui-redesign.css (and listing-condensed.css on /parts-condensed) on the two APS listing
 * pages. Every selector is scoped under .listing-toolbar-page, a hook class the page adds to
 * .listing-page-redesign on the non-microsite branch only, so the sidebar / filter-panel rules in
 * listing-ui-redesign.css and part-listing.css keep serving the six microsite templates untouched.
 *
 * Those stylesheets use !important freely, so the overrides here do too, with higher specificity where the
 * originals already carry an id or .listing-page-redesign. Colours and sizes come from
 * docs/deploy/WEBDEV-2576/mockups/listing-toolbar-flyout.html.
 *
 * Sticky stack (desktop): site header -> .listing-toolbar (top: --listing-header-h) -> .parts-group-header
 * (top: --listing-sticky-top = header + toolbar, written by listing-toolbar.js).
 */

.listing-toolbar-page {
    --listing-header-h: var(--aps-parts-drawer-top, 80px);
    --lt-teal: #004d4f;
    --lt-teal-ink: #175a5e;
    --lt-mint: #4de0ba;
    --lt-line: #dfe5e7;
    --lt-chip-line: #c9d3d8;
    --lt-text: #1a2433;
    --lt-muted: #687481;
    --lt-amber-bg: #fff3cf;
    --lt-amber-line: #e5b53a;
    --lt-amber-ink: #6b4a00;
    --lt-amber-dot: #e5a100;
    --lt-flyout-w: 380px;
}

@media (min-width: 1024px) {
    .listing-toolbar-page {
        --listing-header-h: var(--aps-parts-drawer-top, 133px);
    }
}

/* The compiled Tailwind build emits .hidden before .inline-flex (WEBDEV-2640), so this page toggles the
   `hidden` attribute instead and pins it here. */
.listing-page-redesign.listing-toolbar-page [hidden],
.listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar .listing-mobile-toolbar__btn[hidden],
.listing-flyout [hidden],
.listing-stepper [hidden] {
    display: none !important;
}

/* No sidebar column: the list is full width. */
.listing-toolbar-page #parts-grid {
    display: block;
    gap: 0 !important;
}

.listing-toolbar-page #main-content-area,
.listing-toolbar-page .parts-listing-shell {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* The amber "Check the fit" banner is replaced by the fitment chips (Blade copies are not rendered; this is
   the one getFitmentBannerHtml() injects). */
.listing-toolbar-page #parts-list-fitment-banner,
.listing-toolbar-page .parts-list-fitment-banner {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Toolbar                                                             */
/* ------------------------------------------------------------------ */
.listing-toolbar-page .listing-toolbar {
    position: sticky;
    top: var(--listing-header-h);
    z-index: 58;
    background: #fff;
    border-bottom: 1px solid var(--lt-line);
}

.listing-toolbar-page .listing-toolbar__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 24px;
    min-height: 50px;
    box-sizing: border-box;
}

.listing-toolbar-page .listing-toolbar__title,
.listing-toolbar-page h1.listing-toolbar__title.part-title {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
    color: var(--lt-teal) !important;
    -webkit-text-fill-color: var(--lt-teal) !important;
    background: none !important;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-toolbar-page .listing-toolbar__right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Chips */
.listing-toolbar-page .listing-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--lt-chip-line);
    background: #fff;
    font-family: var(--listing-font-body);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    color: var(--lt-text);
    white-space: nowrap;
    cursor: pointer;
    max-width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.listing-toolbar-page .listing-chip svg {
    width: 12px;
    height: 12px;
    flex: none;
}

.listing-toolbar-page .listing-chip:hover {
    border-color: var(--lt-teal-ink);
}

.listing-toolbar-page .listing-chip:focus-visible {
    outline: 2px solid var(--lt-mint);
    outline-offset: 2px;
}

.listing-toolbar-page .listing-chip--ghost {
    color: var(--lt-teal-ink);
    border-color: var(--lt-teal-ink);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.listing-toolbar-page .listing-chip--ghost:hover,
.listing-toolbar-page .listing-chip--ghost[aria-expanded="true"] {
    background: var(--lt-teal-ink);
    color: #fff;
}

.listing-toolbar-page .listing-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.listing-toolbar-page .listing-chip__count {
    background: var(--lt-teal);
    color: #fff;
    border-radius: 999px;
    padding: 0 6px;
    font-size: 10px;
    line-height: 16px;
    min-width: 16px;
    text-align: center;
}

/* Fitment chips */
.listing-toolbar-page .listing-fitment-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
}

.listing-toolbar-page .listing-chip--fitment {
    max-width: 320px;
}

.listing-toolbar-page .listing-chip--fitment .listing-chip__label b {
    font-weight: 800;
}

.listing-toolbar-page .listing-chip--sel {
    background: var(--lt-teal);
    border-color: var(--lt-teal);
    color: #fff;
}

.listing-toolbar-page .listing-chip--sel .listing-chip__label b {
    color: var(--lt-mint);
}

.listing-toolbar-page .listing-chip--sel:hover {
    border-color: var(--lt-mint);
}

.listing-toolbar-page .listing-chip--need {
    background: var(--lt-amber-bg);
    border-color: var(--lt-amber-line);
    color: var(--lt-amber-ink);
}

.listing-toolbar-page .listing-chip--need::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lt-amber-dot);
    flex: none;
}

.listing-toolbar-page .listing-chip--need:hover {
    border-color: var(--lt-amber-ink);
}

/* Part type currently listed (multi-part search) */
.listing-toolbar-page .listing-chip--active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lt-mint);
}

/* Right side: total, sort, view switch (the heading-bar rules were scoped to .listing-heading) */
.listing-toolbar-page .listing-toolbar .listing-total {
    margin: 0;
    font-family: var(--listing-font-display);
    font-size: 11px;
    font-weight: 900;
    color: var(--lt-teal) !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.listing-toolbar-page .listing-toolbar .sort-by-container {
    position: relative;
    height: 30px;
    border: 1px solid var(--lt-chip-line);
    border-radius: 6px;
    background: #fff;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    overflow: hidden;
    width: auto;
    min-width: 200px;
}

.listing-toolbar-page .listing-toolbar .sort-by-container::after {
    content: '\f078';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: var(--lt-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--lt-teal);
    font-size: 11px;
    pointer-events: none;
    z-index: 2;
}

.listing-toolbar-page .listing-toolbar .sort-by-label {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    font-size: 10px;
    font-weight: 800;
    color: #74808a;
    margin: 0;
    padding: 0 0 0 10px;
    flex: none;
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
}

.listing-toolbar-page .listing-toolbar .sort-select {
    position: relative;
    border: none !important;
    background: transparent !important;
    font-size: 12px !important;
    color: #2d3948 !important;
    padding: 0 36px 0 6px !important;
    height: 30px !important;
    min-height: 30px !important;
    line-height: 30px !important;
    box-shadow: none !important;
    width: auto !important;
    flex: 1 1 auto;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.listing-toolbar-page .listing-toolbar .listing-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--lt-teal-ink);
    border-radius: 999px;
    background: #fff;
    color: var(--lt-teal-ink);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
}

.listing-toolbar-page .listing-toolbar .listing-view-toggle:hover,
.listing-toolbar-page .listing-toolbar .listing-view-toggle:focus-visible {
    background: var(--lt-teal-ink);
    color: #fff;
    text-decoration: none;
}

.listing-toolbar-page .listing-toolbar .listing-view-toggle svg {
    width: 14px;
    height: 14px;
    flex: none;
}

/* ------------------------------------------------------------------ */
/* Edit search panel (existing form + Recents, directly under the row) */
/* ------------------------------------------------------------------ */
.listing-toolbar-page .listing-edit-search {
    display: none;
    border-top: 1px solid var(--lt-line);
    background: #f8fafb;
}

.listing-toolbar-page .listing-edit-search.is-open {
    display: block;
}

.listing-toolbar-page .listing-edit-search .listing-topbar {
    padding: 14px 24px 12px;
    border-bottom: 0;
}

.listing-toolbar-page .listing-edit-search .listing-recents {
    border-top: 1px solid #edf0f1;
}

/* ------------------------------------------------------------------ */
/* Second line: applied filters (shown only when something is applied)   */
/* ------------------------------------------------------------------ */
.listing-toolbar-page .listing-subline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 24px;
    font-size: 12px;
    color: #44505c;
    background: #fff;
    border-bottom: 1px solid #e3e8ea;
}
.listing-toolbar-page .listing-subline::before {
    content: "Filters applied";
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #7a858e;
    margin-right: 2px;
}

.listing-toolbar-page .listing-subline__tags {
    display: contents;
}

.listing-toolbar-page .listing-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 4px 0 10px;
    border-radius: 999px;
    border: 1px solid #bfe3dc;
    background: #e6f4f1;
    color: #07585a;
    font-weight: 800;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    max-width: 100%;
    box-sizing: border-box;
}

.listing-toolbar-page .listing-tag__text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.listing-toolbar-page .listing-tag__x {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: rgba(7, 88, 90, 0.1);
    color: #07585a;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.listing-toolbar-page .listing-tag__x:hover {
    background: #07585a;
    color: #fff;
}

.listing-toolbar-page .listing-subline__clear {
    height: 26px;
    padding: 0 10px;
    border: 1px solid #c9d3d8;
    border-radius: 999px;
    background: #fff;
    color: #44505c;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
}

.listing-toolbar-page .listing-subline__clear:hover {
    border-color: #0b8e81;
    color: #0b8e81;
}
/* Recommended pill: outline until the strip is open, then filled */
.listing-toolbar-page .listing-chip--rec.is-open {
    background: var(--lt-teal);
    border-color: var(--lt-teal);
    color: #fff;
}
.listing-toolbar-page .listing-chip--rec.is-open .listing-chip__count {
    background: #fff;
    color: var(--lt-teal);
}




/* Recommended Parts strip stays in the DOM for part-listing.js; the link expands it in place. */
.listing-toolbar-page #recommended-parts-banner:not(.is-open) {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Yard group header: one line, about 36px, sticky under the toolbar   */
/* ------------------------------------------------------------------ */
.listing-toolbar-page .parts-group-header {
    top: var(--listing-sticky-top) !important;
}

@media (min-width: 1025px) {
    .listing-page-redesign.listing-toolbar-page .parts-group-header {
        min-height: 36px !important;
        padding: 4px 24px !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header > .flex {
        gap: 8px !important;
        flex-wrap: nowrap !important;
        min-width: 0;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .parts-group-logo-wrap,
    .listing-page-redesign.listing-toolbar-page .parts-group-header img {
        width: 24px !important;
        height: 24px !important;
        max-width: 24px !important;
        border-radius: 4px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller {
        margin-left: 0 !important;
        min-width: 0;
        display: flex;
        align-items: center;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller-name,
    .listing-page-redesign.listing-toolbar-page .parts-group-header .text-lg.font-bold {
        font-size: 13px !important;
        line-height: 1.2 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller-type {
        display: none !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller-rating-pill {
        height: 24px !important;
        padding: 0 8px !important;
        margin-left: 6px !important;
        font-size: 11px !important;
        gap: 4px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller-rating-pill__star {
        font-size: 13px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .seller-rating-pill__num {
        font-size: 11px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .location-pill,
    .listing-page-redesign.listing-toolbar-page .parts-group-header .results-count-pill,
    .listing-page-redesign.listing-toolbar-page .parts-group-header .matches-pill {
        height: 24px !important;
        min-height: 24px !important;
        padding: 0 9px !important;
        font-size: 11px !important;
        gap: 6px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .location-pill .location-pill__sep {
        font-size: 16px !important;
    }

    .listing-page-redesign.listing-toolbar-page .parts-group-header .matches-pill {
        margin-left: 8px !important;
    }
}

/* ------------------------------------------------------------------ */
/* Flyout shell: right-hand panel on desktop, bottom sheet on phones   */
/* ------------------------------------------------------------------ */
.listing-flyout {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 120;
    font-family: var(--listing-font-body);
    color: var(--lt-text);
}

.listing-flyout.is-open {
    display: block;
}

.listing-flyout__scrim {
    position: absolute;
    inset: 0;
    background: rgba(6, 40, 42, 0.18);
}

.listing-flyout__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--lt-flyout-w, 380px);
    max-width: 100vw;
    background: #fff;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.listing-flyout__grab {
    display: none;
}

.listing-flyout__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e3e8ea;
    flex: none;
}

.listing-flyout__heading h2 {
    margin: 0;
    font-family: var(--listing-font-display);
    font-size: 18px;
    font-weight: 900;
    color: var(--lt-teal);
    line-height: 1.2;
}

.listing-flyout__heading small {
    display: block;
    font-size: 12px;
    color: var(--lt-muted);
    font-weight: 500;
    margin-top: 2px;
}

.listing-flyout__close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--lt-muted);
    font-size: 16px;
    cursor: pointer;
    flex: none;
}

.listing-flyout__close:hover {
    background: #f1f5f6;
    color: var(--lt-text);
}

.listing-flyout__body {
    padding: 14px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.listing-flyout__footer {
    padding: 12px 20px;
    border-top: 1px solid #e3e8ea;
    display: flex;
    gap: 10px;
    flex: none;
}

.listing-flyout__btn {
    flex: 1;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--lt-chip-line);
    background: #fff;
    color: #44505c;
    font-family: var(--listing-font-display);
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
}

.listing-flyout__btn--primary {
    background: var(--lt-mint);
    border-color: var(--lt-mint);
    color: #07585a;
}

.listing-flyout__btn--primary:hover {
    background: #3fd4ae;
}

/* WEBDEV-2644, multi-part search: the flyout shows one part type at a time (the current tab) at every width.
   listing-toolbar.js marks the header and its rows with .listing-fitment-current. */
#listing-fitment-flyout.is-one-type #fitment-tree-container .fitment-part-type-header,
#listing-fitment-flyout.is-one-type #fitment-tree-container .fitment-children,
#listing-fitment-flyout.is-one-type #fitment-tree-container .listing-fitment-note {
    display: none !important;
}

#listing-fitment-flyout.is-one-type #fitment-tree-container .fitment-part-type-header.listing-fitment-current {
    display: flex !important;
    margin-top: 0 !important;
}

#listing-fitment-flyout.is-one-type #fitment-tree-container .fitment-children.listing-fitment-current,
#listing-fitment-flyout.is-one-type #fitment-tree-container .fitment-part-type-header.listing-fitment-current + .listing-fitment-note {
    display: block !important;
}

/* ------------------------------------------------------------------ */
/* Fitment flyout body: the sidebar markup restyled for a white panel  */
/* ------------------------------------------------------------------ */
#listing-fitment-flyout #fitment-filters-section {
    margin: 0 !important;
}

#listing-fitment-flyout .sidebar-fit-title {
    display: none !important;
}

#listing-fitment-flyout #fitment-filters-section > .flex {
    justify-content: flex-end !important;
    margin-bottom: 6px !important;
}

#listing-fitment-flyout #clear-fitment-filter {
    color: #0b8e81 !important;
    opacity: 1 !important;
    font-size: 12px !important;
    font-weight: 700;
}

#listing-fitment-flyout #clear-fitment-filter:hover {
    color: var(--lt-teal) !important;
    text-decoration: underline;
}

#listing-fitment-flyout #fitment-filters-subtitle {
    color: var(--lt-muted) !important;
    font-size: 12px !important;
    margin-bottom: 10px !important;
}

#listing-fitment-flyout .narrow-fitment-banner--sidebar,
#listing-fitment-flyout .narrow-fitment-banner--sidebar.narrow-fitment-banner--on {
    background: #f5f8f8 !important;
    border: 1px solid #e3e8ea !important;
    border-left: 3px solid var(--lt-mint) !important;
    color: var(--lt-text) !important;
    margin: 0 0 12px !important;
}

#listing-fitment-flyout .narrow-fitment-banner--sidebar .narrow-fitment-banner__title {
    color: var(--lt-text) !important;
}

#listing-fitment-flyout .narrow-fitment-banner--sidebar .narrow-fitment-banner__hint {
    color: var(--lt-muted) !important;
}

#listing-fitment-flyout .narrow-fitment-banner--sidebar .narrow-fitment-banner__checkbox:checked + .narrow-fitment-banner__switch::after {
    background: var(--lt-teal) !important;
}

#listing-fitment-flyout .fitment-side-filter-btn {
    color: var(--lt-text);
}

/* Part type header -> section title with the Selected / Choose one tag */
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header-box,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header--active {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 0 6px !important;
    margin: 16px 0 8px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #0b5e59 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header:first-child {
    margin-top: 0 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header--active {
    border-bottom: 2px solid var(--lt-mint) !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-chevron,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-link .fa-arrow-right {
    display: none !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-part-type-cart-icon,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-cart-icon i {
    color: #0b5e59 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-part-type-link,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header-box .fitment-part-type-name,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-header--active .fitment-part-type-link,
#listing-fitment-flyout #fitment-tree-container .fitment-part-type-link:hover {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex: 0 1 auto !important;
    width: auto !important;
    color: #0b5e59 !important;
    font-family: var(--listing-font-display);
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    line-height: 1.3 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-part-type-link:hover {
    text-decoration: underline;
}

#listing-fitment-flyout .listing-fitment-tag {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.5;
    white-space: nowrap;
}

#listing-fitment-flyout .listing-fitment-tag--ok {
    background: #d8f7ef;
    color: #0d887d;
}

#listing-fitment-flyout .listing-fitment-tag--todo {
    background: var(--lt-amber-bg);
    color: var(--lt-amber-ink);
}

/* Fitment rows -> radio-style options */
#listing-fitment-flyout #fitment-tree-container .fitment-children {
    margin: 0 !important;
    padding: 0 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option,
#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-level-2.fitment-option {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px;
    margin: 0 0 6px !important;
    padding: 9px 12px 9px 38px !important;
    min-height: 0 !important;
    border: 1px solid #dfe4e8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--lt-text) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-align: left;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid #b7c2c8;
    box-sizing: border-box;
    background: #fff;
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option:hover {
    border-color: #0b8e81 !important;
    background: #f7fcfb !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option.selected,
#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-level-2.fitment-option.selected {
    border-color: #0b8e81 !important;
    background: #edf9f6 !important;
    color: #07585a !important;
    font-weight: 700 !important;
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option.selected::before {
    border-color: #0b8e81;
    background: radial-gradient(#0b8e81 45%, #fff 50%);
}

#listing-fitment-flyout #fitment-tree-container .fitment-children .fitment-option.fitment-inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Filters flyout body: #filter-panel loses its fixed-column styling   */
/* ------------------------------------------------------------------ */
#listing-filters-flyout #filter-panel.parts-filter-panel,
#listing-filters-flyout #filter-panel.parts-filter-panel.hidden,
#listing-filters-flyout #filter-panel.parts-filter-panel.hidden:not(.open),
#listing-filters-flyout #filter-panel.parts-filter-panel.open {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    transform: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: hidden !important;
    z-index: auto !important;
    will-change: auto !important;
}

#listing-filters-flyout .filter-panel-header {
    margin: 0 !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid #e3e8ea !important;
}

#listing-filters-flyout .filter-panel-header h2 {
    font-family: var(--listing-font-display);
    font-size: 18px !important;
    font-weight: 900 !important;
    color: var(--lt-teal) !important;
}

#listing-filters-flyout .filter-panel-actions {
    gap: 10px;
}

#listing-filters-flyout .reset-link {
    color: #0b8e81;
    font-size: 12px;
    font-weight: 700;
}

#listing-filters-flyout #filter-panel .filter-panel-main {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding: 10px 20px 14px !important;
}

#listing-filters-flyout #filter-panel .filter-panel-content {
    padding: 0 !important;
}

/* Hide the chrome-level banners/overlays the old layout used; they are not rendered on APS but part-listing.js
   may still toggle classes by id. */
.listing-toolbar-page .parts-sidebar-overlay,
.listing-toolbar-page .parts-filter-panel-overlay,
.listing-toolbar-page .parts-filter-rail {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Phones and tablets (<= 1024px)                                      */
/* ------------------------------------------------------------------ */
@media (max-width: 1024px) {
    .listing-page-redesign.listing-toolbar-page {
        /* 6 + 40 + 4: keep in sync with the button height below */
        --listing-mobile-toolbar-h: 50px;
    }

    /* The title row scrolls away; the two buttons are the sticky part */
    .listing-toolbar-page .listing-toolbar {
        position: static;
        top: auto;
        z-index: 1;
    }

    .listing-toolbar-page .listing-toolbar__row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        min-height: 0;
    }

    .listing-toolbar-page .listing-toolbar__title,
    .listing-toolbar-page h1.listing-toolbar__title.part-title {
        flex: 1 1 100%;
        font-size: 15px !important;
        white-space: normal;
        line-height: 1.25 !important;
    }

    .listing-toolbar-page .listing-fitment-chips,
    .listing-toolbar-page #listing-filters-btn {
        display: none !important;
    }

    .listing-toolbar-page .listing-toolbar__right {
        margin-left: 0;
        flex: 1 1 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .listing-toolbar-page .listing-toolbar .sort-by-container {
        min-width: 0;
        flex: 1 1 auto;
    }

    .listing-toolbar-page .listing-toolbar .listing-total {
        flex: 1 1 100%;
    }

    .listing-toolbar-page .listing-edit-search .listing-topbar {
        padding: 12px;
    }

    /* Mobile toolbar buttons: 40px pills, Fitment in dark teal (mockup) */
    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar {
        padding: 6px 10px 4px !important;
        border-bottom: 1px solid var(--lt-line) !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__btn {
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        border-radius: 999px !important;
        font-size: 13px !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__btn--fitments {
        background: var(--lt-teal) !important;
        color: #fff !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__btn--fitments:hover {
        background: var(--lt-teal-ink) !important;
        color: #fff !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__btn--filters {
        border-color: var(--lt-chip-line) !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__title {
        font-size: 13px !important;
        font-weight: 900 !important;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__badge {
        font-weight: 800;
        font-size: 13px;
        color: #ffd166;
        white-space: nowrap;
    }

    .listing-page-redesign.listing-toolbar-page .listing-mobile-toolbar__badge--count {
        color: var(--lt-teal);
    }

    .listing-toolbar-page .listing-subline {
        padding: 6px 10px;
    }

    /* Flyouts become bottom sheets */
    .listing-flyout__panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .listing-flyout__grab {
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: #cbd3d8;
        margin: 10px auto 0;
        flex: none;
    }

    .listing-flyout__header {
        padding: 10px 16px 12px;
    }

    .listing-flyout__body {
        padding: 12px 16px;
    }

    .listing-flyout__footer {
        padding: 10px 16px 12px;
    }

    .listing-flyout__btn {
        height: 44px;
        border-radius: 10px;
        font-size: 14px;
    }

    #listing-filters-flyout .filter-panel-header {
        padding: 10px 16px 12px !important;
    }

    #listing-filters-flyout #filter-panel .filter-panel-main {
        padding: 10px 16px 14px !important;
    }
}

@media (max-width: 480px) {
    .listing-toolbar-page .listing-tag__text {
        max-width: 200px;
    }

    .listing-toolbar-page .listing-toolbar .listing-view-toggle {
        height: 28px;
        padding: 0 9px;
        font-size: 10px;
    }
}

/* With the sidebar gone the text column is wide enough from 1440px for the five pills on one line
   (listing-condensed.css only does that from 1680px, sized for the old 205px sidebar). */
@media (min-width: 1440px) {
    .listing-toolbar-page .part-card .part-card-details .part-card-tags { grid-template-columns: 76px 110px 120px 130px minmax(146px, max-content); }
}
/* Full-width rows: a touch less vertical padding and gap than the sidebar layout needed. */
@media (min-width: 1025px) {
    .listing-toolbar-page.listing-condensed .part-card,
    .listing-toolbar-page.listing-condensed .part-card.has-redesign-layout { padding-top: 5px !important; padding-bottom: 5px !important; margin-bottom: 6px !important; }
}

/* Between 1025 and 1439px the row does not fit on one line (title + chips + total + sort + view switch),
   so it wraps once, deliberately: title, Edit search and the right-hand group first, chips and Filters second. */
.listing-toolbar-page .listing-toolbar__break { display: none; }
@media (min-width: 1025px) and (max-width: 1439px) {
    .listing-toolbar-page .listing-toolbar__row { flex-wrap: wrap !important; row-gap: 8px; }
    .listing-toolbar-page .listing-toolbar__title { order: 1; flex: 1 1 auto; }
    .listing-toolbar-page #listing-edit-search-btn { order: 2; }
    .listing-toolbar-page .listing-toolbar__right { order: 3; margin-left: auto; }
    .listing-toolbar-page .listing-toolbar__break { order: 4; display: block; flex-basis: 100%; height: 0; }
    .listing-toolbar-page .listing-fitment-chips { order: 5; }
    .listing-toolbar-page .listing-chip--filters { order: 6; }
    .listing-toolbar-page .listing-chip--rec { order: 7; }
}

/* "Other yards" section: the sidebar layout gave it mt-10 / pt-8 (72px). With the toolbar that read as a
   blank band under the chips, worst when a buyer has no preferred-yard groups above it. */
.listing-toolbar-page #other-yards-section { margin-top: 12px !important; padding-top: 10px !important; }
.listing-toolbar-page #parts-list > #other-yards-section:first-child,
.listing-toolbar-page #parts-list > .parts-list-fitment-banner + #other-yards-section { margin-top: 0 !important; padding-top: 0 !important; }

/* Phones: the toolbar is two short rows, title then one scrollable strip (Edit search, Recommended, total,
   sort, view switch), so the sticky Fitment / Filters buttons and the first row come up without scrolling. */
@media (max-width: 1024px) {
    .listing-toolbar-page .listing-toolbar__row { padding: 6px 10px !important; gap: 6px 8px !important; }
    .listing-toolbar-page .listing-toolbar__title,
    .listing-toolbar-page h1.listing-toolbar__title.part-title { font-size: 14px !important; line-height: 1.2 !important; }
    .listing-toolbar-page #listing-edit-search-btn,
    .listing-toolbar-page .listing-chip--rec { height: 28px; padding: 0 9px; font-size: 10px; flex: 0 0 auto; }
    .listing-toolbar-page .listing-toolbar__right {
        flex: 1 1 auto; margin-left: auto; min-width: 0;
        flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
    }
    .listing-toolbar-page .listing-toolbar__right::-webkit-scrollbar { display: none; }
    .listing-toolbar-page .listing-toolbar .listing-total { flex: 0 0 auto !important; font-size: 10px; white-space: nowrap; margin: 0; }
    .listing-toolbar-page .listing-toolbar .sort-by-container { flex: 0 0 auto !important; height: 28px; }
    .listing-toolbar-page .listing-toolbar .sort-by-container .sort-select { height: 28px; font-size: 11px; max-width: 150px; }
    .listing-toolbar-page .listing-toolbar .listing-view-toggle { height: 28px; padding: 0 9px; font-size: 10px; flex: 0 0 auto; white-space: nowrap; }
}

/* A part type with no fitment choices: tag on its header plus a note under it. */
#listing-fitment-flyout .listing-fitment-tag--none { background: #eef2f3; color: #5f6e78; }
#listing-fitment-flyout .listing-fitment-note { margin: 2px 0 14px; padding: 10px 12px; border: 1px solid #dfe5e7; border-radius: 8px; background: #f7f9fa; font-size: 13px; line-height: 1.4; color: #44505c; }

/* ================================================================== */
/* WEBDEV-2644 - Multi-part search: Fitment pill, Set fitments pill,   */
/* part tabs, cart / quote progress, fitment stepper                    */
/* ================================================================== */

/* Fitment pill: "Fitment  N of M set". Amber (.listing-chip--need) while a part type has no selection, filled
   teal (.listing-chip--sel) once every one is set. */
.listing-toolbar-page .listing-chip--fitment-pill {
    gap: 8px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.listing-toolbar-page .listing-chip__state {
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(26, 36, 51, 0.08);
    color: inherit;
}

.listing-toolbar-page .listing-chip--fitment-pill.listing-chip--need .listing-chip__state {
    background: rgba(107, 74, 0, 0.14);
}

.listing-toolbar-page .listing-chip--fitment-pill.listing-chip--sel .listing-chip__state {
    background: rgba(255, 255, 255, 0.2);
    color: var(--lt-mint);
}

.listing-toolbar-page .listing-chip--set-fitments {
    font-weight: 900;
}

.listing-toolbar-page .listing-chip--set-fitments:hover {
    background: #ffe9a8;
}

/* Part tabs: second row of the sticky toolbar, scrolls horizontally when ten part types do not fit */
.listing-toolbar-page .listing-part-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 0 24px;
    border-top: 1px solid var(--lt-line);
    background: #fff;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.listing-toolbar-page .listing-part-tabs::-webkit-scrollbar {
    display: none;
}

.listing-toolbar-page .listing-part-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px 7px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    font-family: var(--listing-font-display);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--lt-muted);
    white-space: nowrap;
    cursor: pointer;
}

.listing-toolbar-page .listing-part-tab:hover {
    color: var(--lt-teal-ink);
}

.listing-toolbar-page .listing-part-tab:focus-visible {
    outline: 2px solid var(--lt-mint);
    outline-offset: -2px;
    border-radius: 4px;
}

.listing-toolbar-page .listing-part-tab.is-active {
    color: var(--lt-teal);
    border-bottom-color: var(--lt-mint);
}

.listing-toolbar-page .listing-part-tab__count {
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    min-width: 16px;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2f3;
    color: #44505c;
    text-align: center;
}

.listing-toolbar-page .listing-part-tab.is-active .listing-part-tab__count {
    background: var(--lt-teal);
    color: #fff;
}

/* Fitment state: check when set, amber dot when a choice is still needed, nothing for a type without options */
.listing-toolbar-page .listing-part-tab__fit--ok {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #d8f7ef;
    color: #0d887d;
}

.listing-toolbar-page .listing-part-tab__fit--ok svg {
    width: 9px;
    height: 9px;
}

.listing-toolbar-page .listing-part-tab__fit--todo {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lt-amber-dot);
}

.listing-toolbar-page .listing-part-tab--todo {
    color: var(--lt-amber-ink);
}

.listing-toolbar-page .listing-part-tab--todo.is-active {
    color: var(--lt-amber-ink);
    border-bottom-color: var(--lt-amber-line);
}

/* Cart mark: items of this part type in the cart / quote */
.listing-toolbar-page .listing-part-tab__cart {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0 6px;
    line-height: 16px;
    border-radius: 999px;
    background: #e6f4f1;
    color: #0b5e59;
    font-size: 10px;
    font-weight: 800;
}

.listing-toolbar-page .listing-part-tab__cart svg {
    width: 11px;
    height: 11px;
}

/* Cart / quote progress pill ("2 of 4 parts added") and its popover */
.listing-toolbar-page .listing-cart-progress {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.listing-toolbar-page .listing-chip--progress {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: var(--lt-muted);
}

.listing-toolbar-page .listing-cart-progress.is-started .listing-chip--progress {
    color: var(--lt-teal-ink);
    border-color: var(--lt-teal-ink);
}

.listing-toolbar-page .listing-cart-progress.is-complete .listing-chip--progress {
    background: var(--lt-teal);
    border-color: var(--lt-teal);
    color: #fff;
}

.listing-toolbar-page .listing-chip--progress[aria-expanded="true"] {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lt-mint);
}

.listing-toolbar-page .listing-popover {
    position: fixed;
    z-index: 125;
    width: 260px;
    max-width: calc(100vw - 16px);
    padding: 10px 12px 12px;
    border: 1px solid var(--lt-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    font-family: var(--listing-font-body);
    font-size: 12px;
    color: var(--lt-text);
}

.listing-toolbar-page .listing-popover__list {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
}

.listing-toolbar-page .listing-popover__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eef2f3;
}

.listing-toolbar-page .listing-popover__item:last-child {
    border-bottom: 0;
}

.listing-toolbar-page .listing-popover__name {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-toolbar-page .listing-popover__state {
    flex: none;
    font-size: 10px;
    font-weight: 800;
    line-height: 16px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef2f3;
    color: #5f6e78;
}

.listing-toolbar-page .listing-popover__item.is-added .listing-popover__state {
    background: #d8f7ef;
    color: #0d887d;
}

.listing-toolbar-page .listing-popover__link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border-radius: 8px;
    background: var(--lt-mint);
    color: #07585a !important;
    font-family: var(--listing-font-display);
    font-weight: 900;
    font-size: 12px;
    text-decoration: none !important;
}

.listing-toolbar-page .listing-popover__link:hover {
    background: #3fd4ae;
}

/* Between 1025 and 1439px the pills follow the chips onto the second line */
@media (min-width: 1025px) and (max-width: 1439px) {
    .listing-toolbar-page #listing-fitment-pill,
    .listing-toolbar-page #listing-set-fitments-btn { order: 5; }
}

/* Fitment stepper: centred card on desktop, full-screen sheet on phones */
.listing-stepper {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 130;
    font-family: var(--listing-font-body);
    color: var(--lt-text);
}

.listing-stepper.is-open {
    display: block;
}

.listing-stepper__scrim {
    position: absolute;
    inset: 0;
    background: rgba(6, 40, 42, 0.42);
}

.listing-stepper__panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 32px));
    max-height: min(720px, calc(100vh - 32px));
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    overflow: hidden;
}

.listing-stepper__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 12px;
    flex: none;
}

.listing-stepper__kicker {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #7a858e;
}

.listing-stepper__heading h2 {
    margin: 0;
    font-family: var(--listing-font-display);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--lt-teal);
}

.listing-stepper__heading small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--lt-muted);
}

.listing-stepper__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--lt-muted);
    font-size: 16px;
    cursor: pointer;
    flex: none;
}

.listing-stepper__close:hover {
    background: #f1f5f6;
    color: var(--lt-text);
}

.listing-stepper__dots {
    display: flex;
    gap: 6px;
    padding: 0 24px 12px;
    flex: none;
}

.listing-stepper__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d5dde1;
}

.listing-stepper__dot.is-done {
    background: var(--lt-mint);
}

.listing-stepper__dot.is-current {
    background: var(--lt-teal);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--lt-teal);
}

.listing-stepper__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 24px 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.listing-stepper__option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 8px;
    padding: 12px 14px;
    border: 1px solid #dfe4e8;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

.listing-stepper__option:hover {
    border-color: #0b8e81;
    background: #f7fcfb;
}

.listing-stepper__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.listing-stepper__radio {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #b7c2c8;
    background: #fff;
    box-sizing: border-box;
}

.listing-stepper__option.is-checked {
    border-color: #0b8e81;
    background: #edf9f6;
    color: #07585a;
    font-weight: 700;
}

.listing-stepper__option.is-checked .listing-stepper__radio {
    border-color: #0b8e81;
    background: radial-gradient(#0b8e81 45%, #fff 50%);
}

.listing-stepper__option input:focus-visible + .listing-stepper__radio {
    outline: 2px solid var(--lt-mint);
    outline-offset: 2px;
}

.listing-stepper__option.is-inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

.listing-stepper__option-text {
    min-width: 0;
}

.listing-stepper__footer {
    display: flex;
    gap: 10px;
    padding: 12px 24px 16px;
    border-top: 1px solid #e3e8ea;
    flex: none;
}

.listing-stepper__btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--lt-chip-line);
    background: #fff;
    color: #44505c;
    font-family: var(--listing-font-display);
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
}

.listing-stepper__btn:hover {
    border-color: var(--lt-teal-ink);
}

.listing-stepper__btn--skip {
    margin-left: auto;
}

.listing-stepper__btn--primary {
    min-width: 120px;
    background: var(--lt-mint);
    border-color: var(--lt-mint);
    color: #07585a;
}

.listing-stepper__btn--primary:hover {
    background: #3fd4ae;
}

.listing-stepper__btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 1024px) {
    /* The phone Fitment button carries the "N of M" badge and opens the sheet; the pill is desktop-only */
    .listing-toolbar-page #listing-fitment-pill {
        display: none !important;
    }

    .listing-toolbar-page #listing-set-fitments-btn,
    .listing-toolbar-page .listing-chip--progress {
        height: 28px;
        padding: 0 9px;
        font-size: 10px;
        flex: 0 0 auto;
    }

    .listing-toolbar-page .listing-part-tabs {
        padding: 0 10px;
    }

    .listing-toolbar-page .listing-part-tab {
        padding: 8px 10px 6px;
        font-size: 12px;
    }

    /* Stepper: full-screen sheet */
    .listing-stepper__panel {
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: auto;
        max-height: none;
        border-radius: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .listing-stepper__header {
        padding: 16px 16px 10px;
    }

    .listing-stepper__dots {
        padding: 0 16px 10px;
    }

    .listing-stepper__body {
        padding: 2px 16px 12px;
    }

    .listing-stepper__footer {
        padding: 10px 16px 12px;
        flex-wrap: wrap;
    }

    .listing-stepper__btn {
        height: 44px;
        border-radius: 10px;
        font-size: 14px;
    }

    .listing-stepper__btn--primary {
        flex: 1 1 100%;
        order: 3;
    }
}

/* 1025 to 1439px, revisited: the title (and Edit search) take the first line on their own; every control sits on
   the second line, fitment / filters / recommended on the left and progress / total / sort / view switch on the
   right. Before this the right-hand group sat alone on its own line, right-aligned, which read as a misplaced row. */
@media (min-width: 1025px) and (max-width: 1439px) {
    .listing-toolbar-page .listing-toolbar__title { order: 1; flex: 1 1 auto; }
    .listing-toolbar-page #listing-edit-search-btn { order: 2; }
    .listing-toolbar-page .listing-toolbar__break { order: 3; display: block; flex-basis: 100%; height: 0; }
    .listing-toolbar-page .listing-fitment-chips,
    .listing-toolbar-page #listing-fitment-pill,
    .listing-toolbar-page #listing-set-fitments-btn { order: 4; }
    .listing-toolbar-page .listing-chip--filters { order: 5; }
    .listing-toolbar-page .listing-chip--rec { order: 6; }
    .listing-toolbar-page .listing-toolbar__right { order: 7; margin-left: auto; flex-wrap: nowrap; min-width: 0; gap: 8px; }
    /* The control line is tight at 1200 to 1300px on a multi-part search ("Edit Fitment" pill, Set fitments,
       Filters, Recommended, progress, total, sort, view switch): a narrower sort select and tighter gaps keep
       the right-hand group beside the chips instead of wrapping onto a lone third line. */
    .listing-toolbar-page .listing-toolbar .sort-by-container { min-width: 0; }
    .listing-toolbar-page .listing-toolbar .sort-by-container .sort-select { max-width: 170px; }
    .listing-toolbar-page .listing-chip--fitment-pill { gap: 6px; }
}

/* 1025 to 1199px (iPad landscape): the control line does not fit, so the right-hand group takes a full third
   line: progress and total on the left, sort and view switch on the right, instead of a lone right-aligned row. */
@media (min-width: 1025px) and (max-width: 1199px) {
    .listing-toolbar-page .listing-toolbar__right { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
    .listing-toolbar-page .listing-toolbar__right .sort-by-container { margin-left: auto; }
}
/* A multi-part search (the part tabs are shown) carries two more pills on the control line, so it needs the
   same full third line up to 1279px. Browsers without :has() keep the right-aligned wrap. */
@media (min-width: 1200px) and (max-width: 1279px) {
    .listing-toolbar-page:has(#listing-part-tabs:not([hidden])) .listing-toolbar__right { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
    .listing-toolbar-page:has(#listing-part-tabs:not([hidden])) .listing-toolbar__right .sort-by-container { margin-left: auto; }
}
