/* ── Search suggestion dropdown (portaled to body) ───────────────────────── */

.apf-sugg-drop {
    display: none;
    position: fixed;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    z-index: 99999;
    overflow: hidden;
    animation: apf-sugg-in .14s ease;
}
.apf-sugg-drop--open { display: block; }

@keyframes apf-sugg-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.apf-sugg-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.apf-sugg-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .1s;
    text-decoration: none;
    color: inherit;
}
.apf-sugg-item:hover { background: #fff4f4; }

.apf-sugg-img {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.apf-sugg-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.apf-sugg-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.apf-sugg-title {
    font-size: 13px;
    font-weight: 600;
    color: #1c1c1c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.apf-sugg-item:hover .apf-sugg-title { color: #c0392b; }

.apf-sugg-price {
    font-size: 12px;
    font-weight: 600;
    color: #c0392b;
}

.apf-sugg-sku {
    font-size: 11px;
    color: #aaa;
}

.apf-sugg-all {
    display: block;
    padding: 10px 14px;
    border-top: 1px solid #f2f2f2;
    font-size: 12px;
    font-weight: 600;
    color: #c0392b;
    text-decoration: none;
    transition: background .1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.apf-sugg-all:hover { background: #fff4f4; }

.apf-sugg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.apf-sugg-loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: apf-fn-spin .65s linear infinite;
}

.apf-sugg-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
}

/* ── AutoPartner Fitment — Vehicle Finder Bar ───────────────────────────── */

.apf-finder {
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 20px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.apf-finder__heading {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #1c1c1c;
    line-height: 1;
}

.apf-finder__form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Fields */
.apf-finder__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1 1 160px;
}

.apf-finder__field--search {
    flex: 2 1 220px;
}

.apf-finder__label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Text search input */
.apf-finder__input-wrap {
    position: relative;
}
.apf-finder__input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    pointer-events: none;
    display: block;
}
.apf-finder__input {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 14px 0 38px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font: 14px inherit;
    color: #1c1c1c;
    background: #fafafa;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.apf-finder__input:focus {
    border-color: #c0392b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.apf-finder__input::-webkit-search-cancel-button { display: none; }

/* Vertical divider between search and selects */
.apf-finder__divider {
    width: 1px;
    height: 44px;
    background: #e8e8e8;
    flex-shrink: 0;
    align-self: flex-end;
}

/* Select dropdowns */
.apf-finder__select-wrap {
    position: relative;
}
.apf-finder__select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font: 14px inherit;
    color: #1c1c1c;
    background: #fafafa;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.apf-finder__select:focus {
    border-color: #c0392b;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.apf-finder__select:disabled {
    color: #bbb;
    background: #f5f5f5;
    cursor: not-allowed;
}
.apf-finder__select-chevron {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #aaa;
    display: block;
}
.apf-sf-model-loader {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: apf-fn-spin 0.65s linear infinite;
}

/* Submit button */
.apf-finder__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;
    padding: 0 22px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font: 600 14px/1 inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
    transition: background 0.15s, box-shadow 0.15s;
}
.apf-finder__btn:hover {
    background: #a93226;
    box-shadow: 0 4px 14px rgba(192,57,43,0.3);
}
.apf-finder__btn svg { display: block; }

/* Responsive */
@media (max-width: 700px) {
    .apf-finder__form   { flex-direction: column; }
    .apf-finder__field  { flex: 1 1 100%; }
    .apf-finder__divider { display: none; }
    .apf-finder__btn    { width: 100%; justify-content: center; }
}

/* ── Collapsible category section ────────────────────────────────────────── */

.apf-finder__cats {
    margin-top: 16px;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}

.apf-finder__cats-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    list-style: none;
    user-select: none;
    width: fit-content;
    transition: color 0.15s;
}
.apf-finder__cats-toggle::-webkit-details-marker { display: none; }
.apf-finder__cats-toggle::marker { display: none; }

.apf-finder__cats-toggle:hover {
    color: #c0392b;
}

.apf-finder__cats-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
details.apf-finder__cats[open] .apf-finder__cats-chevron {
    transform: rotate(180deg);
}

.apf-finder__cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-top: 14px;
    animation: apf-cats-open 0.18s ease;
}

@keyframes apf-cats-open {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.apf-finder__cat-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 11px 10px;
    background: #fafafa;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font: 600 13px/1.3 inherit;
    color: #1c1c1c;
    text-decoration: none;
    transition: background 0.13s, border-color 0.13s, color 0.13s, transform 0.13s;
    word-break: break-word;
    hyphens: auto;
}
.apf-finder__cat-card:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 480px) {
    .apf-finder__cats-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ── Active filter notice — inline search row ────────────────────────────── */

.apf-fn__search-row {
    width: 100%;
    position: relative;
    margin-top: 10px;
}

.apf-fn__search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    pointer-events: none;
    display: block;
}

.apf-fn__search-input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    padding: 0 14px 0 34px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font: 13px inherit;
    color: #1c1c1c;
    background: #fff;
    outline: none;
    -webkit-appearance: none;
    transition: border-color .15s, box-shadow .15s;
}
.apf-fn__search-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.08);
}
.apf-fn__search-input::placeholder { color: #bbb; }

/* ── Active filter notice — category section ─────────────────────────────── */

.apf-fn__cats {
    width: 100%;
    border-top: 1px solid #f0e8e8;
    padding-top: 10px;
    margin-top: 4px;
}

.apf-fn__cats-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.15s;
}
.apf-fn__cats-toggle::-webkit-details-marker { display: none; }
.apf-fn__cats-toggle::marker { display: none; }
.apf-fn__cats-toggle:hover { color: #c0392b; }

.apf-fn__cats-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
details.apf-fn__cats[open] .apf-fn__cats-chevron {
    transform: rotate(180deg);
}

.apf-fn__cats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    animation: apf-cats-open 0.18s ease;
}

.apf-fn__cat-card {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    border-radius: 20px;
    font: 600 12px/1 inherit;
    color: #444;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
}
.apf-fn__cat-card:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* ── AutoPartner Fitment — Active Filter Notice ──────────────────────────── */

.apf-fn {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 12px 16px;
    margin-bottom: 24px;
    background: #fff8f8;
    border: 1.5px solid #f5c6c2;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1;
    position: relative;
    z-index: 100;
}

/* ── Label ───────────────────────────────────────────────────────────────── */

.apf-fn__label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    font-size: 13px;
}

/* ── Crumbs row ──────────────────────────────────────────────────────────── */

.apf-fn__crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.apf-fn__sep {
    color: #ccc;
    font-size: 16px;
    user-select: none;
}

/* ── Chip wrapper ────────────────────────────────────────────────────────── */

.apf-fn__chip {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    border-radius: 20px;
    box-shadow: 0 1px 4px rgba(192, 57, 43, 0.2);
    transition: box-shadow 0.15s;
}
.apf-fn__chip:hover,
.apf-fn__chip--open {
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.32);
}

/* Make chip = darker red; model chip = deep red */
.apf-fn__chip--make .apf-fn__chip-btn,
.apf-fn__chip--make .apf-fn__chip-x { background: #c0392b; }
.apf-fn__chip--model .apf-fn__chip-btn,
.apf-fn__chip--model .apf-fn__chip-x { background: #922b21; }

/* ── Split-button left side: toggle ─────────────────────────────────────── */

.apf-fn__chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px 6px 13px;
    border: none;
    border-radius: 20px 0 0 20px;
    color: #fff;
    font: 600 13px/1 inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.13s;
}
.apf-fn__chip-btn:hover,
.apf-fn__chip--open .apf-fn__chip-btn {
    filter: brightness(0.88);
}

.apf-fn-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.apf-fn__chip--open .apf-fn-chevron {
    transform: rotate(180deg);
}

/* ── Split-button right side: remove × ──────────────────────────────────── */

.apf-fn__chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-left: 1px solid rgba(255,255,255,0.22);
    border-radius: 0 20px 20px 0;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.13s, filter 0.13s;
}
.apf-fn__chip-x:hover {
    color: #fff;
    filter: brightness(0.84);
}
.apf-fn__chip-x svg { display: block; }

/* ── Dropdown ────────────────────────────────────────────────────────────── */

.apf-fn__drop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
    overflow: hidden;

    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.apf-fn__drop--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── Search inside dropdown ──────────────────────────────────────────────── */

.apf-fn__drop-search-wrap {
    padding: 10px 10px 8px;
    border-bottom: 1px solid #f2f2f2;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.apf-fn__drop-search {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font: 13px inherit;
    outline: none;
    -webkit-appearance: none;
    transition: border-color 0.13s;
}
.apf-fn__drop-search:focus { border-color: #c0392b; }
.apf-fn__drop-search::-webkit-search-cancel-button { display: none; }

/* ── List ────────────────────────────────────────────────────────────────── */

.apf-fn__drop-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    max-height: 250px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.apf-fn__drop-item {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    font-size: 13px;
    color: #222;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    position: relative;
}
.apf-fn__drop-item::before {
    content: '';
    display: inline-block;
    width: 14px;
    flex-shrink: 0;
    margin-right: 8px;
}
.apf-fn__drop-item:hover {
    background: #fff4f4;
    color: #c0392b;
}
.apf-fn__drop-item--active {
    color: #c0392b;
    font-weight: 700;
    background: #fff0f0;
}
.apf-fn__drop-item--active::before {
    content: '✓';
    color: #c0392b;
    font-size: 12px;
}

/* ── Loading / empty states ──────────────────────────────────────────────── */

.apf-fn__drop-loading,
.apf-fn__drop-empty {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
}
.apf-fn__drop-loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: apf-fn-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes apf-fn-spin { to { transform: rotate(360deg); } }

/* ── Clear all ───────────────────────────────────────────────────────────── */

.apf-fn__clear-all {
    margin-left: auto;
    font-size: 12px;
    color: #c0392b;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    transition: color 0.13s;
}
.apf-fn__clear-all:hover { color: #7b241c; }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .apf-fn {
        gap: 8px;
        padding: 10px 12px;
    }
    .apf-fn__clear-all { margin-left: 0; }
    .apf-fn__drop { min-width: 200px; }
}
