/* Carsell — Comparison Tool */

/* ── Comparison table ─────────────────────────────────────────────────────── */

.cscmp-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cscmp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cscmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px;
}

.cscmp-table thead th {
    padding: 16px 14px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: top;
}

.cscmp-label-col {
    width: 140px;
    text-align: left !important;
}

.cscmp-car-col {
    min-width: 180px;
}

.cscmp-thumb {
    width: 100%;
    max-width: 200px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.cscmp-car-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.cscmp-car-name a {
    color: inherit;
    text-decoration: none;
}

.cscmp-car-name a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.cscmp-car-price {
    font-size: 16px;
    font-weight: 800;
    color: #1e3a5f;
    margin-bottom: 10px;
}

.cscmp-view-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #1e3a5f;
    color: #fff !important;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .15s;
}

.cscmp-view-btn:hover {
    background: #162d4a;
}

/* ── Table body rows ── */

.cscmp-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

.cscmp-table tbody tr:hover {
    background: #f8fafc;
}

.cscmp-row--highlight {
    background: #fffbeb !important;
}

.cscmp-row--highlight:hover {
    background: #fef3c7 !important;
}

.cscmp-label {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    text-align: left;
    vertical-align: middle;
}

.cscmp-value {
    padding: 12px 14px;
    text-align: center;
    color: #1e293b;
    vertical-align: middle;
}

/* ── Empty state ── */

.cscmp-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.cscmp-empty a {
    color: #3b82f6;
}

/* ── Back link ── */

.cscmp-back {
    margin-top: 20px;
    font-size: 13px;
}

.cscmp-back a {
    color: #64748b;
    text-decoration: none;
}

.cscmp-back a:hover {
    color: #1e293b;
}

/* ── Floating compare bar ─────────────────────────────────────────────────── */

#carsell-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    background: #1e293b;
    color: #f1f5f9;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
}

#carsell-compare-bar.is-active {
    display: flex;
}

.cscmp-bar__items {
    display: flex;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
}

.cscmp-bar__slot {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    max-width: 160px;
}

.cscmp-bar__slot-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    font-size: 12px;
}

.cscmp-bar__slot-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.cscmp-bar__slot-remove:hover {
    color: #ef4444;
}

.cscmp-bar__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cscmp-bar__compare-btn {
    padding: 8px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.cscmp-bar__compare-btn:hover {
    background: #2563eb;
}

.cscmp-bar__clear-btn {
    padding: 8px 14px;
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s, color .15s;
}

.cscmp-bar__clear-btn:hover {
    color: #f1f5f9;
    border-color: #94a3b8;
}

/* ── "Add to Compare" button (on listing cards and single page) ── */

.cscmp-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    white-space: nowrap;
}

.cscmp-add-btn:hover,
.cscmp-add-btn.is-added {
    border-color: #3b82f6;
    color: #1d4ed8;
    background: #eff6ff;
}

.cscmp-add-btn.is-added::before {
    content: "✓ ";
}

/* ── Single listing compare button position ── */

.carsell-single-compare {
    margin: 10px 0;
}

/* ── Responsive ── */

@media (max-width: 640px) {
    .cscmp-bar__slot {
        max-width: 110px;
    }

    .cscmp-bar__compare-btn,
    .cscmp-bar__clear-btn {
        font-size: 12px;
        padding: 7px 12px;
    }

    .cscmp-label-col {
        width: 100px;
    }
}
