/* ===================================================
   دکمه‌ی مقایسه (صفحه‌ی تکی/گرید)
   =================================================== */
.behido-compare-btn {
    position: relative;
    border: none;
    background: transparent !important;
    cursor: pointer !important;
    padding: 0px !important;
}

.behido-compare-btn__icon--active { display: none; }
.behido-compare-btn.is-active .behido-compare-btn__icon--default { display: none; }
.behido-compare-btn.is-active .behido-compare-btn__icon--active { display: inline-flex; }

.behido-compare-btn__badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 50%;
    display: none;
}

/* ===================================================
   آیکون هدر
   =================================================== */
.behido-compare-header {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.behido-compare-header__icon svg,
.behido-compare-header__icon img {
    width: 26px;
    height: 26px;
}
span.behido-compare-header__icon {
    padding: 0px;
    height: 26px;
}

.behido-compare-header__badge {
    position: absolute;
    top: -6px;
    left: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 50%;
    min-width: 16px;
    text-align: center;
}

.behido-compare-header:not(.has-items) {
    display: none !important;
}

.behido-compare-header:not(.has-items) .behido-compare-header__badge {
    display: none;
}

/* ===================================================
   صفحه‌ی مقایسه - خالی
   =================================================== */
.behido-compare-empty {
    text-align: center;
    padding: 40px 20px;
    font-family: "IranSansX";
}

.behido-compare-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-family: "IranSansX";
}

.behido-compare-add-trigger {
    margin-top: 14px;
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    font-family: "IranSansX";
}

/* ===================================================
   جدول مقایسه با هدر چسبان
   =================================================== */
.behido-compare-page {
    max-width: 1280px;
    margin: 0 auto;
}

.behido-compare-table-wrap {
    overflow-x: auto;
    font-family: "IranSansX";
    direction: rtl !important;
}

.behido-compare-table {
    width: 100% !important;
    border-collapse: collapse !important;
    min-width: 600px;
    direction: rtl !important;
	font-size: 1.5rem;
}

.behido-compare-table th,
.behido-compare-table td {
    border: 1px solid #eee !important;
    padding: 12px !important;
    text-align: center !important;
    background: #fff !important;
    vertical-align: middle !important;
}

.behido-compare-table thead th,
.behido-compare-table thead td {
    position: sticky !important;
    z-index: 5;
    background: #fff !important;
}

.behido-compare-table__row--product th {
    top: 0 !important;
    z-index: 6;
}

.behido-compare-table__row--price th,
.behido-compare-table__row--price td {
    top: 130px !important; /* اگه ارتفاع ردیف بالا فرق داشت، همین عدد رو دقیق کن */
    font-weight: 700 !important;
    color: #16a34a !important;
}

.behido-compare-table__corner {
    background: #fafafa !important;
}

.behido-compare-table tbody th {
    background: #fafafa !important;
    color: #888 !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.behido-compare-table__product {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    position: relative;
    padding-top: 10px;
    width: 100%;
}

.behido-compare-table__product img {
    width: auto !important;
    height: 125px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    display: block !important;
}

.behido-compare-table__product a {
    color: #111 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 16px !important;
}

.behido-compare-remove {
    position: absolute !important;
    top: -6px !important;
    left: -6px !important;
    border: none !important;
    background: #ef4444 !important;
    color: #fff !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
}

.behido-compare-add-trigger--column {
    background: transparent !important;
    border: 2px dashed #ddd !important;
    border-radius: 10px !important;
    color: #888 !important;
    padding: 20px 10px !important;
    cursor: pointer !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px;
    font-size: 12px !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 90px;
    box-sizing: border-box;
}

.behido-compare-add-trigger--column span {
    font-size: 22px !important;
    line-height: 1;
}

/* ===================================================
   پاپ‌آپ افزودن محصول
   =================================================== */
.behido-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    font-family: "IranSansX";
}

.behido-compare-modal.is-open {
    display: block;
}

.behido-compare-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.behido-compare-modal__panel {
    position: relative;
    max-width: 600px;
    max-height: 80vh;
    margin: 6vh auto;
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.behido-compare-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
	font-size: 1.6rem;
	flex-direction: row;
}

.behido-compare-modal__close {
    border: none;
    background: #ddd !important;
    font-size: 16px !important;
    cursor: pointer !important;
    color: #000 !important;
    width: 27px;
    height: 27px;
    line-height: 1rem;
    padding: 0px !important;
}

.behido-compare-modal__search {
    padding: 12px 18px;
    border-bottom: 1px solid #eee;
}

.behido-compare-modal__search-input {
    width: 100%;
    padding: 10px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
}

.behido-compare-modal__list {
    overflow-y: auto;
    padding: 12px 18px;
}

.behido-compare-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.behido-compare-modal__item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.behido-compare-modal__item:hover {
    border-color: #ccc;
    background: #fafafa;
}

.behido-compare-modal__item.is-selected {
    border-color: #16a34a;
    background: #f0fdf4;
}

.behido-compare-modal__item-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.behido-compare-modal__item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.behido-compare-modal__item-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.behido-compare-modal__item-price {
    font-size: 12px;
    color: #16a34a;
}

.behido-compare-modal__loading,
.behido-compare-modal__empty {
    text-align: center;
    padding: 20px;
    color: #888;
}

/* ===================================================
   ریسپانسیو موبایل
   =================================================== */
@media (max-width: 576px) {
    .behido-compare-modal__grid {
        grid-template-columns: 1fr;
    }

    .behido-compare-modal__panel {
        margin: 0;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
}