/* =====================================================
   WooCommerce So Sánh Sản Phẩm - Styles
   Tất cả màu chủ đạo dùng var(--mbws-wc-compare-primary)
   ===================================================== */

:root {
    --mbws-wc-compare-primary: #e2722a;
    /* override bởi wp_add_inline_style */
    --mbws-wc-compare-primary-dark: #c85e1a;
    /* override bởi wp_add_inline_style */
}

/* ---- NÚT SO SÁNH ------------------------------------ */
.mbws-wc-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    margin: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all .2s ease;
    line-height: 1.4;
    width: 100%;
    justify-content: center;
}

.mbws-wc-compare-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.mbws-wc-compare-btn:hover {
    border-color: var(--mbws-wc-compare-primary);
    color: var(--mbws-wc-compare-primary);
}

.mbws-wc-compare-btn.active {
    background: var(--mbws-wc-compare-primary);
    border-color: var(--mbws-wc-compare-primary);
    color: #fff;
}

/* ---- FLOATING BAR ----------------------------------- */
#mbws-wc-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e1e2e;
    color: #fff;
    z-index: 99990;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
    transform: translateY(0);
    transition: transform .3s ease;
}

#mbws-wc-compare-bar.hidden {
    transform: translateY(110%);
}

.mbws-wc-compare-bar-inner {
    /* max-width: 1200px; */
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    flex-wrap: wrap;
}

.mbws-wc-compare-bar-label {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
}

.mbws-wc-compare-bar-label strong {
    color: #fff;
}

.mbws-wc-compare-bar-thumbs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.mbws-wc-compare-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border: 2px solid #444;
    border-radius: 4px;
    background: #fff;
    overflow: visible;
}

.mbws-wc-compare-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 3px;
}

.mbws-wc-compare-thumb-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    min-height: unset;
    background: var(--mbws-wc-compare-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 18px;
}

.mbws-wc-compare-bar-btn {
    background: var(--mbws-wc-compare-primary);
    color: #fff;
    padding: 0 18px;
    margin: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s;
    height: 42px;
    line-height: 40px;
    text-transform: uppercase;
}

.mbws-wc-compare-bar-btn:hover {
    background: var(--mbws-wc-compare-primary-dark);
    color: #fff;
}

.mbws-wc-compare-bar-warn {
    font-size: 12px;
    color: #f0c070;
}

.mbws-wc-compare-bar-clear {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 12px;
    margin: 0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.mbws-wc-compare-bar-clear:hover {
    border-color: #e55;
    color: #e55;
}

/* ---- TRANG SO SÁNH ---------------------------------- */
#mbws-wc-compare-page {
    padding: 40px 0 60px;
    min-height: 50vh;
}

/* Empty state */
.mbws-wc-compare-empty {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}

.mbws-wc-compare-empty p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Scrollable wrapper */
.mbws-wc-compare-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table */
.mbws-wc-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #333;
    border: 1px solid #e0e0e0;
}

.mbws-wc-compare-table thead th {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #111;
    vertical-align: middle;
}

.mbws-wc-compare-table thead th:first-child {
    font-size: 16px;
    background: #fafafa;
}

.mbws-wc-compare-table tr td {
    border: 1px solid #e8e8e8;
    padding: 14px 18px;
    vertical-align: middle;
    background: #fff;
    line-height: 1.6;
}

.mbws-wc-compare-label-col,
.mbws-wc-compare-label {
    background: #fafafa !important;
    font-weight: 500;
    color: #444;
    width: 200px;
    min-width: 160px;
}

.mbws-wc-compare-row:nth-child(even) td {
    background: #fdfcfc;
}

/* Image row */
.mbws-wc-compare-row--image td:not(.mbws-wc-compare-label) {
    text-align: center;
    padding: 20px;
}

.mbws-wc-compare-row--image img {
    width: 140px;
    height: 140px;
    object-fit: contain;
    display: inline-block;
}

/* Price */
.mbws-wc-compare-price ins {
    text-decoration: none;
    font-weight: 700;
    color: var(--mbws-wc-compare-primary);
    font-size: 16px;
}

.mbws-wc-compare-price del {
    color: #999;
    font-size: 13px;
    display: block;
}

.mbws-wc-compare-price .amount {
    font-size: inherit;
}

/* Stars */
.mbws-wc-compare-stars {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.mbws-wc-compare-stars svg {
    width: 16px;
    height: 16px;
}

/* Actions row */
.mbws-wc-compare-row--actions td {
    text-align: center;
    background: #f9f9f9 !important;
}

.mbws-wc-compare-action-btn {
    display: block;
    width: 100%;
    height: 45px;
    line-height: 43px;
    padding: 0 16px;
    margin-bottom: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f0f0f0;
    color: #555;
    transition: all .2s;
    text-decoration: none;
    box-sizing: border-box;
}

.mbws-wc-compare-action-btn:last-child {
    margin-bottom: 0;
}

.mbws-wc-compare-buy {
    background: var(--mbws-wc-compare-primary);
    border-color: var(--mbws-wc-compare-primary);
    color: #fff !important;
}

.mbws-wc-compare-buy:hover {
    background: var(--mbws-wc-compare-primary-dark);
    border-color: var(--mbws-wc-compare-primary-dark);
    color: #fff !important;
}

.mbws-wc-compare-remove-btn:hover {
    border-color: #e44;
    color: #e44;
}

/* Back button */
.mbws-wc-compare-back-btn {
    display: inline-block;
    margin-top: 24px;
    color: var(--mbws-wc-compare-primary);
    font-size: 14px;
    text-decoration: none;
}

.mbws-wc-compare-back-btn:hover {
    text-decoration: underline;
}

.mbws-wc-compare-page-nav {
    padding-top: 10px;
}

/* Toast */
#mbws-wc-compare-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e1e2e;
    color: #fff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 99999;
    opacity: 0;
    transition: all .3s ease;
    pointer-events: none;
    white-space: nowrap;
}

#mbws-wc-compare-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .mbws-wc-compare-table thead {
        display: none;
    }

    .mbws-wc-compare-table,
    .mbws-wc-compare-table tbody,
    .mbws-wc-compare-table tr,
    .mbws-wc-compare-table th,
    .mbws-wc-compare-table td {
        display: block;
        width: 100%;
    }

    .mbws-wc-compare-table tr {
        margin-bottom: 20px;
        border: 1px solid #ddd;
    }

    .mbws-wc-compare-label {
        width: auto;
        font-weight: 700;
    }

    .mbws-wc-compare-bar-thumbs {
        flex-wrap: wrap;
    }
}