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

.cmpb-label {
    font-size: .82rem;
    font-weight: 700;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.cmpb-slots {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.cmpb-slot {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #334155;
    border: 1.5px dashed #475569;
    border-radius: 8px;
    padding: 5px 8px;
    flex: 1;
    min-width: 0;
    max-width: 180px;
    position: relative;
    transition: border-color .2s;
    overflow: hidden;
}

.cmpb-slot.filled {
    border-style: solid;
    border-color: #3b82f6;
}

.cmpb-slot-img {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    display: none;
    flex-shrink: 0;
}

.cmpb-slot-ph {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    background: #475569;
    display: none;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: .72rem;
    flex-shrink: 0;
}

.cmpb-slot-lbl {
    font-size: .72rem;
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.cmpb-slot.filled .cmpb-slot-lbl { color: #f1f5f9; }

.cmpb-slot-x {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: .72rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.cmpb-slot-x:hover { color: #f87171; }

.cmpb-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

#cmpb-go {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}
#cmpb-go:disabled { background: #475569; cursor: not-allowed; }
#cmpb-go:not(:disabled):hover { background: #2563eb; }

#cmpb-clear {
    background: none;
    border: 1px solid #475569;
    color: #94a3b8;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .78rem;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
#cmpb-clear:hover { border-color: #f87171; color: #f87171; }

/* ── Toast ── */
.cmp-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: #f8fafc;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: .85rem;
    opacity: 0;
    transition: all .3s;
    z-index: 2000;
    pointer-events: none;
    white-space: nowrap;
}
.cmp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Compare button on product card ── */
[data-compare-id] { transition: all .2s; }
[data-compare-id].active {
    background: #dbeafe !important;
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
}

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */

@media (max-width: 768px) {
    #cmp-bar {
        padding: 8px 12px;
        gap: 8px;
    }

    /* Hide label text on mobile */
    .cmpb-label { display: none; }

    /* Compact slots — show only filled ones */
    .cmpb-slots { gap: 4px; }

    .cmpb-slot {
        padding: 4px 6px;
        max-width: 120px;
    }

    .cmpb-slot-img {
        width: 26px;
        height: 26px;
    }

    .cmpb-slot-lbl { font-size: .68rem; }

    #cmpb-go {
        padding: 7px 14px;
        font-size: .78rem;
    }

    #cmpb-clear {
        padding: 6px 10px;
        font-size: .74rem;
    }
}

@media (max-width: 480px) {
    #cmp-bar {
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    /* On very small: hide empty slots, only show filled ones */
    .cmpb-slot:not(.filled) { display: none; }

    .cmpb-slots {
        flex: none;
        order: 1;
    }

    .cmpb-actions {
        order: 2;
        margin-right: auto;
    }

    .cmpb-slot {
        max-width: 110px;
        padding: 4px 5px;
    }

    .cmpb-slot-lbl { font-size: .65rem; }

    #cmpb-go { font-size: .76rem; padding: 7px 12px; }
    #cmpb-clear { font-size: .72rem; padding: 6px 8px; }
}
