.compare {
    padding: 0;
}

.compare__toggle,
.compare-toggle {
    width: 30%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    height: 52px;
    background-color: var(--color8);
    border: 1px solid var(--color7);
    padding: 8px 22px;
    border-radius: 12px;
    cursor: pointer;
    order: 3;
    transition: background-color .2s ease, color .2s ease;
}

.compare__toggle.active,
.compare-toggle.active {
    background-color: var(--color3);
    color: var(--color5);
}

.compare__toggle-title,
.compare-toggle .title {
    font-size: 15px;
    padding: 6px;
}

.compare__toggle-count,
.compare-toggle .count {
    margin-right: 6px;
    font-family: 'peyda_bold';
    font-size: 16px;
}

.compare__toggle-close,
.compare-toggle .close {
    margin-left: 4px;
    font-size: 20px;
    display: none;
    padding: 4px;
}

.compare__toggle.active .compare__toggle-close,
.compare-toggle.active .close {
    display: inline-flex;
    background-color: red;
    border-radius: 3px;
}

.compare__panel,
.compare-products-panel {
    display: none;
    background-color: var(--color5);
    border: 1px solid var(--color7);
    padding: 8px;
    z-index: 1000;
    order: 5;
    border-radius: 12px;
    margin-top: 6px;
    gap: 6px;
}

.compare__panel.active,
.compare-products-panel.active {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

.compare__panel img,
.compare-products-panel img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    border: 1px solid var(--color8);
}

.compare__badge,
.compare-badge {
    display: none;
    position: absolute;
    top: 20px;
    right: 33px;
    background-color: var(--color5);
    border: 1px solid var(--color7);
    color: var(--text1);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    z-index: 2;
    font-size: 14px;
    min-width: 146px;
    box-shadow: 0 3px 7px -3px rgba(0, 0, 0, 0.33);
    text-align: center;
    transition: all 0.2s ease;
}

.compare__badge::before,
.compare-badge::before {
    content: '\e915';
    font-family: icon;
    font-size: 18px;
    display: inline-block;
    margin-left: 5px;
}

.compare__badge.added,
.compare-badge.added {
    background-color: #ffeded;
    color: #b20000;
    border-color: #b20000;
}

.compare-enabled .compare__badge,
.compare-enabled .compare-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.compare-page {
    padding: 0;
}

.compare-page .main_content {
    margin-top: 30px;
}

.compare__card,
.compare-page .product-card,
.compare-add-new-card {
    border: 1px solid var(--color7);
    padding: 12px;
    text-align: center;
    position: relative;
    border-radius: 16px;
    background: var(--color5);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.compare__card img,
.compare-page .product-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
}

.compare__card-remove,
.compare-page .product-card .remove {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #ffeded;
    color: #b20000;
    border: 1px solid #b20000;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 20px;
    cursor: pointer;
    font-size: 22px;
}

.compare__card-title,
.compare-page .product-card h3 {
    margin-top: 14px;
    color: var(--text1);
    font-size: 17px;
    line-height: 28px;
}

.compare__card--add,
.compare-add-new-card {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.compare-add-new-card span {
    font-family: 'peyda_medium';
    font-size: 17px;
    color: var(--text1);
}

.compare__table-wrap {
    margin-top: 24px;
    border: 1px solid var(--color7);
    border-radius: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color5);
}

.compare__table,
.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.compare__table th,
.compare__table td,
.compare-table th,
.compare-table td {
    border: 1px solid var(--color7);
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
}

.compare__row--attribute th,
.compare-table th {
    background-color: var(--color8);
    text-align: right;
    font-family: 'peyda_bold';
    font-size: 16px;
    color: var(--text1);
}

.compare__row--values td,
.compare-table .value-row td {
    font-family: 'peyda_medium';
    color: var(--text2);
}

.compare__popup,
.compare-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border: 1px solid var(--color7);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    z-index: 2000;
    max-width: 600px;
    width: 90%;
    border-radius: 16px;
}

.compare__popup.active,
.compare-popup.active {
    display: block;
}

.compare__popup-close,
.compare-popup .close {
    background-color: #ffeded;
    color: #b20000;
    border: 1px solid #b20000;
    border-radius: 100%;
    width: 30px;
    height: 30px;
    font-size: 23px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 13px;
    top: 13px;
    cursor: pointer;
}

.compare__popup h3,
.compare-popup h3 {
    background-color: var(--color3);
    padding: 12px;
    color: var(--color5);
    border-radius: 12px;
    border: 1px solid var(--color7);
    text-align: center;
    font-size: 18px;
    font-family: 'peyda_medium';
    margin-top: 30px;
    margin-bottom: 15px;
}

.compare__popup-select,
.compare-popup select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    min-height: 50px;
    border: 1px solid var(--color7);
    border-radius: 12px;
    font-size: 16px;
}

.compare__popup-list,
.compare-popup-products {
    max-height: 300px;
    overflow-y: auto;
    position: relative;
}

.compare__popup-item,
.compare-popup-product {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}

.compare__popup-thumb,
.compare-popup-product img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.compare__popup-title,
.compare-popup-product h4 {
    margin: 0;
    flex: 1;
    font-size: 15px;
    line-height: 24px;
}

.compare__popup-action,
.compare-popup-product button {
    background: var(--color1);
    color: #fff;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 9px;
}

.compare__popup-loading,
.compare-popup-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

.compare__popup-loading.active,
.compare-popup-loading.active {
    display: block;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (max-width: 575.98px) {
    .compare__cards {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 10px;
    }

    .compare__cards .compare__col,
    .compare__cards .product-box {
        flex: 0 0 80%;
        max-width: 80%;
    }
}

@media (max-width: 768px) {
    .compare__table,
    .compare-table {
        min-width: 640px;
    }

    .compare__table th,
    .compare__table td,
    .compare-table th,
    .compare-table td {
        min-width: 160px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .compare__badge,
    .compare-badge {
        top: 10px;
        right: 19px;
    }
}

@media (min-width: 992px) {
    .compare__panel,
    .compare-products-panel {
        width: 100%;
        margin-top: 15px;
    }

    .compare__panel img,
    .compare-products-panel img {
        width: 70px;
        height: 70px;
    }

    .compare__toggle,
    .compare-toggle {
        width: 20%;
    }
}

@media (min-width: 1200px) {
    .compare__toggle,
    .compare-toggle {
        width: 15%;
    }
}
