/* =========================================================
   Ultra Compare – FINAL SIMPLE & FIXED (RTL)
========================================================= */

.ultra-compare-modal{
    position:fixed;
    inset:0;
    z-index:9999;
    display:none;
    direction:rtl;
}
.ultra-compare-modal.open {
  display: block;
  align-content: center;
}
/* Overlay */
.compare-overlay{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.45);
}

/* Box */
.compare-box{
    background:#fff;
    max-width:1200px;
    margin:4vh auto;
    border-radius:16px;
    padding:16px;
    position:relative;
    box-shadow:0 20px 40px rgba(0,0,0,.18);
    display:flex;
    flex-direction:column;
    gap:12px;
}

/* Close */
.compare-close{
    position:absolute;
    left:12px;
    top:12px;
    width:32px;
    height:32px;
    border:none;
    border-radius:50%;
    background:#f1f5f9;
    font-size:20px;
    cursor:pointer;
    z-index:10;
}

/* ================= Search ================= */
.compare-search{
    position:relative;
}
.compare-search input{
    width:50%;
    padding:10px 14px;
    border-radius:12px;
    border:1px solid #e5e7eb;
    font-size:12px;
    font-family: inherit;
}
.compare-search-results{
    position:absolute;
    inset-inline:0;
    top:110%;
    background:#fff;
    border-radius:12px;
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    z-index:20;
    max-height:240px;
    overflow:auto;
}
.compare-search-item{
    padding:10px 12px;
    cursor:pointer;
    font-size:13px;
}
.compare-search-item:hover{background:#f9fafb}

/* ================= Scroll ================= */
.compare-scroll{
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
}
.compare-scroll::-webkit-scrollbar{display:none}

/* ================= Table ================= */
.compare-table{
    min-width:100%;
    border-collapse:collapse;
    font-size:13px;
}

/* ================= 4 FIXED COLUMNS ================= */
#compare-products-row,
.compare-table tbody tr{
    display:grid;
    grid-template-columns:repeat(4, minmax(240px,1fr));
    gap:12px;
}

/* ================= Product Card ================= */
.compare-product,
.compare-add{
    border:1px solid #eee;
    border-radius:14px;
    padding:12px;
    text-align:center;
    position:relative;
    background:#fff;
}

.compare-product img{
    width:72px;
    margin-bottom:6px;
}

.compare-product .title{
    font-size:12px;
    line-height:1.9;
    margin-bottom:4px;
    font-weight: 600;
}
.compare-product .price{
    font-weight:600;
    font-size:12px;
    color:#2563eb;
}
.compare-product .price del {
    font-weight:300;
    font-size:12px;
    color: #999;
}

/* Remove */
.compare-remove{
    position:absolute;
    top:6px;
    left:6px;
    width:22px;
    height:22px;
    border:none;
    border-radius:50%;
    background:#f1f5f9;
    cursor:pointer;
}

/* Add Slot */
.compare-add{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    font-size:12px;
    color:#555;
    font-weight: 300;
}
.compare-add-btn{
    width:34px;
    height:34px;
    border-radius:50%;
    border:1px dashed #cbd5f5;
    background:transparent;
    font-size:18px;
    cursor:pointer;
}

/* ================= Feature Cells ================= */
.compare-table td{
    padding:10px;
    text-align:center;
    color:#444;
    border-bottom:1px solid #f1f1f1;
}

/* ================= Buy Row ================= */
.compare-buy-row td{
    padding:14px 10px;
}
.compare-buy-btn{
    display:inline-block;
    background:#2563eb;
    color:#fff;
    padding:8px 16px;
    border-radius:12px;
    font-size:12px;
    text-decoration:none;
}

/* ================= MOBILE – REAL HORIZONTAL CAROUSEL ================= */
@media (max-width:768px){

    .compare-box{
        margin:0;
        height:100%;
        border-radius:0;
    }

    .compare-scroll{
        padding-bottom:12px;
    }

    /* ✅ ۱ محصول کامل + نصف بعدی */
    #compare-products-row,
    .compare-table tbody tr{
        grid-template-columns:repeat(4, 60vw);
    }
}
