/* استایل اصلی آیکن شناور */
.floating-icon-wrapper {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    text-decoration: none;
    display: block;
}

/* کانتینر اصلی برای ایجاد هماهنگی بین المان‌ها */
.floating-container {
    display: flex;
    align-items: center;
    position: relative;
}

.floating-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* برای حفظ گردی تصویر */
    position: relative;
    z-index: 2; /* برای قرارگیری روی متن */
}

.floating-icon .dashicons {
    color: white;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.floating-icon .custom-icon-image {
    width: 30px;
    height: 30px;
    object-fit: cover; /* برای حفظ نسبت تصویر */
}

.floating-text {
    font-size: 14px;
    width: 160px;
    text-align: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1; /* زیر آیکن قرار بگیرد */
}

/* تنظیمات برای موقعیت سمت راست (پیش‌فرض) */
.floating-icon-wrapper.position-right {
    right: 20px;
}

/* در حالت راست، آیکن سمت راست متن قرار می‌گیرد */
.floating-icon-wrapper.position-right .floating-container {
    flex-direction: row;
}

.floating-icon-wrapper.position-right .floating-text {
    border-radius: 25px 5px 5px 25px; /* نیم دایره سمت چپ */
    padding: 8px 20px 8px 30px; /* پدینگ بیشتر سمت چپ */
    margin-right: -15px; /* همپوشانی با آیکن */
    margin-left: 0;
}

/* تنظیمات برای موقعیت سمت چپ */
.floating-icon-wrapper.position-left {
    left: 20px;
}

/* در حالت چپ، آیکن سمت چپ متن قرار می‌گیرد */
.floating-icon-wrapper.position-left .floating-container {
    flex-direction: row-reverse;
}

.floating-icon-wrapper.position-left .floating-text {
    border-radius: 5px 25px 25px 5px; /* نیم دایره سمت راست */
    padding: 8px 30px 8px 20px; /* پدینگ بیشتر سمت راست */
    margin-left: -15px; /* همپوشانی با آیکن */
    margin-right: 0;
}

/* تنظیمات برای وضعیت RTL در سمت راست */
html[dir="rtl"] .floating-icon-wrapper.position-right .floating-container {
    flex-direction: row-reverse; /* در RTL آیکن سمت چپ متن قرار می‌گیرد */
}

html[dir="rtl"] .floating-icon-wrapper.position-right .floating-text {
    border-radius: 25px 0px 0px 25px;
    padding: 8px 30px 8px 20px;
}

/* تنظیمات برای وضعیت RTL در سمت چپ */
html[dir="rtl"] .floating-icon-wrapper.position-left .floating-container {
    flex-direction: row; /* در RTL آیکن سمت راست متن قرار می‌گیرد */
}

html[dir="rtl"] .floating-icon-wrapper.position-left .floating-text {
    border-radius: 0px 25px 25px 0px;
    padding: 8px 20px 8px 30px;
}

/* استایل‌های ریسپانسیو برای موبایل و تبلت (تا عرض ۱۰۲۴ پیکسل) */
@media screen and (max-width: 1024px) {
    /* ۱. برندها، برچسب‌ها، دسته‌بندی‌ها، آرشیو محصولات و فروشگاه (بجز صفحه اصلی) */
    body.archive:not(.home) .floating-icon-wrapper,
    body.woocommerce-shop:not(.home) .floating-icon-wrapper,
    body.tax-product_cat .floating-icon-wrapper,
    body.tax-product_tag .floating-icon-wrapper,
    body.post-type-archive-product .floating-icon-wrapper {
        bottom: 70px;
    }

    /* ۲. صفحه تکی محصول */
    body.single-product .floating-icon-wrapper {
        bottom: 73px;
    }
}