/**
 * WP Product Timer — استایل سمت مشتری
 * سازگار با قالب Woodmart: از متغیرهای رنگ و فونت خود قالب استفاده می‌کند.
 */

.wptt-countdown-wrap {
    --wptt-accent: var(--wd-primary-color, #e63946);
    --wptt-bg: var(--wd-form-bg, #fff6f6);
    --wptt-border: rgba(0, 0, 0, 0.08);
    --wptt-text: var(--wd-text-color, #333);

    box-sizing: border-box;
    width: 100%;
    margin: 15px 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--wptt-border);
    border-radius: var(--wd-brd-radius, 8px);
    background: var(--wptt-bg);
    font-family: var(--wd-text-font, inherit);
    text-align: center;
}

.wptt-countdown-wrap * {
    box-sizing: border-box;
}

.wptt-countdown-label {
    margin-bottom: 10px;
    color: var(--wptt-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

/* --- خانه‌های تایمر --- */

.wptt-timer {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    direction: ltr; /* ترتیب روز/ساعت/دقیقه/ثانیه همیشه از چپ به راست */
}

.wptt-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 8px 6px;
    border-radius: calc(var(--wd-brd-radius, 8px) - 2px);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wptt-value {
    display: block;
    color: var(--wptt-accent);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
}

.wptt-unit-label {
    display: block;
    margin-top: 2px;
    color: var(--wptt-text);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.75;
    direction: rtl;
}

/* --- حالت کمتر از یک ساعت --- */

.wptt-countdown-wrap.wptt-urgent .wptt-value {
    animation: wptt-pulse 1s ease-in-out infinite;
}

@keyframes wptt-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .wptt-countdown-wrap.wptt-urgent .wptt-value {
        animation: none;
    }
}

/* --- پایان یافته --- */

.wptt-expired-message {
    margin: 0;
    padding: 4px 0;
    color: var(--wptt-accent);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
}

.wptt-countdown-wrap.wptt-is-expired {
    background: var(--wd-form-bg, #f5f5f5);
    opacity: 0.9;
}

/* --- بج در لیست محصولات --- */

.wptt-loop-badge {
    position: absolute;
    z-index: 3;
    inset-inline-start: 10px;
    bottom: 10px;
    padding: 4px 9px;
    border-radius: 4px;
    background: var(--wd-primary-color, #e63946);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    direction: ltr;
    font-variant-numeric: tabular-nums;
}

/* --- موبایل --- */

@media (max-width: 480px) {
    .wptt-countdown-wrap {
        padding: 12px;
    }

    .wptt-timer {
        gap: 6px;
    }

    .wptt-unit {
        min-width: 0;
        flex: 1 1 0;
        padding: 7px 4px;
    }

    .wptt-value {
        font-size: 20px;
    }

    .wptt-unit-label {
        font-size: 10px;
    }
}

/* --- سازگاری با Woodmart --- */

/* داخل سایدبار/ستون خلاصه محصول عرض کامل بگیرد */
.summary .wptt-countdown-wrap,
.wd-single-summary .wptt-countdown-wrap,
.entry-summary .wptt-countdown-wrap {
    clear: both;
}

/* در حالت تاریک قالب */
.wd-dark .wptt-countdown-wrap,
.website-wrapper.wd-dark .wptt-countdown-wrap {
    --wptt-bg: rgba(255, 255, 255, 0.06);
    --wptt-border: rgba(255, 255, 255, 0.12);
    --wptt-text: #fff;
}

.wd-dark .wptt-unit {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}
