/**
 * BAOLIAN Product Selector — Compare Bar
 * 
 * Sticky bottom bar for product comparison.
 * Prefix: blps-
 */

/* ─── Compare Bar ─────────────────────────── */
.blps-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    border-top: 2px solid #c41e3a;
    padding: 12px 20px;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 9990;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}
.blps-compare-bar--visible {
    display: flex;
}

.blps-compare-bar__items {
    display: flex;
    gap: 10px;
    align-items: center;
    overflow-x: auto;
    flex: 1;
}

.blps-compare-bar__item {
    position: relative;
    width: 48px;
    height: 48px;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1a1a1a;
}
.blps-compare-bar__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.blps-compare-bar__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #c41e3a;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.blps-compare-bar__placeholder {
    width: 48px;
    height: 48px;
    border: 1px dashed #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 20px;
    flex-shrink: 0;
}

.blps-compare-bar__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 16px;
    flex-shrink: 0;
}

/* ─── Compare Modal / Page ────────────────── */
.blps-compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    color: #fff;
    font-size: 15px;
}

.blps-compare-table th,
.blps-compare-table td {
    padding: 12px 16px;
    border: 1px solid #333;
    text-align: left;
    vertical-align: top;
}

.blps-compare-table th {
    background: #222;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.blps-compare-table td {
    min-width: 150px;
}

.blps-compare-table tr:hover td {
    background: #222;
}

/* Highlight cells with differing values */
.blps-compare-table__diff {
    background: rgba(196, 30, 58, 0.1) !important;
    border-left: 2px solid #c41e3a;
}

/* ─── Mobile ──────────────────────────────── */
@media (max-width: 768px) {
    .blps-compare-bar {
        flex-direction: column;
        padding: 10px 12px;
        gap: 8px;
        /* Safe area for iPhone home indicator */
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    .blps-compare-bar__items {
        overflow-x: auto;
    }
    .blps-compare-bar__item,
    .blps-compare-bar__placeholder {
        width: 40px;
        height: 40px;
    }
    .blps-compare-bar__actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}
