/* Saleh Bazar FBT v10.9.3 - With Product Links */
.sb-fbt-wrapper { direction: rtl; border: 1px solid #eee; border-radius: 8px; background: #fff; margin-bottom: 20px; overflow: hidden; --sb-gap: 15px; --sb-sk-card-bg: #fafafa; --sb-sk-main-bg: #fffff0; --sb-sk-shimmer: #ececec; --sb-sk-shimmer-hi: #f5f5f5; }

/* هدر */
.sb-header-wrap { display: flex; align-items: center; padding: 15px 20px; border-bottom: 1px solid #f9f9f9; justify-content: flex-start; gap: 10px; }
.sb-title-icon { width: 26px; height: auto; object-fit: contain; }
.sb-section-title { margin: 0 !important; font-size: 16px; font-weight: bold; }

/* اسلایدر */
.sb-swiper-container { position: relative; padding: 15px 0; }
.sb-fbt-swiper .swiper-wrapper { display: flex; align-items: stretch; }
.sb-fbt-card { 
    display: flex; flex-direction: column; align-items: center; text-align: center; 
    position: relative; height: auto; background: #fff; padding: 10px; box-sizing: border-box; 
}

/* علامت + */
.sb-plus-sign { 
    position: absolute; top: 50%; left: calc(-1 * (var(--sb-gap) / 2)); 
    transform: translate(-50%, -50%); font-size: 24px; color: #ccc; pointer-events: none; z-index: 10; 
}
.sb-fbt-card:last-child .sb-plus-sign { display: none; }

/* محتوای کارت و لینک عنوان */
.sb-card-content { display: flex; flex-direction: column; flex-grow: 1; width: 100%; justify-content: space-between; }
.sb-title { 
    font-size: 13px; margin: 10px 0; min-height: 40px; 
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; 
}
/* استایل لینک محصول */
.sb-title a {
    color: inherit; /* ارث‌بری رنگ از تنظیمات المنتور */
    text-decoration: none;
    transition: opacity 0.3s;
}
.sb-title a:hover { opacity: 0.7; }

/* سواچ‌ها */
.sb-swatches-container { display: flex; align-items: center; width: 100%; margin: 8px 0; position: relative; overflow: hidden; }
.sb-swatches-list { display: flex; gap: 6px; overflow-x: auto; padding: 4px; scrollbar-width: none; white-space: nowrap; flex-grow: 1; }
.sb-swatches-list::-webkit-scrollbar { display: none; }
.sb-swatch-nav { width: 18px; height: 18px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.1); z-index: 5; flex-shrink: 0; }
.sb-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #ddd; cursor: pointer; flex-shrink: 0; background-size: cover; background-position: center; }
.sb-swatch.active { border-color: #000; box-shadow: inset 0 0 0 1px #000; transform: scale(1.1); }

/* فلش‌های کروسل (نسخه پایلوت) */
.sb-swiper-btn { 
    position: absolute; top: 40%; transform: translateY(-50%); 
    width: 34px; height: 34px; background: #fff; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 50; cursor: pointer; color: #333; transition: all 0.3s ease; 
}
.sb-swiper-btn:hover { background: #f9f9f9; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.sb-swiper-prev { right: 5px; } .sb-swiper-next { left: 5px; }

/* فوتر */
.sb-price-wrap { margin-top: auto; padding-top: 10px; }
.sb-fbt-footer { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; border-top: 1px solid #eee; background: #fafafa; }
#sb-add-all { background: #e91e63; color: #fff; padding: 12px 25px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; }
.sb-add-all { background: #e91e63; color: #fff; padding: 12px 25px; border-radius: 6px; border: none; font-weight: bold; cursor: pointer; }

.sb-fbt-card.sb-is-main {
    z-index: 2;
}

.sb-fbt-wrapper .sb-fbt-swiper .swiper-slide { flex-shrink: 0; }

/* Skeleton loader — هم‌عرض با Swiper واقعی */
.sb-fbt-loading .sb-fbt-dynamic { min-height: 220px; }

.sb-fbt-skeleton-swiper {
    overflow: hidden;
    --sb-spv-current: var(--sb-spv-m, 1.2);
    --sb-gap-current: var(--sb-gap-m, 15px);
}

@media (min-width: 768px) {
    .sb-fbt-skeleton-swiper {
        --sb-spv-current: var(--sb-spv-t, 2.5);
        --sb-gap-current: var(--sb-gap-t, 15px);
    }
}

@media (min-width: 1024px) {
    .sb-fbt-skeleton-swiper {
        --sb-spv-current: var(--sb-spv-d, 4);
        --sb-gap-current: var(--sb-gap-d, 15px);
    }
}

.sb-fbt-skeleton-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
    gap: var(--sb-gap-current);
}

.sb-fbt-skeleton-swiper .swiper-slide.sb-skeleton-card {
    flex: 0 0 calc((100% - (var(--sb-spv-current) - 1) * var(--sb-gap-current)) / var(--sb-spv-current));
    width: calc((100% - (var(--sb-spv-current) - 1) * var(--sb-gap-current)) / var(--sb-spv-current));
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    background: var(--sb-sk-card-bg);
}

.sb-fbt-skeleton-swiper .swiper-slide.sb-skeleton-card.sb-is-main {
    background: var(--sb-sk-main-bg);
}

.sb-fbt-skeleton-swiper .sb-skeleton-card:last-child .sb-plus-sign {
    display: none;
}

.sb-skeleton-check {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin: 0 auto;
}

.sb-skeleton-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
}

.sb-skeleton-card .sb-title {
    min-height: 40px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-skeleton-card .sb-skeleton-line {
    height: 12px;
    border-radius: 6px;
    width: 85%;
    margin: 0 auto;
}

.sb-skeleton-swatches {
    height: 26px;
    width: 70%;
    border-radius: 13px;
    margin: 8px auto;
}

.sb-skeleton-card .sb-skeleton-price {
    height: 14px;
    border-radius: 6px;
    width: 65%;
    margin: 0 auto;
}

.sb-skeleton-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.sb-skeleton-footer .sb-footer-line {
    flex: 1;
    height: 16px;
    margin: 0;
}

.sb-skeleton-btn {
    width: 120px;
    height: 42px;
    border-radius: 6px;
    flex-shrink: 0;
}

@keyframes sb-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.sb-shimmer {
    background: linear-gradient(90deg, var(--sb-sk-shimmer) 0%, var(--sb-sk-shimmer-hi) 40%, var(--sb-sk-shimmer) 80%);
    background-size: 200px 100%;
    animation: sb-shimmer 1.2s ease-in-out infinite;
}

.sb-fbt-wrapper:not(.sb-fbt-loading) .sb-fbt-dynamic {
    animation: sb-fade-in 0.25s ease;
}

@keyframes sb-fade-in {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

@media (max-width: 767px) {
    .sb-fbt-skeleton-swiper .swiper-slide.sb-skeleton-card {
        flex-basis: calc((100% - (var(--sb-spv-current) - 1) * var(--sb-gap-current)) / var(--sb-spv-current));
    }
}

