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

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

/* ---- NÚT SO SÁNH ------------------------------------ */
.wc-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    margin-top: 8px;
    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;
}
.wc-compare-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.wc-compare-btn:hover {
    border-color: var(--wc-compare-primary);
    color: var(--wc-compare-primary);
}
.wc-compare-btn.active {
    background: var(--wc-compare-primary);
    border-color: var(--wc-compare-primary);
    color: #fff;
}

/* ---- FLOATING BAR ----------------------------------- */
#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;
}
#wc-compare-bar.hidden {
    transform: translateY(110%);
}
.wc-compare-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    flex-wrap: wrap;
}
.wc-compare-bar-label {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
}
.wc-compare-bar-label strong { color: #fff; }

.wc-compare-bar-thumbs {
    display: flex;
    gap: 8px;
    flex: 1;
}
.wc-compare-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border: 2px solid #444;
    border-radius: 4px;
    background: #fff;
    overflow: visible;
}
.wc-compare-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 3px;
}
.wc-compare-thumb-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--wc-compare-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.wc-compare-bar-btn {
    background: var(--wc-compare-primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background .2s;
}
.wc-compare-bar-btn:hover {
    background: var(--wc-compare-primary-dark);
    color: #fff;
}
.wc-compare-bar-warn {
    font-size: 12px;
    color: #f0c070;
}
.wc-compare-bar-clear {
    background: none;
    border: 1px solid #555;
    color: #aaa;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}
.wc-compare-bar-clear:hover {
    border-color: #e55;
    color: #e55;
}

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

/* Empty state */
.wc-compare-empty {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}
.wc-compare-empty p {
    font-size: 16px;
    margin-bottom: 20px;
}

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

/* Table */
.wc-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #333;
    border: 1px solid #e0e0e0;
}
.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;
}
.wc-compare-table thead th:first-child {
    font-size: 16px;
    background: #fafafa;
}
.wc-compare-table td {
    border: 1px solid #e8e8e8;
    padding: 14px 18px;
    vertical-align: middle;
    background: #fff;
    line-height: 1.6;
}
.wc-compare-label-col,
.wc-compare-label {
    background: #fafafa !important;
    font-weight: 500;
    color: #444;
    width: 200px;
    min-width: 160px;
}
.wc-compare-row:nth-child(even) td { background: #fdfcfc; }

/* Image row */
.wc-compare-row--image td {
    text-align: center;
    padding: 20px;
}
.wc-compare-row--image img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    display: inline-block;
}

/* Price */
.wc-compare-price ins {
    text-decoration: none;
    font-weight: 700;
    color: var(--wc-compare-primary);
    font-size: 16px;
}
.wc-compare-price del {
    color: #999;
    font-size: 13px;
    display: block;
}
.wc-compare-price .amount { font-size: inherit; }

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

/* Actions row */
.wc-compare-row--actions td {
    text-align: center;
    background: #f9f9f9 !important;
}
.wc-compare-action-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    margin-bottom: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f0f0f0;
    color: #555;
    transition: all .2s;
    text-decoration: none;
    box-sizing: border-box;
}
.wc-compare-action-btn:last-child { margin-bottom: 0; }

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

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

/* Toast */
#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;
}
#wc-compare-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .wc-compare-table thead { display: none; }
    .wc-compare-table,
    .wc-compare-table tbody,
    .wc-compare-table tr,
    .wc-compare-table th,
    .wc-compare-table td { display: block; width: 100%; }
    .wc-compare-table tr { margin-bottom: 20px; border: 1px solid #ddd; }
    .wc-compare-label { width: auto; font-weight: 700; }
    .wc-compare-bar-thumbs { flex-wrap: wrap; }
}
