.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;
    }
}

/* Product comparison page refresh */
.product-compare-page {
    min-height: 65vh;
    padding: 2.25rem 0 4rem;
    background: #f7f8fc;
    color: #282833;
}

.product-compare-page__container {
    max-width: 1240px;
}

.product-compare-page__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-compare-page__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
    color: #a34d93;
    font-size: 0.78rem;
    font-weight: 700;
}

.product-compare-page__heading h1 {
    margin: 0;
    color: #242431;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 750;
    line-height: 1.5;
}

.product-compare-page__heading p {
    margin: 0.35rem 0 0;
    color: #777783;
    font-size: 0.88rem;
    line-height: 1.8;
}

.product-compare-page__back {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid #e5e5ed;
    border-radius: 12px;
    background: #fff;
    color: #4e4e5a;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.product-compare-page__back:hover {
    transform: translateY(-1px);
    border-color: #cfc8e8;
    color: #6751bb;
}

.product-compare-picker {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 1px solid #ececf2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(30, 30, 50, 0.045);
}

.product-compare-picker__heading {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.product-compare-picker__icon {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: #f4efff;
    color: #7156c8;
    font-size: 1rem;
}

.product-compare-picker__heading h2 {
    margin: 0;
    color: #292936;
    font-size: 0.98rem;
    font-weight: 700;
}

.product-compare-picker__heading p {
    margin: 0.25rem 0 0;
    color: #858591;
    font-size: 0.76rem;
}

.product-compare-search {
    align-items: stretch;
    gap: 0.6rem;
    margin: 0;
}

.product-compare-search__field {
    display: flex;
    flex: 1 1 340px;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    min-height: 48px;
    padding: 0 0.9rem;
    border: 1px solid #e5e5ec;
    border-radius: 12px;
    background: #fbfbfd;
    color: #92929d;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.product-compare-search__field:focus-within {
    border-color: #9e8add;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(113, 86, 200, 0.1);
}

.product-compare-search__field input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #33333e;
    font-size: 0.85rem;
}

.product-compare-search__field input::placeholder {
    color: #a1a1aa;
}

.product-compare-search__clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    padding: 0 0.9rem;
    border: 1px solid #e5e5ec;
    border-radius: 12px;
    color: #777783;
    font-size: 0.8rem;
    text-decoration: none;
}

.product-compare-search__clear:hover {
    border-color: #d4d0e3;
    color: #6751bb;
}

.product-compare-search__status {
    min-height: 1.2rem;
    margin: 0.5rem 0 0;
    color: #777783;
    font-size: 0.75rem;
}

.product-compare-search-results {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.product-compare-search-result {
    gap: 0.85rem;
    padding: 0.8rem;
    border-color: #ededf2;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(30, 30, 50, 0.025);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.product-compare-search-result:hover {
    transform: translateY(-1px);
    border-color: #d8d0ee;
    box-shadow: 0 7px 18px rgba(30, 30, 50, 0.07);
}

.product-compare-search-result img {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    padding: 0.25rem;
    border: 1px solid #f0f0f4;
    border-radius: 10px;
    background: #fff;
}

.product-compare-search-result__info {
    gap: 0.3rem;
}

.product-compare-search-result__info a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #363642;
    font-size: 0.8rem;
    font-weight: 650;
}

.product-compare-search-result__info span {
    color: #858591 !important;
    font-size: 0.7rem;
}

.product-compare-search-result__add {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid #e4def7;
    border-radius: 10px;
    background: #f8f6ff;
    color: #6d53bd;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.product-compare-search-result__add:hover {
    background: #7156c8;
    color: #fff;
}

.product-compare-limit {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid #e8e0fa;
    border-radius: 12px;
    background: #faf8ff;
    color: #6e5a9e;
    font-size: 0.82rem;
}

.product-compare-table-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.product-compare-table-heading h2 {
    margin: 0;
    color: #2c2c38;
    font-size: 1.05rem;
    font-weight: 750;
}

.product-compare-table-heading p {
    margin: 0.3rem 0 0;
    color: #858591;
    font-size: 0.76rem;
}

.product-compare-table-heading__count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #e9e6f2;
    border-radius: 999px;
    background: #fff;
    color: #686476;
    font-size: 0.75rem;
    white-space: nowrap;
}

.product-compare-table-wrap {
    border-color: #e8e8ef;
    border-radius: 18px;
    box-shadow: 0 8px 28px rgba(30, 30, 50, 0.045);
}

.product-compare-table {
    min-width: 720px;
    background: #fff;
}

.product-compare-table th,
.product-compare-table td {
    min-width: 210px;
    padding: 1rem 1.1rem;
    border-color: #efeff3;
    color: #555560;
    font-size: 0.82rem;
    line-height: 1.9;
}

.product-compare-table thead th {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    background: #fff;
}

.product-compare-table__label {
    width: 168px;
    min-width: 168px !important;
    background: #faf9fc;
    color: #555361;
    font-size: 0.8rem;
    font-weight: 700;
}

.product-compare-table thead .product-compare-table__label {
    padding: 1rem;
    background: #f5f2fb;
    color: #6b56a1;
    text-align: right;
}

.product-compare-table__label span,
.product-compare-table__label small {
    display: block;
}

.product-compare-table__label small {
    margin-top: 0.2rem;
    color: #8c879b;
    font-size: 0.68rem;
    font-weight: 500;
}

.product-compare-table__product {
    padding: 1rem !important;
}

.product-compare-table__product-link {
    min-height: 240px;
    justify-content: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 1.1rem;
    color: #32323e;
}

.product-compare-table__product-link img {
    width: 128px;
    height: 128px;
    margin-bottom: 0.35rem;
    padding: 0.45rem;
    border: 1px solid #f0f0f3;
    border-radius: 14px;
    background: #fff;
}

.product-compare-table__brand {
    color: #8c8b96;
    font-size: 0.68rem;
    line-height: 1.5;
}

.product-compare-table__title {
    display: -webkit-box;
    overflow: hidden;
    color: #353540;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-compare-table__remove {
    top: 0.65rem;
    left: 0.65rem;
    width: 30px;
    height: 30px;
    border: 1px solid #ededf1;
    background: #fff;
    color: #8b8b95;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.product-compare-table__remove:hover {
    border-color: #f4d4dc;
    background: #fff2f4;
    color: #c8445e;
}

.product-compare-table tbody tr:nth-child(even) td {
    background: #fdfdfe;
}

.product-compare-table tbody tr:hover td {
    background: #f8f6ff;
}

.product-compare-table tbody tr:nth-child(2) td {
    color: #3c3670;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .product-compare-page {
        padding: 1.5rem 0 3rem;
    }

    .product-compare-page__heading {
        align-items: flex-start;
        margin-bottom: 1.15rem;
    }

    .product-compare-page__back {
        min-height: 40px;
        padding: 0.55rem 0.7rem;
        font-size: 0.72rem;
    }

    .product-compare-picker {
        margin-bottom: 1.5rem;
        padding: 1rem;
        border-radius: 16px;
    }

    .product-compare-search {
        align-items: stretch;
    }

    .product-compare-search__field {
        flex-basis: 100%;
    }

    .product-compare-search__clear {
        min-height: 42px;
    }

    .product-compare-search-results {
        grid-template-columns: 1fr;
    }

    .product-compare-table-heading {
        align-items: center;
    }

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

    .product-compare-table th,
    .product-compare-table td {
        min-width: 185px;
        padding: 0.8rem 0.65rem;
        font-size: 0.76rem;
    }

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

    .product-compare-table__product-link {
        min-height: 215px;
        padding: 0.4rem;
    }

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

@media (max-width: 480px) {
    .product-compare-page__heading {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
    }

    .product-compare-page__back {
        align-self: flex-start;
    }

    .product-compare-table-heading p {
        max-width: 13rem;
    }

    .product-compare-search-result {
        gap: 0.6rem;
        padding: 0.65rem;
    }

    .product-compare-search-result img {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .product-compare-search-result__add {
        padding: 0.45rem 0.55rem;
    }
}

@media (max-width: 767.98px) {
    .product-compare-page .product-compare-table-wrap {
        overflow: hidden;
        border-radius: 16px;
    }

    .product-compare-page .product-compare-table {
        display: block;
        width: 100%;
        min-width: 0;
        table-layout: auto;
    }

    .product-compare-page .product-compare-table thead,
    .product-compare-page .product-compare-table tbody {
        display: block;
    }

    .product-compare-page .product-compare-table thead tr,
    .product-compare-page .product-compare-table tbody tr {
        display: grid;
        grid-template-columns: repeat(var(--compare-product-count, 2), minmax(0, 1fr));
    }

    .product-compare-page .product-compare-table thead tr {
        padding: 0 0.8rem;
        border-bottom: 1px solid #ededf2;
    }

    .product-compare-page .product-compare-table thead .product-compare-table__label {
        position: static;
        grid-column: 1 / -1;
        width: auto;
        min-width: 0 !important;
        padding: 1rem 0.2rem 0.4rem;
        border: 0;
        background: #fff;
        text-align: right;
    }

    .product-compare-page .product-compare-table thead .product-compare-table__product {
        position: relative;
        width: auto;
        min-width: 0;
        height: auto;
        padding: 0.55rem 0.25rem 1rem !important;
        border: 0;
        background: #fff;
    }

    .product-compare-page .product-compare-table__product-link {
        min-height: 0;
        gap: 0.3rem;
        padding: 0.25rem;
    }

    .product-compare-page .product-compare-table__product-link img {
        width: clamp(58px, 20vw, 82px);
        height: clamp(58px, 20vw, 82px);
        margin-bottom: 0.15rem;
        padding: 0.25rem;
        border-radius: 11px;
    }

    .product-compare-page .product-compare-table__brand {
        font-size: 0.63rem;
    }

    .product-compare-page .product-compare-table__title {
        font-size: 0.68rem;
        line-height: 1.7;
    }

    .product-compare-page .product-compare-table__remove {
        top: 0.4rem;
        left: 0.25rem;
        width: 25px;
        height: 25px;
        font-size: 0.65rem;
    }

    .product-compare-page .product-compare-table tbody tr {
        position: relative;
        padding: 0.8rem 0.85rem 0.55rem;
        border-bottom: 1px solid #ededf1;
        background: #fff;
    }

    .product-compare-page .product-compare-table tbody tr:last-child {
        border-bottom: 0;
    }

    .product-compare-page .product-compare-table tbody tr:nth-child(even),
    .product-compare-page .product-compare-table tbody tr:hover {
        background: #fff;
    }

    .product-compare-page .product-compare-table tbody .product-compare-table__label {
        position: static;
        z-index: auto;
        grid-column: 1 / -1;
        width: auto;
        min-width: 0 !important;
        padding: 0.45rem 0.2rem 0.55rem;
        border: 0;
        background: transparent;
        color: #83818d;
        font-size: 0.78rem;
        font-weight: 600;
        text-align: center;
    }

    .product-compare-page .product-compare-table tbody td,
    .product-compare-page .product-compare-table tbody tr:nth-child(even) td,
    .product-compare-page .product-compare-table tbody tr:hover td {
        min-width: 0;
        padding: 0.55rem 0.4rem 0.8rem;
        border: 0;
        background: transparent;
        color: #292936;
        font-size: 0.82rem;
        line-height: 1.8;
        text-align: center;
    }

    .product-compare-page .product-compare-table tbody td + td {
        border-inline-start: 1px solid #f0f0f3;
    }
}
