/* PartsCircle vehicle filter widget — replaces Elessi 3-level selector */

.pch-fw {
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    position: relative;
}

/* ── Tabs ───────────────────────────────────────────────────────── */
.pch-fw-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
}

.pch-fw-tab {
    flex: 1;
    background: rgba(221,51,51,.65);
    border: none;
    color: #fff;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px 3px 0 0;
    transition: background .15s;
    white-space: nowrap;
}

.pch-fw-tab:first-child { border-top-left-radius:  6px; }
.pch-fw-tab:last-child  { border-top-right-radius: 6px; }

.pch-fw-tab:hover { background: rgba(221,51,51,.85); }

.pch-fw-tab-on {
    background: #dd3333;
    font-weight: 700;
}

/* ── Panes ──────────────────────────────────────────────────────── */
.pch-fw-pane {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    background: rgba(255,255,255,.12);
    border-radius: 0 0 3px 3px;
}

/* ── Selects & inputs ───────────────────────────────────────────── */
.pch-fw-sel,
.pch-fw-input {
    flex: 1 1 130px;
    min-width: 100px;
    height: 36px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 3px;
    font-size: 13px;
    color: #333;
    appearance: auto;
    box-sizing: border-box;
}

.pch-fw-sel:disabled { opacity: .5; cursor: not-allowed; }

.pch-fw-vin-input {
    font-family: monospace;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ── Search button ──────────────────────────────────────────────── */
.pch-fw-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 18px;
    background: #dd3333;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.pch-fw-btn:hover:not(:disabled) { background: #bb2222; }
.pch-fw-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Select2 overrides inside widget ────────────────────────────── */
.pch-fw .select2-container {
    flex: 1 1 130px;
    min-width: 100px;
    height: 36px;
    max-height: 36px;
    box-sizing: border-box;
}
.pch-fw .select2-container .select2-selection--single {
    height: 36px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 3px;
    background: #fff;
    display: flex;
    align-items: center;
}
.pch-fw .select2-selection--single .select2-selection__rendered {
    color: #333;
    font-size: 13px;
    padding-left: 10px;
    padding-right: 30px;
    line-height: 34px;
}
.pch-fw .select2-selection--single .select2-selection__arrow {
    height: 34px;
    top: 1px;
}
.pch-fw .select2-container--disabled .select2-selection--single {
    opacity: .5;
    cursor: not-allowed;
    background: #fff;
}
/* Dropdown appended to body — ensure it clears the parallax z-index */
.select2-container--open .select2-dropdown { z-index: 99999; }

/* ── Results panel ──────────────────────────────────────────────── */
.pch-fw-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
    max-height: 480px;
    overflow-y: auto;
}

.pch-fw-results-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1;
}

.pch-fw-results-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.pch-fw-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}
.pch-fw-close:hover { color: #333; }

.pch-fw-results-body { padding: 12px 14px; }

/* ── Product grid ───────────────────────────────────────────────── */
.pch-fw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.pch-fw-card {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s;
}
.pch-fw-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.1); }

.pch-fw-img-link {
    display: block;
    background: #f9f9f9;
    text-align: center;
    padding: 8px;
}
.pch-fw-img-link img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    width: auto;
    height: auto;
}

.pch-fw-card-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.pch-fw-title {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
    font-size: 12px;
}
.pch-fw-title:hover { color: #c00; }

.pch-fw-price { font-weight: 700; color: #333; font-size: 13px; }

.pch-fw-instock  { color: #2a7a2a; font-size: 11px; font-weight: 600; }
.pch-fw-outstock { color: #999;    font-size: 11px; }

.pch-fw-atc {
    display: block;
    margin-top: auto;
    padding: 5px 0;
    background: #c00;
    color: #fff !important;
    text-align: center;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s;
}
.pch-fw-atc:hover { background: #a00; }

/* ── Interchange number results ─────────────────────────────────── */
.pch-fw-detail {
    margin-bottom: 10px;
    font-size: 12px;
}
.pch-fw-detail summary {
    cursor: pointer;
    font-weight: 600;
    color: #2271b1;
    padding: 4px 0;
}
.pch-fw-vlist {
    margin: 6px 0 0 16px;
    padding: 0;
    line-height: 1.8;
    color: #555;
}

.pch-fw-note {
    font-size: 12px;
    color: #555;
    margin: 4px 0;
    font-style: italic;
}

/* ── Spinner ────────────────────────────────────────────────────── */
.pch-fw-spinner {
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid #eee;
    border-top-color: #c00;
    border-radius: 50%;
    animation: pch-fw-spin .6s linear infinite;
    margin: 16px auto;
}
@keyframes pch-fw-spin { to { transform: rotate(360deg); } }

/* ── Messages ───────────────────────────────────────────────────── */
.pch-fw-empty { color: #888; font-style: italic; font-size: 13px; margin: 0; }
.pch-fw-error { color: #c00; font-size: 13px; margin: 0; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .pch-fw-pane   { flex-direction: column; }
    .pch-fw-sel,
    .pch-fw-input,
    .pch-fw-btn    { width: 100%; flex: none; }
    .pch-fw-results { position: fixed; top: auto; bottom: 0; left: 0;
                      right: 0; max-height: 60vh; border-radius: 8px 8px 0 0; }
    .pch-fw-grid   { grid-template-columns: repeat(2, 1fr); }
}
