/* ===================================================
   استایل اسکلتون یکپارچه (Global Shimmer)
   =================================================== */
@keyframes mt-global-shimmer {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.mt-skeleton-overlay {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100% !important; height: 100% !important;
    z-index: 100;
    background: #f4f6f8 !important;
    pointer-events: none;
    padding: 20px 0 !important;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.mt-skeleton-overlay::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    animation: mt-global-shimmer 1.5s infinite linear;
    z-index: 101; pointer-events: none;
}

/* رنگ ملایم‌تر برای المان‌های اسکلتون */
.mt-sk-anim {
    background-color: #f0f0f0 !important; 
    display: block !important;
    animation: none !important; 
    background-image: none !important;
	height: 10x !important;
}

/* تنظیمات اسکلتون */
.mt-skeleton-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: hidden !important; 
    gap: 5px !important; 
    padding: 0 !important;
    width: 100% !important; 
    height: 100% !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
}

/* آیتم‌های عمومی اسکلتون */
.mt-sk-item {
    display: block !important; 
    flex-shrink: 0 !important; 
    flex-grow: 0 !important;
    height: auto !important;
}

/* استایل دقیق کارت‌های اسکلتون */
.mt-skeleton-overlay .mt-sk-product, 
.mt-skeleton-overlay .mt-sk-last {
    width: 162px !important;
    min-width: 162px !important;
}

.mt-skeleton-overlay .mt-sk-first {
    width: 166px !important;
    min-width: 166px !important;
}

/* ریسپانسیو: تبلت */
@media (max-width: 1024px) and (min-width: 768px) {
    .mt-skeleton-overlay .mt-sk-product, 
    .mt-skeleton-overlay .mt-sk-last { 
        width: 190px !important; 
        min-width: 190px !important;
    }
}

/* ریسپانسیو: موبایل */
@media (max-width: 767px) {
    .mt-skeleton-overlay .mt-sk-product, 
    .mt-skeleton-overlay .mt-sk-last { 
        width: 140px !important; 
        min-width: 140px !important;
    }
}

/* مخفی کردن اسلاید اول اسکلتون در موبایل و تبلت */
@media (max-width: 1024px) {
    .mt-skeleton-overlay .mt-sk-first { display: none !important; }
    
    .mt-skeleton-wrapper {
        padding-right: 15px !important; 
        padding-left: 15px !important;
    }
}

.mt-skeleton-overlay .mt-default-card {
    background: #ffffff !important; height: 100% !important; width: 100% !important;
    display: flex !important; flex-direction: column !important;
    padding: 10px 9px !important; box-sizing: border-box !important;
    border-radius: 0 !important; position: relative; border-left: 1px solid #f9f9f9; 
}

/* تنظیم خطوط بوردر برای اولین و آخرین آیتم */
.mt-skeleton-overlay .mt-sk-item:first-child .mt-default-card {
    border-top-right-radius: 12px !important; border-bottom-right-radius: 12px !important;
}
.mt-skeleton-overlay .mt-sk-first + .mt-sk-item .mt-default-card {
    border-top-right-radius: 12px !important; border-bottom-right-radius: 12px !important;
}

/* کلاس‌های نمایشی (آپدیت شده برای سازگاری با PHP جدید) */
.mt-hidden-all { display: none !important; }

/* ===================================================
   استایل‌های اصلی اسلایدر
   =================================================== */
.mt-custom-slider {
    position: relative; padding: 20px !important; overflow: hidden !important;
    direction: rtl; box-sizing: border-box; border-radius: 12px; min-height: auto;
}
.mt-custom-slider .swiper-wrapper { align-items: stretch; display: flex; }
.mt-custom-slider .swiper-slide { height: auto; display: flex; flex-direction: column; padding: 0 !important; }

/* اسلاید اول */
.mt-first-slide { 
    flex-shrink: 0; 
    width: 166px !important; 
    min-width: 166px !important;
    flex: 0 0 166px !important; /* این خط از کشیده شدن اسلاید در ویرایشگر جلوگیری می‌کند */
}
.mt-first-default {
    background: transparent; padding: 10px; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: #fff; gap: 10px; border-radius: 12px; box-sizing: border-box;
}
.mt-img-1, .mt-img-2 { max-width: 100%; height: auto; object-fit: contain; }
.mt-countdown { display: flex; gap: 3px; direction: rtl; justify-content: center; align-items: center; }
.mt-time-unit {
    font-weight: 700; min-width: 24px; padding: 0 2px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; font-size: 13px; background: #fff; color: #333;
}
.mt-countdown span:not(.mt-time-unit) { color: #fff; font-weight: bold; display: flex; align-items: center; }
.mt-fs-btn {
    display: inline-flex; align-items: center; gap: 5px; color: #fff;
    text-decoration: none; font-size: 12px; margin-top: auto; font-weight: 600; transition: transform 0.2s;
}
.mt-fs-btn:hover { transform: translateX(-3px); }

/* کارت محصول */
.mt-product-slide { flex-shrink: 0; height: auto !important; width: 162px !important; max-width: 162px !important; }
.mt-default-card {
    background: #fff; border-radius: 0; padding: 10px 9px;
    height: 100%; display: flex; flex-direction: column;
    text-decoration: none; color: #333; margin: 0; box-sizing: border-box;
    border: none; position: relative; transition: all 0.2s;
}
.mt-default-card:hover { z-index: 2; box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.mt-is-first-product .mt-default-card { border-top-right-radius: 12px !important; border-bottom-right-radius: 12px !important; }
.mt-card-img { text-align: center; margin-bottom: 10px; display: flex; justify-content: center; align-items: center; }
.mt-card-img img { width: 132px; height: 132px; object-fit: contain; display: block; }
h3.mt-card-title, .mt-card-title { 
    font-size: 12px !important; line-height: 1.5; height: auto; margin: 0 0 10px; 
    font-weight: 400; color: #333; display: -webkit-box; -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
}
.mt-card-prices { margin-top: auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 100%; }
.mt-price-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.mt-price-new { text-align: left; font-weight: 700; font-size: 14px; color: #424750; display: inline-flex; align-items: center; }
.mt-custom-currency .woocommerce-Price-currencySymbol { display: none !important; }
.mt-custom-currency .woocommerce-Price-amount { display: inline-flex; align-items: center; flex-direction: row-reverse; }
.mt-custom-currency .woocommerce-Price-amount::after {
    content: ""; display: inline-block; width: 18px; height: 18px; background-color: currentColor; 
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><path d="M250,0C111.9,0,0,111.9,0,250s111.9,250,250,250s250-111.9,250-250S388.1,0,250,0z M250,453c-111.9,0-203-91.1-203-203S138.1,47,250,47s203,91.1,203,203S361.9,453,250,453z M250,110c-50,0-94,26-119,65h40c21-22,51-36,84-36c50,0,92,31,108,76h-42c-12-19-33-31-56-31c-31,0-57,20-67,48h-38c11-50,56-87,109-87c61,0,111,49,111,110c0,13-2,25-6,37h-36c2-8,3-17,3-26c0-40-33-73-73-73c-28,0-52,15-64,38h-37c15-41,54-70,99-70c50,0,92,35,103,81h-39c-9-24-32-41-59-41c-34,0-62,28-62,62s28,62,62,62c27,0,50-17,59-41h39c-11,46-53,81-103,81c-59,0-107-48-107-107c0-8,1-15,3-22h-36c-4,11-6,23-6,35c0,70,57,127,127,127s127-57,127-127S320,110,250,110z"/></svg>');
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; margin-right: 4px; vertical-align: middle;
}
.mt-price-old { display: flex; justify-content: flex-end; align-items: center; width: 100%; height: 20px; }
.mt-price-old del { font-size: 12px; color: #aaaaaa; text-decoration: line-through; }
.mt-discount-badge { background: #D32F2F; color: #fff; padding: 2px 8px; border-radius: 12px; font-weight: 700; font-size: 12px; line-height: 1.2; }

/* اسلاید آخر و هدر موبایل */
.mt-last-slide { flex-shrink: 0; height: auto !important; width: 162px !important; max-width: 162px !important; }
.mt-last-default { background: #fff; border-top-left-radius: 12px; border-bottom-left-radius: 12px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; text-decoration: none; gap: 15px; color: #555; padding: 20px; box-sizing: border-box; transition: background 0.2s; }
.mt-last-default:hover { background: #f9f9f9; }
.mt-last-icon img { width: 48px; height: 48px; display: block; margin: 0 auto; }
.mt-last-text-box { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 700; }
.mt-last-text{font-size: 12px !important;}
.mt-mobile-header { display: flex; justify-content: space-between; align-items: center; padding: 0 5px 15px 5px; color: #fff; width: 100%; box-sizing: border-box; }
.mt-mob-right { display: flex; align-items: center; gap: 10px; }
.mt-mob-left { color: #fff; font-size: 13px; display: flex; align-items: center; gap: 5px; cursor: pointer; font-weight: 600; }

/* دکمه‌های ناوبری */
.mt-custom-slider .elementor-swiper-button { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    z-index: 100 !important; 
    width: 40px; 
    height: 40px; 
    background: #fff; 
    border-radius: 50%; 
    border: 1px solid #ddd;
    display: flex !important; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: #111111 !important;
    transition: all 0.3s; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 1; 
}
.mt-custom-slider .elementor-swiper-button i {
    font-weight: 900 !important;
    font-size: 20px;
}
.mt-custom-slider .elementor-swiper-button:hover { background: #f0f0f0; color: #000 !important; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.mt-custom-slider .elementor-swiper-button-prev { right: 10px !important; left: auto !important; }
.mt-custom-slider .elementor-swiper-button-next { left: 10px !important; right: auto !important; }

/* مخفی کردن کامل دکمه‌های غیرفعال در ابتدا و انتهای اسلایدر */
.swiper-button-disabled { 
    opacity: 0 !important; 
    cursor: default; 
    pointer-events: none; 
    visibility: hidden; 
}

.mt-fs-btn i, .mt-fs-btn svg, .mt-last-text-box i, .mt-last-text-box svg { font-size: 16px !important; width: 16px !important; height: 16px !important; }

/* ===================================================
   ریسپانسیو (عرض‌ها)
   =================================================== */
/* دسکتاپ */
@media (min-width: 1025px) {
    .mt-mobile-only { display: none !important; }
    .mt-desktop-only { display: flex !important; }
    .mt-product-slide, .mt-last-slide { 
        width: 162px !important; max-width: 162px !important; 
    }
}

/* موبایل و تبلت (Shared) */
@media (max-width: 1024px) {
    .mt-skeleton-overlay .mt-sk-first { display: none !important; }
    
    .mt-skeleton-wrapper {
        padding-right: 15px !important; 
        padding-left: 15px !important;
    }
}

/* تبلت */
@media (max-width: 1024px) and (min-width: 768px) {
    .mt-desktop-only { display: none !important; } 
    .mt-mobile-only { display: flex !important; } 
    .mt-product-slide, .mt-last-slide { 
        width: 190px !important; max-width: 190px !important; 
    }
    .mt-custom-slider { padding: 20px 0 !important; }
}

/* موبایل */
@media (max-width: 767px) {
    .mt-desktop-only { display: none !important; }
    .mt-mobile-only { display: flex !important; }
    .mt-product-slide, .mt-last-slide { 
        width: 140px !important; max-width: 140px !important; 
    }
    .mt-custom-slider { padding: 20px 0 !important; border-radius: 0 !important; width: 100% !important; margin: 0 !important; }
    .elementor-widget-mt_wc_plus_amazing_slider { overflow: hidden; }
    
    /* دکمه‌های ناوبری در موبایل کوچکتر میشن ولی مخفی نمیشن */
    .mt-custom-slider .elementor-swiper-button {
        width: 32px; 
        height: 32px;
    }
    .mt-custom-slider .elementor-swiper-button i {
        font-size: 16px;
    }
    .mt-custom-slider .elementor-swiper-button-prev { right: 5px !important; }
    .mt-custom-slider .elementor-swiper-button-next { left: 5px !important; }

    .mt-time-unit { min-width: 20px; height: 24px; font-size: 12px; }
}