.product-compare-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.product-compare-action .btn {
    border-radius: 0.75rem;
    font-size: 0.875rem;
}

.product-compare-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-compare-search .form-control {
    max-width: 34rem;
    min-width: 0;
}

.product-compare-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 0.75rem;
}

.product-compare-search-result {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e8e8e8;
    border-radius: 0.9rem;
    background: #fff;
}

.product-compare-search-result img {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    object-fit: contain;
}

.product-compare-search-result__info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.25rem;
}

.product-compare-search-result__info a {
    color: inherit;
    line-height: 1.7;
    text-decoration: none;
}

.product-compare-search-result__info a:hover {
    color: var(--primary-color, #6c4de6);
}

.product-compare-page {
    min-height: 55vh;
    direction: rtl;
}

.product-compare-table-wrap {
    overflow-x: auto;
    border: 1px solid #e8e8e8;
    border-radius: 1rem;
    background: #fff;
    overscroll-behavior-inline: contain;
}

.product-compare-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.product-compare-table th,
.product-compare-table td {
    min-width: 190px;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.product-compare-table tr:last-child th,
.product-compare-table tr:last-child td {
    border-bottom: 0;
}

.product-compare-table__label {
    position: sticky;
    right: 0;
    z-index: 2;
    width: 150px;
    min-width: 150px !important;
    background: #f8f8f8;
    color: #555;
    font-weight: 600;
}

.product-compare-table__product {
    position: relative;
    height: 100%;
    background: #fff;
}

.product-compare-table__product-link {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.product-compare-table__product-link:hover {
    color: var(--primary-color, #6c4de6);
}

.product-compare-table__product-link img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.product-compare-table__title {
    max-width: 260px;
    line-height: 1.8;
}

.product-compare-table__remove {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f1f1;
    color: #555;
    text-decoration: none;
}

.product-compare-table__remove:hover {
    background: #ffe7e7;
    color: #b42318;
}

@media (max-width: 767.98px) {
    .product-compare-search {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .product-compare-search .form-control {
        flex-basis: 100%;
        max-width: none;
    }

    .product-compare-table {
        min-width: 500px;
    }

    .product-compare-table th,
    .product-compare-table td {
        min-width: 170px;
        padding: 0.75rem 0.6rem;
        font-size: 0.8rem;
    }

    .product-compare-table__label {
        width: 120px;
        min-width: 120px !important;
    }

    .product-compare-table__product-link {
        min-height: 185px;
    }

    .product-compare-table__product-link img {
        width: 95px;
        height: 95px;
    }
}
