:root {
    --ms-navy: #073c5e;
    --ms-orange: #f76300;
    --ms-border: rgba(7, 60, 94, .2);
}

.motareasearch-widget { position: relative; width: 100%; z-index: 1100; }
.motareasearch-shell { position: relative; }
.motareasearch-overlay-header { display: none; }
.motareasearch-input-wrap {
    display: flex; align-items: center; min-height: 46px; overflow: hidden;
    border: 1px solid var(--ms-border); border-radius: 6px; background: #fff;
}
.motareasearch-input-wrap:focus-within { border-color: var(--ms-orange); box-shadow: 0 0 0 3px rgba(247, 99, 0, .12); }
.motareasearch-input-icon { margin-left: 13px; color: var(--ms-navy); font-size: 21px; }
.motareasearch-input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #263746; font-size: 15px; }
.motareasearch-input::-webkit-search-cancel-button { display: none; }
.motareasearch-icon-button, .motareasearch-submit, .motareasearch-mobile-trigger {
    display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer;
}
.motareasearch-icon-button { width: 44px; min-width: 44px; height: 44px; background: transparent; color: var(--ms-navy); }
.motareasearch-submit, #header .motareasearch-submit { visibility: visible; align-self: stretch; gap: 5px; padding: 0 14px; background: #073c5e !important; color: #fff !important; opacity: 1; font-weight: 700; }
.motareasearch-submit .material-icons, #header .motareasearch-submit .material-icons { display: inline-block; visibility: visible; color: #fff !important; opacity: 1 !important; font-size: 18px; }
.motareasearch-scope-chip.active, #header .motareasearch-scope-chip.active { border-color: #073c5e !important; background: #073c5e !important; color: #fff !important; }
.motareasearch-popover, .motareasearch-context-row, .motareasearch-scopes, .motareasearch-start, .motareasearch-dropdown, .motareasearch-scanner { display: none; }
.motareasearch-mobile-trigger {
    width: 100%; min-height: 44px; gap: 9px; padding: 9px 12px; border: 1px solid var(--ms-border);
    border-radius: 6px; background: #fff; color: var(--ms-navy); font-size: 14px; font-weight: 600;
}

.motareasearch-scope-bar { margin-bottom: 14px; border: 1px solid var(--ms-border); border-right: 0; border-left: 0; background: #f7fafc; }
.motareasearch-scope-bar-inner { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; }
.motareasearch-scope-summary { display: flex; flex-direction: column; min-width: 190px; }
.motareasearch-scope-kicker { color: #647786; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.motareasearch-scope-summary strong { display: flex; align-items: center; min-width: 0; gap: 5px; overflow: hidden; color: var(--ms-navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.motareasearch-scope-summary .material-icons { font-size: 17px; }
.motareasearch-scope-pills { display: flex; flex: 1; gap: 5px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.motareasearch-scope-pills::-webkit-scrollbar { display: none; }
.motareasearch-scope-pill { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 11px; border: 1px solid var(--ms-border); border-radius: 999px; background: #fff; color: var(--ms-navy); font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.motareasearch-scope-pill.active { border-color: var(--ms-navy); background: var(--ms-navy); color: #fff !important; }
.motareasearch-filter-button { display: none; align-items: center; gap: 6px; min-height: 42px; padding: 7px 11px; border: 1px solid var(--ms-border); border-radius: 6px; background: #fff; color: var(--ms-navy); font-size: 12px; font-weight: 800; cursor: pointer; }
.motareasearch-filter-button .material-icons { font-size: 19px; }
.motareasearch-page-recoveries { margin: 10px 0 14px; padding: 12px; border: 1px solid #d2dde3; border-radius: 8px; background: #f7fafc; }
.motareasearch-page-recoveries h2 { margin: 0 0 9px; color: #0b4261; font-size: 15px; }
.motareasearch-page-recovery-list { display: flex; flex-wrap: wrap; gap: 8px; }
.motareasearch-page-recovery-list > a, .motareasearch-page-recovery-notice { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #c7d6de; border-radius: 7px; background: #fff; color: #0b4261; font-size: 12px; font-weight: 750; }
.motareasearch-page-recovery-list > a:hover { border-color: #ef7d00; color: #0b4261; }
.motareasearch-page-recovery-list .material-icons { color: #ef7d00; font-size: 19px; }
.motareasearch-page-recovery-notice { flex-basis: 100%; background: #fff8ed; }
.motareasearch-filter-count { min-width: 20px; padding: 2px 5px; border-radius: 999px; background: var(--ms-orange); color: #fff; font-size: 10px; text-align: center; }

@media (min-width: 992px) {
    #header .motareasearch-mobile-trigger { display: none; }
    #header #_desktop_search .motareasearch-widget--mobile:not(.motareasearch-widget--modal) { display: block; }
}

@media (max-width: 991.98px) {
    .motareasearch-overlay-open { overflow: hidden; }
    .motareasearch-widget--mobile:not(.motareasearch-widget--modal) { display: none; }
    .motareasearch-overlay-open .motareasearch-widget--modal {
        position: fixed; inset: 0; z-index: 10050; display: block; padding: 0; background: #f4f7f9;
    }
    .motareasearch-widget--modal .motareasearch-shell { display: flex; flex-direction: column; height: 100%; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
    .motareasearch-widget--modal .motareasearch-overlay-header { display: flex; align-items: center; justify-content: space-between; min-height: 50px; margin-bottom: 10px; }
    .motareasearch-widget--modal .motareasearch-input-wrap { min-height: 52px; }
    .motareasearch-widget--modal .motareasearch-input { height: 50px; font-size: 16px; }
    .motareasearch-widget--modal .motareasearch-popover { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 8px; overflow: hidden; border: 1px solid var(--ms-border); border-radius: 8px; background: #fff; }
    .motareasearch-widget--modal .motareasearch-search-context, .motareasearch-widget--modal .motareasearch-context-row, .motareasearch-widget--modal .motareasearch-scopes { display: flex; }
    .motareasearch-widget--modal .motareasearch-search-context { flex-wrap: wrap; gap: 6px; padding: 8px 10px 7px; border-bottom: 1px solid var(--ms-border); }
    .motareasearch-widget--modal .motareasearch-context-row, .motareasearch-widget--modal .motareasearch-scopes { flex: 1 1 100%; min-width: 0; overflow-x: auto; }
    .motareasearch-widget--modal .motareasearch-vehicle-badge { min-height: 30px; }
    .motareasearch-widget--modal .motareasearch-scope-chip { min-height: 36px; padding: 5px 11px; font-size: 11px; }
    .motareasearch-widget--modal .motareasearch-start, .motareasearch-widget--modal .motareasearch-dropdown { flex: 1; min-height: 0; overflow-y: auto; }
    .motareasearch-widget:not(.motareasearch-widget--modal) .motareasearch-submit { min-width: 52px; width: 52px; padding: 0; }
    .motareasearch-widget:not(.motareasearch-widget--modal) .motareasearch-submit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .motareasearch-scope-bar { margin: 0 0 8px; border: 0; border-radius: 7px; }
    .motareasearch-scope-bar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; min-height: 0; padding: 6px 0; }
    .motareasearch-scope-summary { min-width: 0; }
    .motareasearch-scope-pills { grid-column: 1 / -1; grid-row: 2; gap: 5px; padding-bottom: 1px; }
    .motareasearch-scope-pill { justify-content: center; min-height: 34px; padding: 5px 9px; font-size: 10.5px; }
    .motareasearch-filter-button { display: inline-flex; grid-column: 2; grid-row: 1; min-height: 38px; padding: 5px 9px; }
}

/* Search context: one scope control, with readable wrapping and real touch targets. */
.motareasearch-scope-bar { border: 0; background: transparent; margin-bottom: 16px; }
.motareasearch-scope-bar > .container { width: 100%; max-width: none; padding: 0; }
.motareasearch-scope-bar-inner { flex-wrap: wrap; gap: 12px 20px; padding: 10px 0; }
.motareasearch-scope-summary { min-width: 0; flex: 1 1 160px; }
.motareasearch-scope-summary strong { white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
.motareasearch-scope-pills { flex: 0 1 auto; overflow: visible; flex-wrap: wrap; gap: 8px; }
.motareasearch-scope-pill { justify-content: center; min-height: 44px; padding: 10px 16px; font-size: 12px; line-height: 1.3; white-space: normal; text-align: center; }
.motareasearch-scope-pill.active { color: #fff !important; box-shadow: inset 0 -3px 0 #f76300; }
.motareasearch-filter-button[hidden] { display: none !important; }
@media (max-width: 991.98px) {
    .motareasearch-scope-bar-inner { gap: 10px; padding: 6px 0; }
    .motareasearch-scope-summary { min-width: 0; }
    .motareasearch-scope-pills { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); width: 100%; gap: 6px; }
    .motareasearch-scope-pill { min-height: 44px; padding: 8px; font-size: 12px; }
    .motareasearch-filter-button { min-height: 44px; }
    .motareasearch-widget--modal .motareasearch-scopes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 6px; overflow: visible; white-space: normal; }
    .motareasearch-widget--modal .motareasearch-scope-chip { min-width: 0; min-height: 44px; padding: 8px 6px; font-size: 12px; line-height: 1.3; white-space: normal; }
}

/* Query header: one readable title and a secondary vehicle/store context. */
.motareasearch-results-title { margin: 3px 0 5px; color: var(--ms-navy); font-size: 25px; line-height: 1.25; font-weight: 750; text-transform: none; overflow-wrap: anywhere; }
.motareasearch-scope-summary strong { color: #526b7a; font-size: 12px; font-weight: 500; }
@media (max-width: 767px) {
    .motareasearch-scope-bar { margin: 0 0 14px; padding: 12px; border: 1px solid #e0e8ed; border-radius: 12px; background: #f7fafc; }
    .motareasearch-scope-bar-inner { padding: 0; align-items: center; }
    .motareasearch-scope-kicker { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: none; }
    .motareasearch-results-title { font-size: 21px; }
    .motareasearch-filter-button { padding: 8px 10px; border-radius: 8px; }
}

/* Search listing is rendered before the deferred autocomplete stylesheet loads. */
.motareasearch-vehicle-help-desktop { display: none; }
.ma-search-category-tree { margin: 0; padding: 0; list-style: none; }
.ma-search-category-tree .ma-search-category-tree { padding-left: 10px; }
.ma-search-category-tree .ma-search-category-node { padding: 0; margin: 0; }
.ma-search-category-tree > .ma-search-category-node + .ma-search-category-node { border-top: 1px solid #edf2f7; }
.ma-search-category-row { position: relative; display: flex; align-items: center; min-width: 0; }
#search_filters .ma-search-category-link { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 46px; padding: 7px 8px; color: #173b59; background: #fff; font-size: 13px; font-weight: 600; line-height: 1.3; text-decoration: none; text-transform: none; letter-spacing: normal; white-space: normal; }
#search_filters .ma-search-category-row.has-children > .ma-search-category-link { padding-right: 34px; }
#search_filters .ma-search-category-parent { font-weight: 700; color: #073c5e; }
#search_filters .ma-search-category-link:hover { color: #f76300; background: #fff9f4; }
#search_filters .is-active > .ma-search-category-row > .ma-search-category-link { color: #c54500; background: #fff5ec; box-shadow: inset 3px 0 #f76300; font-weight: 700; }
.ma-search-category-icon { flex: 0 0 32px; width: 32px; height: 32px; object-fit: contain; color: #8b9fab; font-size: 23px; display: inline-flex; align-items: center; justify-content: center; }
.ma-search-category-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ma-search-category-count { flex: 0 0 auto; padding: 3px 5px; border-radius: 5px; background: #f1f5f8; color: #64788a; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.ma-search-category-selected { color: #c54500; font-size: 16px; }
.ma-search-category-toggle { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 40px; border: 0; background: transparent; color: #073c5e; cursor: pointer; padding: 0; }
.ma-search-category-toggle[aria-expanded="true"] { color: #f76300; }
.ma-search-category-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.ma-search-category-toggle:focus-visible, .ma-search-category-link:focus-visible { outline: 2px solid #c54500; outline-offset: -2px; }
.ma-search-category-children { border-left: 2px solid #f76300; margin-left: 7px; }
#search_filters .ma-search-category-children.collapse:not(.in):not(.show) { display: none !important; }
#search_filters .ma-search-category-children.collapse.in, #search_filters .ma-search-category-children.collapse.show { display: block !important; }
.ma-search-category-scroll { max-height: 440px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c3d1da transparent; }
/* Tablets get the results banner too; phones see theirs inside the search dialog. */
@media (min-width: 768px) {
    .motareasearch-vehicle-help-desktop { display: block; aspect-ratio: 9 / 1; margin-bottom: 16px; overflow: hidden; border-radius: 8px; background: #eff8fc; }
    .motareasearch-vehicle-help-desktop img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
}
@media (min-width: 992px) {
    .motareasearch-scope-bar--mobile { display: none; }
    body#search #left-column #search_filters { display: block !important; }
    body#search #left-column #search_filters .facet { float: none; width: 100%; padding: 12px 0; border-bottom: 1px solid #e0e8ed; }
    body#search #left-column #search_filters .tvsearch-filter-content-wrapper { display: block; }
    body#search #left-column #search_filters .ma-facet-trigger { display: none !important; }
    body#search #left-column #search_filters .ma-facet-popup { position: static; display: block; width: 100%; max-width: none; padding: 0; box-shadow: none; border: 0; }
    body#search #left-column #search_filters .ma-facet-panel { display: block !important; max-height: 260px; overflow-y: auto; }
    body#search #left-column #search_filters .facet-label a { white-space: normal; }
    /* The brand carousel replaces this filter; it stays in the DOM because the carousel syncs from it. */
    body#search #left-column #search_filters .facet[data-facet-type="manufacturer"] { display: none !important; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    body#search.ma-product-listing-page #left-column.ma-search-sidebar { display: block !important; flex: 0 0 260px !important; width: 260px !important; max-width: 260px !important; }
    body#search.ma-product-listing-page #content-wrapper { flex: 1 1 0 !important; width: calc(100% - 260px) !important; max-width: calc(100% - 260px) !important; }
}
