/* Compact horizontal popup bar */

.wc-compare-popup {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: 600px;
    width: auto; /* shrink to content */
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.20);
    border: 1px solid #e0e0e0;
    z-index: 9999;
    transform: translateY(140%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
    font-family: inherit;
}

.wc-compare-popup-visible {
    transform: translateY(0%);
    opacity: 1;
    pointer-events: auto;
}

.wc-compare-popup-inner {
    position: relative;
    padding: 6px 12px 6px 32px;
}

.wc-compare-popup-close {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #555;
}

.wc-compare-popup-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

/* Placeholder text */
.wc-compare-placeholder {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Slots row: flex, auto-width */
.wc-compare-slots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    overflow-x: auto;
    max-width: none;
}

.wc-compare-slot {
    position: relative;
    min-width: 70px;
    max-width: 90px;
    text-align: center;
    background: #f5f6fa;
    border-radius: 10px;
    padding: 4px 4px 6px;
    box-sizing: border-box;
}

.wc-compare-slot-image img {
    max-width: 50px;
    max-height: 50px;
    display: block;
    margin: 0 auto 2px;
}

.wc-compare-slot-title {
    font-size: 11px;
    line-height: 1.3;
    max-height: 30px;
    overflow: hidden;
}

/* Remove “x” on each slot */
.wc-compare-remove {
    position: absolute;
    top: 2px;
    right: 4px;
    border: none;
    background: transparent;
    color: #c0392b;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

/* Compare button aligned to right */
.wc-compare-go {
    border-radius: 999px;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    background: #2d6cdf;
    color: #fff;
    white-space: nowrap;
    margin-left: auto; /* pushes it to right */
}

.wc-compare-go:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Product Compare buttons on product cards */
.wc-add-to-compare {
    display: inline-block;
    margin-top: 6px;
    background: #2d6cdf;
    color: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    cursor: pointer;
}

.wc-add-to-compare.wc-in-compare {
    background: #1f4fb8;
}

/* Compare table */

.wc-compare-table-wrapper {
    width: 100%;
    margin-top: 20px;
    /* overflow-x only used if table actually overflows */
    overflow-x: auto;
}

.wc-compare-table {
    width: 100%;
    border-collapse: collapse;
    /* remove forced min-width to prevent unnecessary scroll */
    /* min-width: 600px; */
}

.wc-compare-table th,
.wc-compare-table td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: center;
    vertical-align: top;
}

.wc-compare-table th.wc-compare-col-attribute {
    width: 180px;
    background: #f7f7f7;
}

.wc-compare-attr-label {
    text-align: left;
    font-weight: 600;
    background: #fafafa;
}

.wc-compare-attr-value {
    text-align: center;
}

/* Header (image + title clickable) */
.wc-compare-product-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.wc-compare-product-link:hover .wc-compare-product-title {
    text-decoration: underline;
}

.wc-compare-product-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wc-compare-product-image img {
    max-width: 80px;
    height: auto;
}

.wc-compare-product-title {
    font-size: 13px;
    font-weight: 600;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .wc-compare-popup {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}