/* ۱. رزرو فضای کانتینر اصلی در بدو لود صفحه جهت مهار CLS */
.wc-ultimate-subcategories-shield {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    clear: both !important;
    float: none !important;
    margin: 15px 0 25px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    min-height: 120px !important; /* رزرو دقیق فضا برای دایره‌ها و متن تا صفحه پرش نکند */
}

/* ۲. پایداری ساختار افقی مستقل از موتور جاوااسکریپت */
.wc-smart-subcats-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    position: relative !important;
    overflow-x: auto !important; /* اگر اسکریپت با تاخیر لود شود، چیدمان عمودی نمی‌شود و به صورت بومی افقی اسکرول می‌شود */
    overflow-y: hidden !important;
    padding: 5px 0 !important;
    box-sizing: border-box !important;
    scrollbar-width: none; /* مخفی کردن اسکرول‌بار در فایرفاکس */
}

.wc-smart-subcats-container::-webkit-scrollbar {
    display: none; /* مخفی کردن اسکرول‌بار در کروم و سافاری برای زیبایی */
}

.wc-smart-subcats-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100% !important;
}

/* ۳. تثبیت ابعاد آیتم‌ها جهت جلوگیری از تغییر سایز ناگهانی */
.wc-subcat-item {
    flex: 0 0 auto !important;
    width: 100px !important; /* اندازه دقیق و ثابت هر ستون */
    margin-left: 8px !important;
    margin-right: 8px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.wc-subcat-item a {
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* ۴. قفل کردن کادر تصویر روی اندازه ۷۰ پیکسل */
.wc-subcat-img-wrapper {
    width: 85px !important;
    height: 85px !important;
    content-visibility: auto; /* بهینه‌سازی رندر مرورگر برای صفحات شلوغ */
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 2px solid #e2e8f0 !important;
    background: #f7fafc !important; /* رنگ پس‌زمینه موقت تا زمان لود عکس جهت جلوگیری از پرش */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    margin-bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wc-subcat-img-wrapper img {
    width: 85px !important;
    height: 85px !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block !important;
}

.wc-subcat-title {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    display: block !important;
    line-height: 1.4 !important;
    white-space: normal !important; /* قفل کردن متن در یک خط برای جلوگیری از CLS ناشی از شکستن خط متن */
    text-overflow: clip !important;
    overflow: visible !important;
    max-width: 95px !important;
	text-align: center !important;
}

.wc-subcat-title .count {
    font-size: 10px !important;
    color: #a0aec0 !important;
    font-weight: normal !important;
    display: block !important;
    margin-top: 2px !important;
}