/* assets/css/vira-style.css */

/* Container - پایه */
.vira-flash-sale-wrapper {
    margin: 0 !important;
    padding: 0 !important; /* جراحی: حذف padding-bottom: 30px برای رفع نامتوازنی بالا و پایین */
    font-family: inherit;
    position: relative;
}

/* حالت Grid (زمانی که اسلایدر خاموش است) */
.vira-grid-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
}

/* Card - Modern UI with Hover Effect */
.vira-flash-card {
    position: relative;
    width: 100%;
    max-width: 290px;
    background: #ffffff;
    border: none;
    padding: 20px;
    border-radius: var(--vira-card-radius, 20px) !important; /* جراحی: فورس کردن گردی گوشه‌های کارت */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    overflow: hidden !important; /* جراحی: جلوگیری از بیرون‌زدگی محتوا از گوشه‌های گرد */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
    box-sizing: border-box; 
    margin: 10px auto; 
}

.vira-flash-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Badge - Pulse Animation */
.vira-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    width: 50px;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(255, 71, 87, 0.3));
    animation: vira-pulse 2s infinite;
}

@keyframes vira-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1); }
}

/* Product Info & Image Zoom on Hover */
.vira-product-image {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    margin-bottom: 15px;
}

.vira-product-image img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    margin: 0 auto;
}

.vira-flash-card:hover .vira-product-image img {
    transform: scale(1.08);
}

/* Typography */
.vira-product-title {
    font-size: var(--vira-title-size, 14px);
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.5;
}

.vira-product-title a {
    color: var(--vira-title-color, #2d3436); 
    text-decoration: none;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.vira-product-title a:hover {
    color: #ff4757;
}

/* اصلاح قیمت: تبدیل به حالت افقی مشابه دیجی‌کالا */
.vira-product-price {
    font-weight: 800;
    font-size: 16px;
    color: #333;
    margin-bottom: 0;
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: flex-end; 
    flex-wrap: wrap;
    gap: 8px;
}

.vira-product-price del {
    color: #a1a3a8; 
    font-size: 13px; 
    font-weight: 400;
    text-decoration: line-through;
}

.vira-product-price ins {
    text-decoration: none !important; 
    font-size: 17px;
}

/* Timer - Glassmorphism Style */
.vira-countdown {
    display: flex;
    justify-content: center;
    gap: 8px;
    direction: ltr;
    font-weight: 900;
    font-size: 18px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.vira-countdown span {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 6px 10px;
    border-radius: 8px;
    min-width: 48px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.vira-countdown span small {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
    margin-top: 4px;
    text-transform: uppercase;
}

/* Add to Cart Button - Gradient & Shadow */
.vira-flash-card .add_to_cart_button {
    display: inline-block;
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%);
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
    border-radius: 10px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    text-align: center;
}

.vira-flash-card .add_to_cart_button:hover {
    background: linear-gradient(135deg, #ff6b81 0%, #ff4757 100%);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.5);
    transform: translateY(-2px);
    color: #fff;
}

/* Swiper Controls Customization */
.vira-swiper-container .swiper-button-next,
.vira-swiper-container .swiper-button-prev {
    background: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    color: #555;
    z-index: 10;
}

.vira-swiper-container .swiper-button-next { right: 5px; }
.vira-swiper-container .swiper-button-prev { left: 5px; }

.vira-swiper-container .swiper-button-next:after,
.vira-swiper-container .swiper-button-prev:after {
    font-size: 16px;
    font-weight: bold;
}

.vira-swiper-container .swiper-pagination-bullet-active {
    background-color: var(--vira-text-color, #ff4757);
}

/* کادر اصلی در حالت یکپارچه (دیجی‌کالا) */
.vira-layout-digikala {
    display: flex;
    flex-wrap: nowrap;
    align-items: center !important; /* جراحی: تراز وسط عمودی برای حل مشکل پدینگ‌های نامتقارن */
    border-radius: var(--vira-main-radius, 16px);
    padding: var(--vira-main-pad-tb, 15px) var(--vira-main-pad-lr, 10px);
    margin: 0 auto; 
    direction: rtl; 
    background-color: var(--vira-main-bg);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; 
}

/* ستون کناری (Side Banner) */
.vira-side-banner {
    width: 25%;
    max-width: 220px; 
    min-width: 180px;
    flex-shrink: 0;
    padding: 10px 15px;
    box-sizing: border-box;
    color: var(--vira-banner-text-color);
    z-index: 2; 
    display: flex;
    align-items: center;
}

/* کانتینر داخلی بنر برای کنترل بهتر چیدمان */
.vira-side-banner-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.vira-layout-digikala .vira-flash-sale-wrapper {
    flex: 1; 
    width: calc(100% - 25%); 
    margin: 0 !important;
    padding-bottom: 0 !important; /* جلوگیری مجدد از نامتوازنی در دسکتاپ */
    overflow: hidden; 
    min-width: 0; 
}

.vira-side-title {
    color: inherit;
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* جراحی نقطه‌ای: اصلاح تصویر ستون کناری در دسکتاپ (افزایش اولویت سلکتور و تنظیم روی 90px) */
.vira-layout-digikala .vira-side-banner img, 
.vira-side-image {
    width: 140px !important;
    max-width: 140px !important;
    height: auto !important;
    margin: 0 auto 15px auto !important;
    display: block !important;
    object-fit: contain !important; /* جلوگیری از کشیدگی یا دفرمه شدن عکس */
}

/* اصلاح وسط‌چین کردن دکمه ستون کناری */
.vira-side-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    margin-top: 15px;
    transition: opacity 0.3s ease;
}

.vira-side-link:hover {
    opacity: 0.8;
}

/* کنترل سایز آیکون (فلش) در دکمه ستون کناری */
.vira-side-link svg {
    width: 14px !important;  
    height: 14px !important; 
    margin-right: 4px;
}

/* تایمر در بنر کناری */
.vira-timer-banner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    flex-direction: row; 
    direction: ltr; 
    justify-content: center; 
    gap: 4px;
}

.vira-timer-banner span {
    background: #ffffff;
    color: #000000 !important; 
    font-weight: bold;
    min-width: 30px; 
    padding: 4px;
    border-radius: 6px;
    font-size: 15px;
}
.vira-timer-banner span small {
    display: none; 
}

/* کارت‌های تخت */
.vira-flat-card {
    box-shadow: none !important;
    border: 1px solid #f1f1f1;
    height: auto; 
    border-radius: var(--vira-card-radius, 8px) !important;
    padding: 15px;
}
.vira-flat-card:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

/* کانتینر دربرگیرنده قیمت و پیل تخفیف */
.vira-price-container {
    display: flex;
    align-items: center;
    justify-content: space-between; 
    width: 100%;
    margin-bottom: 15px;
}

/* لیبل درصد تخفیف (Discount Pill) */
.vira-discount-pill {
    background-color: var(--vira-pill-bg);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 12px;
    line-height: 1;
    display: inline-block;
}

/* رسپانسیو کردن چیدمان */
@media (max-width: 768px) {
    .vira-layout-digikala {
        flex-direction: column;
        padding: 12px 10px;
        border-radius: 12px;
    }
    
    .vira-side-banner {
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
        padding: 8px 10px !important;
        height: auto !important;
    }

    .vira-side-banner-inner {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 5px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .vira-layout-digikala .vira-side-banner img,
    .vira-side-image {
        display: none !important; 
    }

    .vira-side-title {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 14px !important;
        white-space: nowrap !important; 
        line-height: normal !important;
        display: block !important;
    }

    .vira-side-link {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 12px !important;
        white-space: nowrap !important; 
        flex-shrink: 0 !important;
        line-height: normal !important; 
        display: flex !important;
        align-items: center !important;
    }

    .vira-timer-banner {
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important; 
        display: flex !important;
        align-items: center !important;
    }

    .vira-timer-banner span {
        font-size: 13px !important;
        min-width: 24px !important;
        padding: 3px !important;
        margin: 0 !important;
    }

    .vira-layout-digikala .vira-flash-sale-wrapper {
        width: 100%;
    }
}
