/* ==============================
   BADGE CONTAINER (Base)
   ============================== */
.fpb-badges-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    
}

/* ==============================
   BADGE APPEARANCE (Base - Default Color)
   ============================== */
.fpb-badge {
    background: linear-gradient(135deg, #0061ff, #44c9d8);
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /*text-transform: uppercase;*/
    /*letter-spacing: 0.5px;*/
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    text-align: center;
    white-space: normal;
    word-break: break-word;
}

.fpb-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.fpb-badges-container.fpb-badges-loop.fpb-position-on-image {
    max-width: calc(100% - 20px);
    align-items: center;
}

.fpb-badges-container.fpb-badges-loop.fpb-position-on-image .fpb-badge {
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    text-align: center;
}


/* ==============================
   BADGE COLOR VARIANTS (NEW)
   ============================== */
.fpb-badge--red {
    background: linear-gradient(135deg, #e53935, #ff7043);
}

.fpb-badge--green {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}

.fpb-badge--orange {
    background: linear-gradient(135deg, #fb8c00, #ffa726);
}

.fpb-badge--purple {
    background: linear-gradient(135deg, #8e24aa, #ba68c8);
}

.fpb-badge--black {
    background: linear-gradient(135deg, #212121, #616161);
}

/* custom color => inline style از PHP اعمال می‌شود */

/* ==============================
   POSITION: on_image — Single Product
   ============================== */
.product-gallery .fpb-badges-container.fpb-position-on-image {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

/* ==============================
   POSITION: on_image — Shop/Archive
   ============================== */

/* روش جدید برای صفحه فروشگاه/دسته‌بندی */
ul.products li.product .fpb-badge-wrapper {
    position: relative;
    margin-bottom: -60px; /* برای جلوگیری از افزایش فاصله */
    height: 0;
    z-index: 10;
}

ul.products li.product .fpb-badges-container.fpb-position-on-image {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

/* روش جایگزین مخصوص تم Flatsome */
ul.products li.product .col-inner > .fpb-badge-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

ul.products li.product .col-inner > .fpb-badge-wrapper .fpb-badges-container.fpb-position-on-image {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    pointer-events: auto;
}

/* اطمینان از موقعیت صحیح */
ul.products li.product .box-image {
    position: relative;
}

/* ==============================
   POSITION: below_title — Shop/Archive (NEW)
   ============================== */
.fpb-badges-container.fpb-position-below-title {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 6px;
    margin-bottom: 4px;
}

.fpb-position-below-title .fpb-badge {
    font-size: 0.9em;
    padding: 3px 6px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ==============================
   POSITION: below_image — Single Product (NEW)
   ============================== */
.fpb-badges-container.fpb-position-below-image {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 0 15px;
}

.fpb-position-below-image .fpb-badge {
    font-size: 0.8em;
    padding: 6px 16px;
    border-radius: 20px;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    /* on_image badges */
    .fpb-badge {
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    .fpb-badges-container {
        top: 10px;
        right: 10px;
    }

    /* below_title badges */
    .fpb-position-below-title .fpb-badge {
        font-size: 0.65rem;
        padding: 2px 8px;
    }

    /* below_image badges */
    .fpb-position-below-image .fpb-badge {
        font-size: 11px;
        padding: 4px 12px;
    }

    .fpb-badges-container.fpb-position-below-image {
        padding: 0 10px;
        margin-top: 8px;
        margin-bottom: 8px;
    }
}
