/* ==========================================================================
   ۱. نشان‌های شناور روزمره کارت محصول (بدون تایمر)
   ========================================================================== */
.beigi-card-top-bar {
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 5;
}
.beigi-card-top-slot {
    display: flex;
    align-items: center;
}
.beigi-special-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    background: #fff1f2;
    color: #e11d48;
    border: 1px solid #fecdd3;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 800;
    border-radius: 9999px;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(225, 29, 72, 0.08);
}
.beigi-floating-discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 9px;
    background: #ef394e;
    color: #ffffff;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 800;
    border-radius: 9999px;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(239, 57, 78, 0.3);
    box-sizing: border-box;
}
.beigi-discontinued-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

/* ==========================================================================
   ۲. سربرگ مناسبتی کارت محصول — بهینه‌شده برای کارت‌های باریک و تایمر فشرده
   ========================================================================== */
.beigi-card-campaign-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--bc-h, 34px);
    min-height: var(--bc-h, 34px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 0 8px;
    box-sizing: border-box;
    background: var(--bc-bg, #18181b);
    color: var(--bc-color, #fbbf24);
    border-radius: var(--bc-r, 14px) var(--bc-r, 14px) 0 0;
    font-family: inherit;
    line-height: 1;
    z-index: 6;
    overflow: hidden;
    pointer-events: none;
    container-type: inline-size;
}
.beigi-card-campaign-bar.is-flow {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
}
.beigi-camp-right {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}
.beigi-camp-left {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}
.beigi-camp-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--bc-t, 11px) + 4px);
    height: calc(var(--bc-t, 11px) + 4px);
    flex-shrink: 0;
    color: var(--bc-color, #fbbf24);
}
.beigi-camp-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.beigi-camp-title {
    font-size: var(--bc-t, 11px);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.beigi-camp-pct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bc-pbg, #fbbf24);
    color: var(--bc-pt, #18181b);
    font-size: var(--bc-p, 11px);
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    line-height: 1.25;
    white-space: nowrap;
}

/* تایمر فشرده یک‌تکه مخصوص کارت آرشیو */
.beigi-card-campaign-bar .bst-timer {
    font-size: var(--bc-d, 11px);
    gap: 1px;
    background: var(--bc-ub, #27272a);
    padding: 3px 6px;
    border-radius: 6px;
    line-height: 1;
}
.beigi-card-campaign-bar .bst-u {
    background: transparent;
    padding: 0;
    min-width: auto;
    border-radius: 0;
    box-shadow: none;
}
.beigi-card-campaign-bar .bst-u b {
    color: var(--bc-uc, #fbbf24);
    font-size: 1em;
}
.beigi-card-campaign-bar .bst-sep {
    margin: 0 1px;
    color: var(--bc-uc, #fbbf24);
    opacity: 0.75;
}
.beigi-card-campaign-bar.bst-urgent .bst-timer {
    background: var(--bc-ur, #ef4444);
}
.beigi-card-campaign-bar.bst-urgent .bst-u {
    background: transparent;
}
.beigi-card-campaign-bar.bst-urgent .bst-u b,
.beigi-card-campaign-bar.bst-urgent .bst-sep {
    color: #ffffff;
}

/* واکنش‌گرایی هوشمند برای کارت‌های باریک ۵ ستونه و موبایل */
@container (max-width: 230px) {
    .beigi-card-campaign-bar.bst-has-timer {
        padding: 0 6px;
        gap: 3px;
    }
    .beigi-card-campaign-bar.bst-has-timer .beigi-camp-icon {
        display: none;
    }
    .beigi-card-campaign-bar.bst-has-timer .beigi-camp-title {
        font-size: max(9.5px, calc(var(--bc-t, 11px) - 1px));
    }
    .beigi-card-campaign-bar.bst-has-timer .beigi-camp-pct {
        padding: 2px 5px;
        font-size: max(9.5px, calc(var(--bc-p, 11px) - 1px));
    }
    .beigi-card-campaign-bar.bst-has-timer .bst-timer {
        padding: 2px 5px;
        font-size: max(9.5px, calc(var(--bc-d, 11px) - 1px));
    }
}

/* ==========================================================================
   ۳. نوار تایمر برگه تکی محصول ([sale_timer]) — گردی فقط در دو گوشه بالا
   ========================================================================== */
.bst-box.bst-single {
    box-sizing: border-box;
    width: 100%;
    height: var(--bs-h, 54px);
    min-height: var(--bs-h, 54px);
    display: flex;
    align-items: center;
    gap: var(--bs-g, 10px);
    padding: 0 12px;
    margin: 0 0 var(--bs-mb, 0);
    color: var(--bs-color, #b3123a);
    font-family: inherit;
    line-height: 1;
    border-radius: var(--bs-r, 12px) var(--bs-r, 12px) 0 0;
    background: var(--bs-bg, #fff1f3);
    background: linear-gradient(90deg, var(--bs-bg, #fff1f3), color-mix(in srgb, var(--bs-bg, #fff1f3) 88%, var(--bs-color, #b3123a)));
    position: relative;
    z-index: 2;
    overflow: hidden;
}
.bst-box.bst-single.bst-solid {
    background: var(--bs-bg, #fff1f3);
}
.bst-single.bst-stack {
    flex-direction: column;
    justify-content: center;
    height: auto;
    min-height: var(--bs-h, 54px);
    padding: 8px 12px;
}
.bst-single.bst-stack.bst-rev { flex-direction: column-reverse; }
.bst-single.bst-stack.bst-al-start { align-items: flex-start; }
.bst-single.bst-stack.bst-al-center { align-items: center; }
.bst-single.bst-stack.bst-al-end { align-items: flex-end; }

.bst-single.bst-split { flex-direction: row; justify-content: space-between; }
.bst-single.bst-split:not(.bst-has-timer) { justify-content: center; }
.bst-single.bst-pack { flex-direction: row; justify-content: center; }
.bst-single.bst-pack.bst-al-start { justify-content: flex-start; }
.bst-single.bst-pack.bst-al-end { justify-content: flex-end; }
.bst-single.bst-split.bst-rev,
.bst-single.bst-pack.bst-rev { flex-direction: row-reverse; }

.bst-head {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex-shrink: 0;
}
.bst-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--bs-i, 24px);
    height: var(--bs-i, 24px);
    border-radius: 50%;
    background: var(--bs-pbg, var(--bs-color));
    color: var(--bs-pt, #ffffff);
    flex-shrink: 0;
}
.bst-icon svg {
    width: 60%;
    height: 60%;
    display: block;
}
.bst-title {
    font-size: var(--bs-t, 14px);
    font-weight: 800;
    white-space: nowrap;
    line-height: 1;
}
.bst-pct {
    font-size: var(--bs-p, 13px);
    background: var(--bs-pbg, var(--bs-color));
    color: var(--bs-pt, #ffffff);
    border-radius: 999px;
    padding: 3px 9px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
}

/* ==========================================================================
   ۴. اجزای مشترک شمارنده
   ========================================================================== */
.bst-timer {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    direction: ltr;
    unicode-bidi: isolate;
    font-size: var(--bs-d, 16px);
    flex-shrink: 0;
}
.bst-u {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 2em;
    padding: 3px 4px;
    background: var(--bs-ub, #ffffff);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.bst-nolabels .bst-u {
    flex-direction: row;
    padding: 2px 5px;
    min-width: 1.7em;
}
.bst-u b {
    font-size: 1em;
    line-height: 1.1;
    font-weight: 800;
    color: var(--bs-uc, var(--bs-color));
    font-variant-numeric: tabular-nums;
}
.bst-u i {
    font-style: normal;
    font-size: var(--bs-l, 9px);
    line-height: 1;
    font-weight: 600;
    color: var(--bs-ul, #7a5560);
    margin-top: 2px;
}
.bst-sep {
    font-weight: 800;
    opacity: 0.55;
    line-height: 1;
    margin: 0 1px;
}
.bst-nolabels .bst-u i,
.bst-nod .bst-d,
.bst-noicon .bst-icon,
.bst-noicon .beigi-camp-icon,
.bst-nopct .bst-pct,
.bst-nopct .beigi-camp-pct {
    display: none;
}

.bst-single.bst-urgent .bst-u { background: var(--bs-ur, #e11d2e); }
.bst-single.bst-urgent .bst-u b,
.bst-single.bst-urgent .bst-u i { color: #ffffff; }
.bst-single.bst-urgent .bst-icon {
    background: var(--bs-ur, #e11d2e);
    color: #ffffff;
    animation: bstp 1.2s ease-in-out infinite;
}
@keyframes bstp {
    50% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    .bst-single.bst-urgent .bst-icon { animation: none; }
}
.elementor-widget-shortcode:has(.bst-box),
.elementor-widget-shortcode:has(.beigi-card-campaign-bar) {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
}