:root {
    --cst-bg: #ffffff;
    --cst-text: #1a1a1a;
    --cst-label: #6b7280;
    --cst-separator: #d1d5db;
    --cst-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08);
    --cst-border: 1px solid rgba(0, 0, 0, 0.05);
    --cst-radius: 12px;

    /* متغیرهای وضعیت‌های اضطراری */
    --cst-warning-glow: rgba(245, 158, 11, 0.3);
    --cst-danger-color: #ef4444;
    --cst-danger-glow: rgba(239, 68, 68, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root {
        --cst-bg: #1f2937;
        --cst-text: #f9fafb;
        --cst-label: #9ca3af;
        --cst-separator: #4b5563;
        --cst-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
        --cst-border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* کانتینر اصلی کاملاً راست‌چین */
.cantabella-sale-timer-wrapper {
    display: flex;
    justify-content: flex-start;
    margin: 1.5rem 0;
    direction: rtl;
    font-family:"IRANYekanXFaNum", sans-serif
;
}

/* باکس تایمر */
.cantabella-sale-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    direction: ltr;
    /* جهت نمایش اعداد از چپ به راست برای ساختار دیجیتالی تایمر */
    transition: all 0.4s ease;
}

/* بلوک‌های حاوی زمان */
.cst-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.5rem;
}

.cst-num {
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1;
    color: #0171F1 !important;
    letter-spacing: -0.02em !important;
}

.cst-label {
    font-size: 0.50rem;
    color: var(--cst-label);
    margin-top: 0.35rem;
    font-weight: 500;
    direction: rtl;
    /* متن برچسب‌ها به صورت راست‌چین */
}

.cst-separator {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--cst-separator);
    margin-bottom: 0.65rem;
    /* تراز نوری دونقطه تفکیک‌کننده */
}

/* استایل پیام انقضای تخفیف */
.cantabella-sale-expired {
    background: var(--cst-bg);
    color: var(--cst-danger-color);
    padding: 1rem 1.5rem;
    border-radius: var(--cst-radius);
    box-shadow: var(--cst-shadow);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-align: center;
}

/* انیمیشن تغییر عدد ثانیه */
@keyframes cst-flip {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cst-anim-flip.trigger {
    animation: cst-flip 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* افکت پالس برای زمان کمتر از ۱ ساعت */
@keyframes cst-pulse {
    0% {
        box-shadow: 0 0 0 0 var(--cst-warning-glow);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.cantabella-sale-timer.is-pulsing {
    animation: cst-pulse 2s infinite;
}

/* افکت رنگ قرمز اخطار برای زمان کمتر از ۳۰ دقیقه */
.cantabella-sale-timer.is-danger {
    animation: none;
    box-shadow: 0 0 20px var(--cst-danger-glow);
    border-color: rgba(239, 68, 68, 0.3);
}

.cantabella-sale-timer.is-danger .cst-num {
    color: var(--cst-danger-color);
}

/* بهینه‌سازی رسپانسیو در موبایل */
@media (max-width: 480px) {
    .cantabella-sale-timer {
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: space-between;
    }

    .cst-block {
        min-width: 2.8rem;
    }

    .cst-num {
        font-size: 1.4rem;
    }

    .cst-label {
        font-size: 0.7rem;
    }
}