/* Car Parts Search Simple — Stylesheet v1.0.0 */

.cpss-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    position: relative;
}

/* ── Search row ── */
.cpss-search-row {
    display: flex;
    gap: 8px;
}
.cpss-input-wrap {
    flex: 1;
    position: relative;
}
.cpss-input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    display: flex;
    pointer-events: none;
}
.cpss-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1a1a1a;
    transition: border-color .15s;
    box-sizing: border-box;
}
.cpss-input:focus {
    outline: none;
    border-color: #e8b400;
    box-shadow: 0 0 0 3px rgba(232,180,0,.18);
}
.cpss-input::-webkit-search-cancel-button { display: none; }

.cpss-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #1a1a2e;
    color: #e8b400;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s;
}
.cpss-btn:hover  { background: #23234a; }
.cpss-btn:active { transform: scale(.97); }

/* ── Quick-search tags ── */
.cpss-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.cpss-tag {
    padding: 4px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 12px;
    color: #4b5563;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cpss-tag:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

/* ── Results panel ── */
.cpss-results {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.cpss-results[hidden] { display: none; }

.cpss-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}
.cpss-results-count {
    font-size: 12px;
    color: #6b7280;
}
.cpss-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    padding: 2px;
    border-radius: 4px;
    transition: color .15s;
}
.cpss-clear:hover { color: #1a1a2e; }

/* ── Result items ── */
.cpss-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cpss-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background .12s;
    cursor: pointer;
}
.cpss-result-item:last-child { border-bottom: none; }
.cpss-result-item:hover { background: #f9fafb; }

.cpss-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
    flex-shrink: 0;
    background: #f3f4f6;
}
.cpss-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}
.cpss-result-info { flex: 1; min-width: 0; }
.cpss-result-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.cpss-result-meta {
    font-size: 11px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cpss-oos-badge {
    display: inline-block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 500;
}
.cpss-result-price {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    flex-shrink: 0;
}
.cpss-result-price ins { text-decoration: none; color: #b45309; }
.cpss-result-price del { font-size: 11px; font-weight: 400; color: #9ca3af; }

/* ── Loading spinner ── */
.cpss-loading {
    display: flex;
    justify-content: center;
    padding: 16px;
}
.cpss-loading[hidden] { display: none; }
.cpss-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: cpss-spin .7s linear infinite;
}
@keyframes cpss-spin { to { transform: rotate(360deg); } }

/* ── No results ── */
.cpss-no-results {
    text-align: center;
    padding: 20px 14px;
    color: #6b7280;
    font-size: 13px;
}

/* ── View all ── */
.cpss-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    font-size: 13px;
    color: #1a1a2e;
    text-decoration: none;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    font-weight: 500;
    transition: background .12s;
}
.cpss-view-all:hover { background: #f3f4f6; }
.cpss-view-all[hidden] { display: none; }
