/* =========================================================
   رگال محصولات تخفیف‌دار - طراحی IT Home
   ========================================================= */

.up-sale-section {
    width: 100%;
    padding: 30px 0;
    background: #f4f6f9;
}

.up-sale-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
    display: grid;
    /* ★ پنل کناری (260px) در ستون اول = سمت راست در RTL */
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: stretch;
    direction: rtl;
}

/* =========================================
   پنل کناری (سمت راست)
   ========================================= */
.up-sale-side {
    background: linear-gradient(135deg, #4837F3 0%, #3728c9 100%);
    border-radius: 18px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.up-sale-side::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.25), transparent 70%);
}

.up-sale-side::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
}

.up-sale-side-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.up-sale-side-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: salePulse 3s ease-in-out infinite;
}

@keyframes salePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(255, 255, 255, 0); }
}

.up-sale-side-icon svg {
    stroke: #fff;
    width: 55px;
    height: 55px;
}

.up-sale-side-title {
    color: #fff !important;
    font-size: 19px;
    font-weight: 800;
    margin: 0 0 20px;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.up-sale-side-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #fff;
    color: #4837F3 !important;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.up-sale-side-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    background: #FF6B35;
    color: #fff !important;
}

.up-sale-side-btn svg {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

.up-sale-side-btn:hover svg {
    transform: rotate(180deg) translateX(-4px);
}

/* =========================================
   رگال (کاروسل محصولات) - سمت چپ
   ========================================= */
.up-sale-carousel {
    background: linear-gradient(135deg, #4837F3 0%, #3728c9 100%);
    border-radius: 18px;
    padding: 20px 15px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.up-sale-carousel::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.15), transparent 70%);
    pointer-events: none;
}

.up-sale-swiper {
    width: 100%;
    overflow: hidden;
    padding: 5px 0;
}

.up-sale-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* =========================================
   کارت محصول
   ========================================= */
.up-sale-card {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.up-sale-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* برچسب درصد تخفیف */
.up-sale-percent {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(145deg, #FF6B35, #e85a2a);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    z-index: 3;
    line-height: 1.2;
}

/* دکمه علاقه‌مندی */
.up-sale-wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s;
    padding: 0;
    color: #999;
}

.up-sale-wishlist:hover {
    background: #e63946;
    color: #fff;
    border-color: #e63946;
    transform: scale(1.1);
}

.up-sale-wishlist svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

/* تصویر محصول */
.up-sale-img-link {
    display: block;
    text-decoration: none;
}

.up-sale-img {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fc;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.up-sale-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s;
}

.up-sale-card:hover .up-sale-img img {
    transform: scale(1.08);
}

/* اطلاعات محصول */
.up-sale-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

/* برچسب سبز اقساط */
.up-sale-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.up-sale-badge-installment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #e8f5e9, #d4edda);
    color: #2e7d32;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
    line-height: 1.4;
    white-space: nowrap;
}

.up-sale-badge-installment::before {
    content: '✓';
    font-size: 11px;
    font-weight: 900;
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.15);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* عنوان محصول */
.up-sale-title {
    display: -webkit-box;
    font-size: 13px;
    font-weight: 600;
    color: #222 !important;
    line-height: 1.5;
    text-decoration: none;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 39px;
    transition: color 0.2s;
}

.up-sale-title:hover {
    color: #4837F3 !important;
}

/* قیمت‌ها */
.up-sale-prices {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px dashed #eee;
}

.up-sale-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.up-sale-old-price {
    color: #b0b0bc;
    font-size: 11.5px;
    text-decoration: line-through;
    font-weight: 500;
    order: 2;
}

.up-sale-new-price {
    color: #222;
    font-size: 15px;
    font-weight: 800;
    order: 1;
}

.up-sale-new-price ins,
.up-sale-new-price .woocommerce-Price-amount {
    color: #222 !important;
    text-decoration: none !important;
    font-weight: 800 !important;
}

.up-sale-new-price del {
    display: none;
}

/* =========================================
   ریسپانسیو
   ========================================= */

/* تبلت */
@media (max-width: 992px) {
    .up-sale-container {
        grid-template-columns: 220px 1fr;
        gap: 15px;
        padding: 0 20px;
    }

    .up-sale-carousel {
        padding: 15px 12px;
        border-radius: 15px;
    }

    .up-sale-side {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .up-sale-side-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 14px;
    }

    .up-sale-side-icon svg {
        width: 42px;
        height: 42px;
    }

    .up-sale-side-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .up-sale-side-btn {
        padding: 10px 18px;
        font-size: 12.5px;
    }

    .up-sale-img {
        height: 150px;
    }
}

/* موبایل */
@media (max-width: 768px) {
    .up-sale-section {
        padding: 20px 0;
    }

    .up-sale-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 15px;
    }

    .up-sale-carousel {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .up-sale-side {
        padding: 15px;
        border-radius: 12px;
        order: -1; /* پنل کناری بالای رگال در موبایل */
    }

    .up-sale-side-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: right;
        gap: 12px;
    }

    .up-sale-side-icon {
        width: 50px;
        height: 50px;
        margin: 0;
        flex-shrink: 0;
    }

    .up-sale-side-icon svg {
        width: 28px;
        height: 28px;
    }

    .up-sale-side-title {
        font-size: 14px;
        margin: 0;
        flex: 1;
    }

    .up-sale-side-btn {
        padding: 10px 15px;
        font-size: 12px;
        margin: 0;
        flex-shrink: 0;
    }

    .up-sale-img {
        height: 130px;
    }

    .up-sale-card {
        padding: 10px;
    }

    .up-sale-title {
        font-size: 12px;
    }

    .up-sale-new-price {
        font-size: 13px;
    }

    .up-sale-percent {
        font-size: 11px;
        padding: 4px 7px;
    }

    .up-sale-wishlist {
        width: 26px;
        height: 26px;
    }

    .up-sale-wishlist svg {
        width: 13px;
        height: 13px;
    }
}

@media (max-width: 480px) {
    .up-sale-img {
        height: 110px;
    }

    .up-sale-badge-installment {
        font-size: 10px;
        padding: 3px 8px;
    }
}