/* ==========================================================================
   1. Main Wrappers
   ========================================================================== */
.ft-super-discount-wrapper,
.ft-amazing-offers-wrapper {
    position: relative;
    width: 100%;
    direction: rtl;
    box-sizing: border-box;
    background: transparent !important;
}

.ft-amazing-offers-wrapper .ft-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--ft-columns-desktop, 4), 1fr); 
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ft-columns-1 { --ft-columns-desktop: 1; }
.ft-columns-2 { --ft-columns-desktop: 2; }
.ft-columns-3 { --ft-columns-desktop: 3; }
.ft-columns-4 { --ft-columns-desktop: 4; }
.ft-columns-5 { --ft-columns-desktop: 5; }
.ft-columns-6 { --ft-columns-desktop: 6; }

@media (max-width: 1024px) {
    .ft-amazing-offers-wrapper .ft-product-grid {
        grid-template-columns: repeat(var(--ft-columns-tablet, 3), 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .ft-amazing-offers-wrapper .ft-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .ft-columns-mobile-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .ft-columns-mobile-2 { grid-template-columns: repeat(2, 1fr) !important; }
}

.ft-no-offers, .ft-no-discount {
    text-align: center;
    padding: 30px;
    background: #fdfdfd;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    margin: 20px 0;
    font-size: 15px;
}

/* ==========================================================================
   2. Slider Frame & Swiper Viewport
   ========================================================================== */
.ft-discount-slider {
    position: relative;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
    border-radius: var(--ft-slider-container-radius, 16px) !important;
    
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    isolation: isolate;
    transform: translateZ(0);

    --ft-arrow-color: #0f172a;
    --ft-arrow-bg: rgba(255, 255, 255, 0.92);
    --ft-arrow-hover-color: #2563eb;
    --ft-arrow-hover-bg: #ffffff;
    --ft-bullet-color: #cbd5e1;
    --ft-bullet-active-color: #2563eb;
}

.ft-discount-slider .swiper-wrapper {
    display: flex;
    align-items: stretch;
    box-sizing: border-box !important;
    transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.ft-discount-slider .swiper-slide {
    height: auto !important;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important;
}

/* ==========================================================================
   3. Card Base & Smart Hover Animations
   ========================================================================== */
.ft-product-card,
.ft-modern-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--ft-card-radius, 16px) !important; 
    padding: 0;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

/* --- پیش‌فرض سایه در حالت هاور (قابل اورراید کامل توسط المنتور) --- */
.ft-card-anim-slide_up:hover,
.ft-card-anim-zoom:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.ft-slider-image-only {
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    display: block;
}

.ft-slider-image-only a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ft-slider-image-only img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

@media (max-width: 767px) {
    .ft-slider-image-only img {
        height: 200px;
    }
}

/* ==========================================================================
   4. Floating Glassmorphism Arrows
   ========================================================================== */
.ft-discount-slider .swiper-button-next,
.ft-discount-slider .swiper-button-prev {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    
    background: var(--ft-arrow-bg);
    color: var(--ft-arrow-color);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);

    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;

    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s ease,
                color 0.2s ease,
                box-shadow 0.2s ease;
}

.ft-discount-slider .swiper-button-next {
    left: 12px;
    right: auto;
    transform: translateX(-20px) scale(0.85);
}

.ft-discount-slider .swiper-button-prev {
    right: 12px;
    left: auto;
    transform: translateX(20px) scale(0.85);
}

.ft-discount-slider .swiper-button-next:after,
.ft-discount-slider .swiper-button-prev:after {
    display: none !important;
}

.ft-discount-slider .swiper-button-next svg,
.ft-discount-slider .swiper-button-prev svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (hover: hover) and (pointer: fine) {
    .ft-discount-slider:hover .swiper-button-next,
    .ft-discount-slider:hover .swiper-button-prev,
    .ft-discount-slider:focus-within .swiper-button-next,
    .ft-discount-slider:focus-within .swiper-button-prev {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0) scale(1);
    }
}

@media (hover: none), (pointer: coarse) {
    .ft-discount-slider .swiper-button-next,
    .ft-discount-slider .swiper-button-prev {
        opacity: 0.9;
        pointer-events: auto;
        transform: translateX(0) scale(0.85);
        width: 38px;
        height: 38px;
        margin-top: -19px;
    }
    .ft-discount-slider .swiper-button-next { left: 6px; }
    .ft-discount-slider .swiper-button-prev { right: 6px; }
}

.ft-discount-slider .swiper-button-next:hover,
.ft-discount-slider .swiper-button-prev:hover {
    background: var(--ft-arrow-hover-bg);
    color: var(--ft-arrow-hover-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
    transform: scale(1.08) !important;
}

.ft-discount-slider .swiper-button-disabled {
    opacity: 0.2 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* ==========================================================================
   5. Pagination Bullets Positioning
   ========================================================================== */
.ft-discount-slider .swiper-pagination,
.ft-super-discount-wrapper .swiper-pagination,
.ft-amazing-offers-wrapper .swiper-pagination {
    position: absolute !important;
    z-index: 35 !important;
    display: flex !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;
    pointer-events: auto !important;
}

.ft-discount-slider .swiper-pagination.ft-bullets-inside.ft-bullets-align-bottom {
    top: auto !important;
    bottom: 14px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
}

.ft-discount-slider .swiper-pagination.ft-bullets-inside.ft-bullets-align-top {
    top: 14px !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
}

.ft-discount-slider .swiper-pagination.ft-bullets-inside.ft-bullets-align-left {
    top: 50% !important;
    bottom: auto !important;
    left: 14px !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
}

.ft-discount-slider .swiper-pagination.ft-bullets-inside.ft-bullets-align-right {
    top: 50% !important;
    bottom: auto !important;
    right: 14px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
}

.ft-super-discount-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-bottom,
.ft-amazing-offers-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-bottom {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    margin-top: 14px !important;
    justify-content: center !important;
    width: 100% !important;
    flex-direction: row !important;
}

.ft-super-discount-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-top,
.ft-amazing-offers-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-top {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    margin-bottom: 14px !important;
    justify-content: center !important;
    width: 100% !important;
    flex-direction: row !important;
}

.ft-super-discount-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-left,
.ft-amazing-offers-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-left {
    position: absolute !important;
    top: 50% !important;
    left: -28px !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
}

.ft-super-discount-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-right,
.ft-amazing-offers-wrapper .swiper-pagination.ft-bullets-outside.ft-bullets-align-right {
    position: absolute !important;
    top: 50% !important;
    right: -28px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    flex-direction: column !important;
}

.ft-discount-slider .swiper-pagination-bullet,
.ft-super-discount-wrapper .swiper-pagination-bullet,
.ft-amazing-offers-wrapper .swiper-pagination-bullet {
    background: var(--ft-bullet-color, #cbd5e1) !important;
    opacity: 0.85 !important;
    width: 8px !important;
    height: 8px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.7) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ft-bullets-align-bottom .swiper-pagination-bullet-active,
.ft-bullets-align-top .swiper-pagination-bullet-active {
    background: var(--ft-bullet-active-color, #2563eb) !important;
    opacity: 1 !important;
    width: 22px !important;
    height: 8px !important;
    border-radius: 10px !important;
}

.ft-bullets-align-left .swiper-pagination-bullet-active,
.ft-bullets-align-right .swiper-pagination-bullet-active {
    background: var(--ft-bullet-active-color, #2563eb) !important;
    opacity: 1 !important;
    width: 8px !important;
    height: 22px !important;
    border-radius: 10px !important;
}

/* ==========================================================================
   6. Image Cropping Controls & Image Hover Effects
   ========================================================================== */
.ft-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.ft-badge-pos-top_left {
    right: auto !important;
    left: 12px !important;
}

/* --- باکس تصویر کارت --- */
.ft-product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 16px;
    overflow: hidden !important;
    height: 220px;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--ft-card-radius, 16px) var(--ft-card-radius, 16px) 0 0 !important;
}

.ft-product-img img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease !important;
}

/* --- حالت‌های کراپ تصویر (Object Fit) --- */
.ft-img-fit-contain img {
    object-fit: contain !important;
}
.ft-img-fit-cover img {
    object-fit: cover !important;
}
.ft-img-fit-fill img {
    object-fit: fill !important;
}

/* --- افکت‌های هاور تصویر --- */
.ft-product-card:hover .ft-img-hover-zoom img,
.ft-img-hover-zoom:hover img {
    transform: scale(1.08) !important;
}

.ft-product-card:hover .ft-img-hover-rotate img,
.ft-img-hover-rotate:hover img {
    transform: scale(1.06) rotate(2.5deg) !important;
}

.ft-img-hover-grayscale img {
    filter: grayscale(100%) !important;
}
.ft-product-card:hover .ft-img-hover-grayscale img,
.ft-img-hover-grayscale:hover img {
    filter: grayscale(0%) !important;
}

/* --- بدنه کارت و المان‌ها --- */
.ft-card-body {
    padding: 0 18px 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ft-product-title {
    font-size: 15px;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.5;
}
.ft-product-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}
.ft-product-title a:hover {
    color: #2563eb;
}

.ft-price-box {
    margin-top: 1px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.ft-price-box del {
    color: #94a3b8;
    font-size: 13px;
}
.ft-price-box ins {
    color: #059669;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
    background: transparent;
}

.ft-product-short-desc {
    font-size: 13px;
    color: #64748b;
    margin: 6px 0;
    line-height: 1.5;
}

.ft-stock-container {
    margin: 10px 0;
    width: 100%;
}
.ft-stock-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
}
.ft-stock-track {
    width: 100%;
    height: 7px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.ft-stock-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f43f5e);
    border-radius: 10px;
    transition: width 0.8s ease-in-out;
}

.ft-countdown {
    background: #fef2f2;
    border: 1px dashed #fca5a5;
    color: #ef4444;
    border-radius: 8px;
    padding: 8px;
    font-weight: bold;
    font-size: 15px;
    margin: 10px 0;
    direction: ltr;
}
.ft-countdown span {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

.ft-card-footer {
    margin-top: auto;
    padding-top: 10px;
}
.ft-product-card .button {
    display: block;
    background: #3b82f6;
    color: #fff;
    border-radius: 8px;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}
.ft-product-card .button:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}