/* Vatan Woo Discount Engine — frontend campaign badge + card sale price */
.wde-discount-badge{
    position:absolute;z-index:12;top:12px;right:12px;display:inline-flex;
    align-items:center;justify-content:center;gap:5px;max-width:calc(100% - 24px);
    background:var(--wde-badge-bg,#ff174f);color:var(--wde-badge-color,#fff);
    box-sizing:border-box;white-space:nowrap;direction:rtl;line-height:1.15;
    font-weight:500;pointer-events:none;box-shadow:none;
}
.wde-badge-loop{min-height:24px;padding:5px 8px;font-size:10.5px;border-radius:8px}
.wde-badge-single{top:24px;right:24px;min-height:42px;padding:10px 15px;gap:8px;font-size:16px;border-radius:12px}
.wde-badge-icon{display:block;width:14px;height:14px;flex:0 0 14px;background:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain}
.wde-badge-single .wde-badge-icon{width:22px;height:22px;flex-basis:22px}
.wde-badge-text{display:block;overflow:hidden;text-overflow:ellipsis}

.wd-product .product-element-top,.product-grid-item .product-element-top,.wd-product .product-image-link,.product-grid-item .product-image-link,.woocommerce-product-gallery,.wd-gallery-images{position:relative}

/* Never show WoodMart/Woo's own -N% image badge for WDE campaign products. */
.wde-discounted-product .product-labels .onsale.product-label,
.wde-discounted-product .product-label.onsale{display:none!important}

/* CARD PRICE — Digikala-like: percent beside old price, final price below. */
.wd-product .price .wde-price-stack,.product-grid-item .price .wde-price-stack{
    display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
    gap:2px;direction:rtl;line-height:1.15;vertical-align:middle;color:#111!important;
}
.wd-product .price .price.wde-price-wrap,.product-grid-item .price .price.wde-price-wrap{display:contents}

.wd-product .wde-original-row,.product-grid-item .wde-original-row{
    display:inline-flex;flex-direction:row;direction:rtl;align-items:center;justify-content:flex-start;
    gap:5px;white-space:nowrap;min-height:18px;
}
.wd-product .wde-original-price,.product-grid-item .wde-original-price{
    display:inline-flex;margin:0;padding:0;color:#9a9a9a!important;opacity:1;font-size:.72em;
    font-weight:400;line-height:1.05;text-decoration-line:line-through!important;
    text-decoration-thickness:1px!important;text-decoration-color:#9a9a9a!important;white-space:nowrap;
}
.wd-product .wde-original-price .amount,.product-grid-item .wde-original-price .amount{
    color:#9a9a9a!important;font-size:inherit!important;font-weight:inherit!important;
}
.wd-product .wde-original-price .custom-toman-icon,.product-grid-item .wde-original-price .custom-toman-icon{width:11px;height:11px;fill:#9a9a9a!important}

.wd-product .wde-percent-chip,.product-grid-item .wde-percent-chip{
    display:inline-flex;flex-direction:row;direction:rtl;align-items:center;justify-content:center;gap:1px;
    min-width:31px;min-height:20px;padding:2px 6px;border-radius:7px;background:var(--wde-sale-bg,#ff174f);
    color:var(--wde-sale-fg,#fff)!important;font-size:10px;font-weight:700;line-height:1;box-sizing:border-box;
}
.wd-product .wde-percent-number,.product-grid-item .wde-percent-number{order:1}
.wd-product .wde-percent-sign,.product-grid-item .wde-percent-sign{order:2}

.wd-product .wde-final-row,.product-grid-item .wde-final-row{
    display:inline-flex;align-items:center;justify-content:flex-start;direction:rtl;white-space:nowrap;
}
.wd-product .wde-final-price,.product-grid-item .wde-final-price{
    display:inline-flex;margin:0;padding:0;color:#111!important;font-size:1em;font-weight:inherit;
    line-height:1.15;text-decoration:none!important;background:none!important;white-space:nowrap;
}
.wd-product .wde-final-price .amount,.product-grid-item .wde-final-price .amount{
    color:#111!important;font-size:inherit!important;font-weight:inherit!important;
}
.wd-product .wde-final-price .custom-toman-icon,.product-grid-item .wde-final-price .custom-toman-icon{fill:#111!important}

@media (max-width:767px){
    .wde-badge-loop{top:9px;right:9px;min-height:22px;padding:4px 7px;font-size:10px;border-radius:7px;gap:4px}
    .wde-badge-loop .wde-badge-icon{width:13px;height:13px;flex-basis:13px}
    .wde-badge-single{top:14px;right:14px;min-height:36px;padding:8px 11px;font-size:13px;border-radius:10px;gap:6px}
    .wde-badge-single .wde-badge-icon{width:18px;height:18px;flex-basis:18px}
    .wd-product .wde-original-row,.product-grid-item .wde-original-row{gap:4px}
    .wd-product .wde-percent-chip,.product-grid-item .wde-percent-chip{min-width:29px;min-height:19px;padding:2px 5px;font-size:9.5px;border-radius:6px}
}

/* 2.2.8 — single product: compact badge + Digikala-like price row */
.single-product .woocommerce-product-gallery,
.single-product .wd-gallery-images,
.single-product .product-images{position:relative!important}
.single-product .wde-badge-single{
    top:14px;right:14px;min-height:28px;padding:6px 9px;gap:5px;
    font-size:11px;border-radius:8px;font-weight:600;
}
.single-product .wde-badge-single .wde-badge-icon{width:15px;height:15px;flex-basis:15px}
.single-product .summary .price .wde-price-stack{
    display:inline-flex;flex-direction:column;align-items:flex-start;gap:3px;
    direction:rtl;line-height:1.2;color:#111!important;
}
.single-product .summary .wde-original-row{
    display:inline-flex;flex-direction:row;direction:rtl;align-items:center;gap:7px;white-space:nowrap;
}
.single-product .summary .wde-original-price{
    display:inline-flex;margin:0;color:#999!important;font-size:.72em;font-weight:400;
    text-decoration:line-through!important;text-decoration-color:#999!important;background:none!important;
}
.single-product .summary .wde-original-price .amount{color:#999!important;font-size:inherit!important;font-weight:inherit!important}
.single-product .summary .wde-percent-chip{
    display:inline-flex;direction:rtl;align-items:center;justify-content:center;gap:1px;
    min-width:34px;min-height:21px;padding:3px 6px;border-radius:7px;
    background:var(--wde-sale-bg,#ff174f);color:var(--wde-sale-fg,#fff)!important;
    font-size:10px;font-weight:700;line-height:1;box-sizing:border-box;
}
.single-product .summary .wde-percent-number{order:1}.single-product .summary .wde-percent-sign{order:2}
.single-product .summary .wde-final-row{display:inline-flex;direction:rtl;align-items:center}
.single-product .summary .wde-final-price,
.single-product .summary .wde-final-price .amount{color:#111!important;text-decoration:none!important;background:none!important}
@media(max-width:767px){
    .single-product .wde-badge-single{top:10px;right:10px;min-height:24px;padding:5px 7px;font-size:10px;border-radius:7px}
    .single-product .wde-badge-single .wde-badge-icon{width:13px;height:13px;flex-basis:13px}
}

/* ========================================
   WDE – Real Admin Preview Page
======================================== */
.wde-real-preview-page .wde-real-preview-shell{width:min(1440px,calc(100% - 40px));margin:32px auto 60px}.wde-real-preview-topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px;padding:16px 18px;border:1px solid #e8e8e8;border-radius:14px;background:#fff}.wde-real-preview-topbar>div{display:flex;flex-direction:column;gap:4px}.wde-real-preview-topbar strong{font-size:17px}.wde-real-preview-topbar span{font-size:12px;color:#777}.wde-real-preview-refresh{white-space:nowrap}.wde-real-preview-single,.wde-real-preview-loop{margin-top:26px}.wde-real-preview-single>h2,.wde-real-preview-loop>h2{font-size:18px;margin:0 0 16px}.wde-real-preview-single-inner{padding:18px;border:1px solid #ececec;border-radius:16px;background:#fff}.wde-real-preview-loop .products{margin-top:0}.wde-real-preview-empty{padding:28px;border:1px dashed #d8d8d8;border-radius:14px;background:#fff;text-align:center}.wde-real-preview-page .wde-real-preview-loop .products{--wd-col:5}
@media(max-width:1024px){.wde-real-preview-page .wde-real-preview-loop .products{--wd-col:3}.wde-real-preview-topbar{align-items:flex-start;flex-direction:column}.wde-real-preview-refresh{white-space:normal}}
@media(max-width:767px){.wde-real-preview-page .wde-real-preview-shell{width:min(100% - 24px,1440px)}.wde-real-preview-page .wde-real-preview-loop .products{--wd-col:2}.wde-real-preview-single-inner{padding:10px}}

/* ========================================
   WDE – Campaign Countdown Timer
======================================== */
.wde-countdown{display:block!important;box-sizing:border-box;background:var(--wde-timer-bg,#e31b23);color:var(--wde-timer-color,#fff);font-family:inherit;line-height:1;z-index:14;overflow:hidden}
.wde-timer-inner{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;height:100%;min-width:0;white-space:nowrap;flex-wrap:nowrap;direction:ltr}
.wde-timer-icon{order:1;display:flex;align-items:center;justify-content:center;align-self:center;flex:0 0 22px;width:22px;height:22px;margin:0;padding:0;line-height:0}
.wde-timer-icon img{display:block;width:22px;height:22px;max-width:none;object-fit:contain;margin:0;padding:0}
.wde-timer-clock{order:2;display:inline-flex;align-items:center;justify-content:center;gap:5px;direction:ltr;flex:0 0 auto;white-space:nowrap;height:100%}
.wde-timer-text{order:3;display:block;flex:0 1 auto;min-width:0;max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700;color:inherit;direction:rtl;text-align:right;line-height:1.35}
.wde-time-unit{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:27px;gap:2px;color:inherit}
.wde-time-unit b{display:block;font-size:15px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums;color:inherit}
.wde-time-unit small{display:block;font-size:7px;font-weight:500;line-height:1;color:inherit;opacity:.95;white-space:nowrap}
.wde-time-sep{display:block;font-style:normal;font-size:15px;font-weight:700;line-height:1;margin-top:-8px;color:inherit}
.wde-countdown.wde-no-days .wde-time-days,.wde-countdown.wde-no-days .wde-time-days + .wde-time-sep{display:none}

/* Archive card: overlay inside the image; campaign title is intentionally hidden. */
.wd-product .product-element-top,.product-grid-item .product-element-top{position:relative}
.wd-product .product-element-top>.wde-timer-loop,.product-grid-item .product-element-top>.wde-timer-loop{position:absolute;left:8px;right:8px;bottom:8px;width:auto;height:42px;padding:5px 9px;border-radius:9px;pointer-events:none}
.wde-timer-loop .wde-timer-text{display:none!important}
.wde-timer-loop .wde-timer-inner{width:max-content;max-width:100%;margin-inline:auto}

/* Single product: top of Vatan's left buying column. Icon left, clock center, title right. */
.single-product .wde-timer-single{position:relative;width:100%;max-width:none;height:48px;min-height:48px;padding:6px 12px;border-radius:10px;margin:0 0 14px 0;pointer-events:none}
.single-product .wde-timer-single .wde-timer-text{font-size:12px;max-width:38%}
.single-product .wde-timer-single .wde-time-unit{min-width:31px}
.single-product .wde-timer-single .wde-time-unit b{font-size:17px}
.single-product .wde-timer-single .wde-time-unit small{font-size:8px}
.single-product .wde-timer-single .wde-time-sep{font-size:17px}
.wde-single-timer-fallback{display:none!important}

@media(max-width:767px){
    .wd-product .product-element-top>.wde-timer-loop,.product-grid-item .product-element-top>.wde-timer-loop{left:5px;right:5px;bottom:5px;height:39px;padding:4px 6px;border-radius:8px}
    .wde-timer-inner{gap:6px}
    .wde-timer-icon{flex-basis:20px;width:20px;height:20px}
    .wde-timer-icon img{width:20px;height:20px}
    .wde-timer-clock{gap:3px}
    .wde-time-unit{min-width:23px;gap:2px}
    .wde-time-unit b{font-size:13px}
    .wde-time-unit small{font-size:6.5px}
    .wde-time-sep{font-size:13px;margin-top:-7px}
    .single-product .wde-timer-single{height:46px;min-height:46px;padding:5px 9px}
    .single-product .wde-timer-single .wde-timer-inner{gap:5px}
    .single-product .wde-timer-single .wde-timer-text{display:block;font-size:10px;max-width:30%;line-height:1.25}
    .single-product .wde-timer-single .wde-timer-icon{flex-basis:20px;width:20px;height:20px}
    .single-product .wde-timer-single .wde-timer-icon img{width:20px;height:20px}
    .single-product .wde-timer-single .wde-timer-clock{gap:2px}
    .single-product .wde-timer-single .wde-time-unit{min-width:23px;gap:2px}
    .single-product .wde-timer-single .wde-time-unit b{font-size:13px}
    .single-product .wde-timer-single .wde-time-unit small{font-size:6.5px}
    .single-product .wde-timer-single .wde-time-sep{font-size:13px;margin-top:-7px}
}
@media(max-width:390px){
    .single-product .wde-timer-single{padding-inline:7px}
    .single-product .wde-timer-single .wde-timer-inner{gap:4px}
    .single-product .wde-timer-single .wde-timer-text{font-size:9px;max-width:28%}
    .single-product .wde-timer-single .wde-time-unit{min-width:21px}
}

\n\n/* ========================================
   WDE 2.2.29 – Live Timer UI Refinement
======================================== */

/* Product-card timer: slimmer bar and lighter numerals. */
.wd-product .product-element-top>.wde-timer-loop,
.product-grid-item .product-element-top>.wde-timer-loop{
    height:32px;
    padding:3px 7px;
    border-radius:8px;
}
.wde-timer-loop .wde-timer-inner{gap:6px}
.wde-timer-loop .wde-timer-icon,
.wde-timer-loop .wde-timer-icon img{
    width:18px;
    height:18px;
}
.wde-timer-loop .wde-timer-icon{flex-basis:18px}
.wde-timer-loop .wde-timer-clock{gap:3px}
.wde-timer-loop .wde-time-unit{min-width:23px;gap:1px}
.wde-timer-loop .wde-time-unit b{
    font-size:13px;
    font-weight:600;
}
.wde-timer-loop .wde-time-unit small{
    font-size:6px;
    font-weight:400;
}
.wde-timer-loop .wde-time-sep{
    font-size:13px;
    font-weight:500;
    margin-top:-6px;
}

@media(max-width:767px){
    /* Card remains compact on mobile too. */
    .wd-product .product-element-top>.wde-timer-loop,
    .product-grid-item .product-element-top>.wde-timer-loop{
        height:30px;
        padding:3px 5px;
    }
    .wde-timer-loop .wde-timer-inner{gap:4px}
    .wde-timer-loop .wde-timer-icon,
    .wde-timer-loop .wde-timer-icon img{
        width:17px;
        height:17px;
    }
    .wde-timer-loop .wde-timer-icon{flex-basis:17px}
    .wde-timer-loop .wde-time-unit{min-width:21px}
    .wde-timer-loop .wde-time-unit b{font-size:12px;font-weight:600}
    .wde-timer-loop .wde-time-unit small{font-size:5.8px;font-weight:400}
    .wde-timer-loop .wde-time-sep{font-size:12px;font-weight:500;margin-top:-6px}

    /* Single-product campaign title: deliberately larger and clearer on phone. */
    .single-product .wde-timer-single .wde-timer-text{
        display:block!important;
        font-size:12px;
        font-weight:700;
        line-height:1.2;
        max-width:36%;
        overflow:hidden;
        text-overflow:ellipsis;
    }
}

@media(max-width:390px){
    .single-product .wde-timer-single .wde-timer-text{
        font-size:11.5px;
        max-width:35%;
    }
}

/* ========================================
   WDE 2.2.30 – Single Alignment + Final Zero State
======================================== */

/* Single product only:
   campaign title + icon stay together on the RIGHT,
   countdown clock stays on the LEFT. */
.single-product .wde-timer-single .wde-timer-inner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    direction:ltr;
    gap:12px;
}

.single-product .wde-timer-single .wde-timer-clock{
    order:1;
    flex:0 0 auto;
    justify-content:flex-start;
}

.single-product .wde-timer-single .wde-timer-title-group{
    order:2;
    display:inline-flex;
    align-items:center;
    justify-content:flex-end;
    flex:0 1 auto;
    min-width:0;
    gap:6px;
    direction:rtl;
    text-align:right;
    margin-left:auto;
}

.single-product .wde-timer-single .wde-timer-title-group .wde-timer-icon{
    order:2;
    flex:0 0 22px;
    width:22px;
    height:22px;
}

.single-product .wde-timer-single .wde-timer-title-group .wde-timer-icon img{
    width:22px;
    height:22px;
}

.single-product .wde-timer-single .wde-timer-title-group .wde-timer-text{
    order:1;
    display:block!important;
    max-width:none;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:right;
    direction:rtl;
}

/* Archive/card timer remains centered because it has no campaign title. */
.wde-timer-loop .wde-timer-inner{
    justify-content:center!important;
}

/* When the live countdown reaches zero, keep 00:00:00:00 visible.
   On the next page refresh PHP no longer renders the expired timer. */
.wde-countdown.wde-timer-expired .wde-time-days,
.wde-countdown.wde-timer-expired .wde-time-days + .wde-time-sep{
    display:inline-flex!important;
}

@media(max-width:767px){
    .single-product .wde-timer-single .wde-timer-inner{
        gap:7px;
    }

    .single-product .wde-timer-single .wde-timer-title-group{
        gap:5px;
    }

    .single-product .wde-timer-single .wde-timer-title-group .wde-timer-icon{
        flex-basis:20px;
        width:20px;
        height:20px;
    }

    .single-product .wde-timer-single .wde-timer-title-group .wde-timer-icon img{
        width:20px;
        height:20px;
    }

    .single-product .wde-timer-single .wde-timer-title-group .wde-timer-text{
        font-size:12px!important;
        font-weight:700;
        line-height:1.2;
    }
}
\n\n/* ========================================
   WDE 2.2.31 – Single Timer Final Alignment
   آیکون چپ، شمارش کنار آن، عنوان راست با حاشیه امن
======================================== */
.single-product .wde-timer-single{
    padding-inline:14px!important;
}
.single-product .wde-timer-single .wde-timer-inner{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    direction:ltr!important;
    gap:8px!important;
    width:100%!important;
}
.single-product .wde-timer-single .wde-timer-icon{
    order:1!important;
    flex:0 0 22px!important;
    width:22px!important;
    height:22px!important;
    margin:0!important;
}
.single-product .wde-timer-single .wde-timer-icon img{
    width:22px!important;
    height:22px!important;
}
.single-product .wde-timer-single .wde-timer-clock{
    order:2!important;
    flex:0 0 auto!important;
    justify-content:flex-start!important;
    margin:0!important;
}
.single-product .wde-timer-single .wde-timer-text{
    order:3!important;
    display:block!important;
    margin-left:auto!important;
    min-width:0!important;
    max-width:40%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    direction:rtl!important;
    text-align:right!important;
}
@media(max-width:767px){
    .single-product .wde-timer-single{
        padding-inline:12px!important;
    }
    .single-product .wde-timer-single .wde-timer-inner{
        gap:5px!important;
    }
    .single-product .wde-timer-single .wde-timer-icon{
        flex-basis:20px!important;
        width:20px!important;
        height:20px!important;
    }
    .single-product .wde-timer-single .wde-timer-icon img{
        width:20px!important;
        height:20px!important;
    }
    .single-product .wde-timer-single .wde-timer-text{
        max-width:34%!important;
        font-size:12px!important;
        font-weight:700!important;
    }
}
