.wetheme-compare-page {
    padding: 2rem 0;
}

.wetheme-compare-page .compare-header {
    margin-bottom: 2rem;
    text-align: right;
}

.wetheme-compare-page .compare-table-wrapper {
    overflow-x: auto;
    margin-bottom: 3rem;
    position: relative;
}

/* Add product button */
.wetheme-compare-page .compare-add-product-wrapper {
    margin-bottom: 1rem;
    text-align: right;
}

.wetheme-compare-page .compare-add-product-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #1976d2;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.wetheme-compare-page .compare-add-product-button:hover {
    background-color: #1565c0;
}

.wetheme-compare-page .compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    table-layout: fixed;
    width: max-content;
}

.wetheme-compare-page .compare-table th {
    padding: 12px;
    vertical-align: top;
    text-align: right;
    background-color: #fff;
}
.wetheme-compare-page .compare-table td {
    border: 1px solid #e5e5e5;
    padding: 12px;
    vertical-align: top;
    text-align: right;
    background-color: #fff;
}

.wetheme-compare-page .compare-table thead {
    background-color: #f8f9fa;
}

.wetheme-compare-page .compare-table thead tr {
    border-bottom: 2px solid #e5e5e5;
}

.wetheme-compare-page .compare-table thead th {
    font-weight: 600;
}

.wetheme-compare-page .compare-table th.compare-attr-cell {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    background-color: #f8f9fa;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 0px 12px 0;
    text-align: center;
    vertical-align: middle;
}

.wetheme-compare-page .compare-table th.compare-attr-cell.compare-attr-group {
    background-color: #ececec;
    color: #333;
    font-weight: 600;
    font-size: 15px;
    padding: 10px;
    text-align: right;
    border-bottom: 1px solid #e5e5e5;
    border-top: 1px solid #e5e5e5;
}

.wetheme-compare-page .compare-table th.compare-product-cell,
.wetheme-compare-page .compare-table td.compare-product-cell {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    padding: 22px;
    border-right: 1px solid #eaeaea;
}

.wetheme-compare-page .compare-table th.compare-product-cell-add,
.wetheme-compare-page .compare-table td.compare-product-cell-add {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    vertical-align: middle;
    text-align: center;
}

.wetheme-compare-page .compare-product-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px;
}

.wetheme-compare-page .compare-product-card-add .compare-add-product-button {
    width: 100%;
    max-width: 180px;
    padding: 15px;
    background-color: #808080;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.wetheme-compare-page .compare-product-card {
    text-align: center;
}

.wetheme-compare-page .compare-product-card img {
    max-width: 150px;
    padding: 10px 0;
    height: auto;
}

.wetheme-compare-page .compare-product-title {
    font-size: 14px;
    margin: 0 0 30px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    position: relative;
    padding-bottom: 8px;
    height: 26px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    flex-shrink: 0;
    color: #000000;
    text-decoration: none;
}

.wetheme-compare-page .compare-product-price {
    font-weight: 600;
    margin-bottom: 8px;
    text-align: right;
}

.wetheme-compare-page .compare-product-price .price {
    grid-row: 2;
    grid-column: 2;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 0;
    flex-wrap: wrap;
}

.wetheme-compare-page .compare-product-price .we-price-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.wetheme-compare-page .compare-product-price .we-stock-inline {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #4562ff;
    margin-top: 2px;
}

.wetheme-compare-page .compare-product-price .onsale {
    display: inline-block;
    background: var(--wetheme-onsale-badge-color);
    color: #fff;
    border-radius: 7px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 700;
    margin-right: auto;
    vertical-align: middle;
}

.wetheme-compare-page .compare-product-price del {
    margin-right: 6px;
    color: #999;
    font-size: 13px;
    font-weight: 400;
    text-decoration: line-through;
}

.wetheme-compare-page .compare-product-price del .woocommerce-Price-currencySymbol {
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

.wetheme-compare-page .compare-product-price ins {
    margin-right: auto;
    text-decoration: none;
    font-size: 17px;
}

.wetheme-compare-page .compare-product-price ins .woocommerce-Price-amount {
    text-decoration: none;
    color: #000000;
}

.wetheme-compare-page .compare-product-price .we-price-del-wrapper {
    display: flex;
    align-items: center;
    margin-right: 0;
    order: 0;
    justify-content: space-between;
    width: 100%;
}

.wetheme-compare-page .compare-product-price .we-loop-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.wetheme-compare-page .compare-product-price .we-loop-rating .we-star-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f4b400;
    flex-shrink: 0;
}

.wetheme-compare-page .compare-product-price .we-loop-rating .we-rating-number {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1;
}

.wetheme-compare-page .compare-product-actions {
    display: flex;
    gap: 8px;
    flex-direction: row-reverse;
    margin-top: 19px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.wetheme-compare-page .compare-add-to-cart-button {
    display: block;
    text-align: center;
    background: var(--wetheme-button-cart-archive-color);
    color: #ffffff;
    padding: 0;
    align-content: center;
    height: 42px;
    width: 186px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.wetheme-compare-page .compare-add-to-cart-button:hover {
    filter: brightness(0.95);
    transform: none;
    box-shadow: none;
}

.wetheme-compare-page .compare-remove-button {
    display: inline-block;
    padding: 0px 25px;
    border-radius: 7px;
    border: 1px solid #d1d1d1;
    background: #fff;
    color: #f81f1a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}


/* Popup styles */
.compare-suggestions-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 220;
    display: flex;
    align-items: self-start;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

.compare-suggestions-popup.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-suggestions-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.compare-suggestions-popup-content {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    z-index: 19;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.compare-suggestions-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.compare-suggestions-popup-header .compare-suggestions-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.compare-suggestions-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.compare-suggestions-popup-close:hover {
    color: #000;
}

.compare-suggestions-popup-body {
    padding: 20px;
    padding-bottom: 80px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.compare-suggestions-search-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.compare-suggestions-search-input {
    padding: 12px 15px 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 400;
    color: #333;
    background-color: #fff;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.compare-suggestions-search-input::placeholder {
    color: #999;
    opacity: 1;
}

.compare-suggestions-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-suggestions-search-icon svg {
    width: 20px;
    height: 20px;
}

.compare-suggestions-popup-body .compare-suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.compare-suggestions-popup-body .compare-suggestions-list li {
    flex: 0 0 calc(33.333% - 0.67rem);
    min-width: 150px;
}

.compare-suggestions-popup-body .compare-suggestions-list a {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    background-color: #fff;
    transition: border-color 0.3s ease;
}

.compare-suggestions-popup-body .compare-suggestions-list a:hover {
    border-color: var(--wetheme-primary-color);
}

.compare-suggestions-popup-body .compare-suggestions-list img {
    max-width: 170px;
    height: auto;
}

.compare-suggestions-popup-body .compare-suggestions-list h3 {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    margin: 0px 0 12px 0;
    position: relative;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-shrink: 0;
    color: #000000;
    text-decoration: none;
}

body.compare-popup-open {
    overflow: hidden;
}

.compare-search-loading,
.compare-search-no-results,
.compare-search-error {
    flex: 1 1 100% !important;
    text-align: center;
    justify-items: center;
    padding: 2rem;
    color: #666;
}

.compare-search-loading p,
.compare-search-no-results p,
.compare-search-error p {
    margin: 0;
    font-size: 14px;
}

/* Loading dots animation */
.compare-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    width: 100%;
    flex: 1 1 100%;
}

.compare-loading-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.compare-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--wetheme-primary-color);
    animation: compare-loading-bounce 1.4s infinite ease-in-out both;
}

.compare-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.compare-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.compare-loading-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes compare-loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.wetheme-compare-page .compare-load-more-button,
.compare-suggestions-popup-body .compare-load-more-button {
    display: flex;
    padding: 15px 18px;
    width: 100%;
    border-radius: 5px;
    border: none;
    background: var(--wetheme-gradient);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    justify-content: center;
    margin-top: 1rem;
}

.wetheme-compare-page .compare-load-more-button:disabled,
.compare-suggestions-popup-body .compare-load-more-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.wetheme-add-to-compare-button {
    margin-top: 8px;
    border: none;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wetheme-add-to-compare-button.in-compare {
    border-color: #9e9e9e;
    color: #9e9e9e;
}

.wetheme-add-to-compare-button:hover {
    transform: scale(1.1);
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .wetheme-compare-page .compare-table th.compare-product-cell,
    .wetheme-compare-page .compare-table td.compare-product-cell {
        width: 250px;
        min-width: 250px;
        max-width: 250px;
        padding: 18px;
    }

    .wetheme-compare-page .compare-table th.compare-product-cell-add,
    .wetheme-compare-page .compare-table td.compare-product-cell-add {
        width: 230px;
        min-width: 230px;
        max-width: 230px;
    }

    .compare-suggestions-popup-content {
        width: 90%;
        max-width: 700px;
    }

    .compare-suggestions-popup-body .compare-suggestions-list li {
        flex: 0 0 calc(33.333% - 0.67rem);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .wetheme-compare-page {
        padding: 1rem 0;
    }

    .wetheme-compare-page .compare-table-wrapper {
        margin-bottom: 2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wetheme-compare-page .compare-table {
        min-width: 600px;
        font-size: 13px;
    }

    .wetheme-compare-page .compare-table th.compare-attr-cell {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        font-size: 12px;
        padding: 10px 8px;
    }

    .wetheme-compare-page .compare-table th.compare-attr-cell.compare-attr-group {
        font-size: 13px;
        padding: 8px;
    }

    .wetheme-compare-page .compare-table th.compare-product-cell,
    .wetheme-compare-page .compare-table td.compare-product-cell {
        width: 240px;
        min-width: 240px;
        max-width: 240px;
        padding: 15px 10px;
    }

    .wetheme-compare-page .compare-table th.compare-product-cell-add,
    .wetheme-compare-page .compare-table td.compare-product-cell-add {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .wetheme-compare-page .compare-product-card img {
        max-width: 120px;
    }

    .wetheme-compare-page .compare-product-title {
        font-size: 12px;
        height: 24px;
        margin-bottom: 15px;
    }

    .wetheme-compare-page .compare-product-price {
        font-size: 12px;
        height: 45px;
        display: flex;
        align-items: flex-end;
        width: 100%;
    }

    .wetheme-compare-page .compare-product-price .price {
        font-size: 15px;
    }

    .wetheme-compare-page .compare-product-price ins {
        font-size: 15px;
    }

    .wetheme-compare-page .compare-product-price del {
        font-size: 12px;
    }

    .compare-product-price .woocommerce-Price-currencySymbol {
        font-size: 11px;
        font-weight: 400;
        color: #000000;
        padding-right: 2px;
    }

    .wetheme-compare-page .compare-product-price del .woocommerce-Price-currencySymbol {
        color: #999;
        font-size: 11px;
        font-weight: 400;
    }

    .wetheme-compare-page .compare-product-price .we-price-inline {
        gap: 21px;
    }

    .wetheme-compare-page .compare-product-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }

    .wetheme-compare-page .compare-add-to-cart-button {
        width: 100%;
        height: 40px;
        font-size: 12px;
    }

    .wetheme-compare-page .compare-remove-button {
        width: 100%;
        padding: 10px;
        font-size: 12px;
    }

    .wetheme-compare-page .compare-product-card-add .compare-add-product-button {
        max-width: 100%;
        padding: 12px;
        font-size: 12px;
    }

    .compare-suggestions-popup-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        width: 100%;
        margin: 0 auto;
        border-radius: 0;
    }

    .compare-suggestions-popup-header {
        padding: 15px;
    }

    .compare-suggestions-popup-header .compare-suggestions-title {
        font-size: 16px;
    }

    .compare-suggestions-popup-body {
        padding: 15px;
        padding-bottom: 80px;
        max-height: calc(100vh - 60px);
    }

    .compare-suggestions-search-wrapper {
        margin-bottom: 1rem;
    }

    .compare-suggestions-search-input {
        padding: 10px 12px 10px 40px !important;
        font-size: 13px !important;
    }

    .compare-suggestions-search-icon {
        left: 12px;
    }

    .compare-suggestions-search-icon svg {
        width: 18px;
        height: 18px;
    }

    .compare-suggestions-popup-body .compare-suggestions-list {
        gap: 0.75rem;
        justify-content: flex-start;
    }

    .compare-suggestions-popup-body .compare-suggestions-list li {
        flex: 0 0 calc(50% - 0.375rem);
        min-width: 140px;
    }

    .compare-suggestions-popup-body .compare-suggestions-list img {
        max-width: 140px;
    }

    .compare-suggestions-popup-body .compare-suggestions-list h3 {
        font-size: 12px;
        height: 40px;
        margin: 0 0 10px 0;
    }

    .wetheme-compare-page .compare-load-more-button,
    .compare-suggestions-popup-body .compare-load-more-button {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .wetheme-compare-page .compare-table {
        min-width: 500px;
        font-size: 12px;
    }

    .wetheme-add-to-compare-button {
        margin-top: 0;
        font-size: 24px;
    }

    .wetheme-compare-page .compare-product-price {
        font-size: 12px;
        height: 41px;
        display: flex;
        align-items: flex-end;
        width: 100%;
    }

    .wetheme-compare-page .compare-table th.compare-attr-cell {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        font-size: 11px;
        padding: 8px 6px;
    }

    .wetheme-compare-page .compare-table th.compare-product-cell,
    .wetheme-compare-page .compare-table td.compare-product-cell {
        width: 210px;
        min-width: 210px;
        max-width: 210px;
        padding: 12px 8px;
    }

    .wetheme-compare-page .compare-product-price .we-stock-inline {
        gap: 3px;
        font-size: 10px;
    }

    .wetheme-compare-page .compare-product-price del {
        font-size: 11px;
    }

    .wetheme-compare-page .compare-table th.compare-product-cell-add,
    .wetheme-compare-page .compare-table td.compare-product-cell-add {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
    }

    .wetheme-compare-page .compare-product-card img {
        max-width: 100px;
    }

    .wetheme-compare-page .compare-product-title {
        font-size: 11px;
        height: 22px;
        margin-bottom: 10px;
    }

    .wetheme-compare-page .compare-product-price .we-price-inline {
        gap: 18px;
    }

    .wetheme-compare-page .compare-product-price ins {
        font-size: 13px;
    }

    .compare-product-price .woocommerce-Price-currencySymbol {
        font-size: 11px;
        font-weight: 400;
        color: #000000;
        padding-right: 2px;
    }

    .wetheme-compare-page .compare-product-price del .woocommerce-Price-currencySymbol {
        color: #999;
        font-size: 10px;
        font-weight: 400;
    }

    .wetheme-compare-page .compare-product-price .price {
        font-size: 13px;
    }

    .wetheme-compare-page .compare-product-price .onsale {
        border-radius: 5px;
        padding: 1px 3px;
        font-size: 9px;
    }

    .wetheme-compare-page .compare-product-card-add .compare-add-product-button {
        max-width: 100%;
        padding: 10px;
        font-size: 10px;
    }

    .compare-suggestions-popup-body {
        padding-bottom: 80px;
    }

    .compare-suggestions-popup-body .compare-suggestions-list li {
        flex: 0 0 100%;
        min-width: 100%;
    }

    .compare-suggestions-popup-body .compare-suggestions-list img {
        max-width: 120px;
    }
}


