/* =============================================================
   کمپین‌ها: جعبهٔ صفحهٔ نخست + صفحهٔ کمپین + تایمر
   رنگ هر کمپین از متغیرهای --sc-offer-bg / --sc-offer-fg می‌آید که PHP روی خود عنصر
   می‌گذارد؛ بدون آن‌ها رنگ برند است.
============================================================= */

.sc-offer,
.sc-offer-banner,
.sc-offer-hub__item {
    --sc-offer-r: calc(var(--border-radius-xl) / 2);            /* گردی قاب (هم‌اندازهٔ هیرو) */
    --sc-offer-fill: var(--sc-offer-bg, var(--brand));
    --sc-offer-ink:  var(--sc-offer-fg, var(--on-brand));
}

/* ---------- تایمر ---------- */

.sc-offer-timer {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    direction: ltr;                      /* ساعت : دقیقه : ثانیه از چپ به راست */
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.sc-offer-timer b {
    display: inline-block;
    min-width: 2.1em;
    padding: .4em .3em;
    border-radius: calc(.4rem * var(--radius-scale));
    background: var(--surface-base);
    color: var(--ink-primary);
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
}

.sc-offer-timer i { font-style: normal; font-weight: 700; opacity: .9; }
.sc-offer-timer__d { margin-inline-end: .35rem; font-weight: 700; white-space: nowrap; }
.sc-offer-timer__d[hidden] { display: none; }
.sc-offer-timer.is-ended b { opacity: .5; }

/* ---------- جعبهٔ صفحهٔ نخست ---------- */

.sc-offer-wrap {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--bkh-max, 1600px);
    margin-inline: auto;
    padding-inline: var(--bkh-gutter, var(--space-m));
    margin-block: var(--space-m);
}

.sc-offer {
    --sc-cols: 2.4;
    --sc-gap: var(--space-xs);
    position: relative;
    display: grid;
    gap: var(--space-s);
    padding: var(--space-s);
    border-radius: var(--sc-offer-r);
    background: var(--sc-offer-fill);
    color: var(--sc-offer-ink);
    min-width: 0;
}

.sc-offer[hidden] { display: none; }

/* موبایل: یک ردیف سرتیتر (عنوان، تایمر، «مشاهده همه») + ریل زیرش */
.sc-offer__side {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
}

.sc-offer__title {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 700;   /* ۸۰۰ نصب نیست و به Black ۹۰۰ می‌رفت (یک فایل فونت اضافه) */
    line-height: 1.3;
    color: inherit;
}

@media (max-width: 1023px) {
    .sc-offer-timer { gap: .15rem; }
    .sc-offer .sc-offer-timer b { min-width: 1.9em; padding: .35em .15em; font-size: .78rem; }
}

.sc-offer__poster,
.sc-offer__tagline { display: none; }

.sc-offer__more {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    color: inherit;
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.sc-offer__more svg { transform: scaleX(-1); }       /* RTL: فلش به چپ */

.sc-offer__main { position: relative; min-width: 0; }

.sc-offer .sc-item {
    padding: var(--space-xs);
    border-radius: calc(var(--sc-offer-r) * .75);
    background: var(--surface-base);
}

.sc-offer .sc-item { display: flex; flex-direction: column; }
.sc-offer .sc-card { height: auto; flex: 1; }

/* کارت «مشاهده همه» انتهای ریل */
.sc-offer .sc-item--all { padding: 0; background: transparent; }

.sc-offer__all {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    height: 100%;
    min-height: 10rem;
    padding: var(--space-s);
    border-radius: calc(var(--sc-offer-r) * .75);
    background: var(--surface-base);
    color: var(--sc-offer-fill);
    font-weight: 700;
    font-size: var(--fs-body-s);
    text-decoration: none;
    box-sizing: border-box;
}

.sc-offer__all-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.sc-offer__all-ico svg { transform: scaleX(-1); }
.sc-offer__all:hover .sc-offer__all-ico { background: var(--sc-offer-fill); border-color: var(--sc-offer-fill); color: var(--sc-offer-ink); }

@media (min-width: 768px) and (max-width: 1023px) {
    .sc-offer { --sc-cols: 3.4; }
}

/* دسکتاپ: ستون کناری (عنوان، پوستر، زیرعنوان، تایمر) + ریل */
@media (min-width: 1024px) {
    .sc-offer {
        --sc-cols: 4.4;
        --sc-title-fs: .875rem;
        --sc-price-fs: .875rem;
        --sc-meta-fs:  .75rem;
        grid-template-columns: 13.5rem minmax(0, 1fr);
        gap: var(--space-m);
        padding: var(--space-m);
    }

    .sc-offer__side {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: var(--space-s);
    }

    .sc-offer__title { font-size: var(--fs-heading-s); white-space: normal; overflow: visible; }
    .sc-offer__poster { display: block; width: min(11rem, 100%); height: auto; aspect-ratio: 1; object-fit: contain; }
    .sc-offer__tagline { display: block; margin: 0; font-size: var(--fs-body-s); font-weight: 700; }
    .sc-offer__more { display: none; }                      /* در دسکتاپ کارت انتهای ریل کافی است */
}

@media (min-width: 1440px) {
    .sc-offer { --sc-cols: 5.4; }
}

/* دکمه‌های ریل روی لبه‌های ریل می‌نشینند */
.sc-offer .sc-nav {
    position: absolute;
    inset-inline: calc(var(--space-s) * -1);
    top: 50%;
    z-index: 2;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.sc-offer .sc-nav[hidden] { display: none; }
.sc-offer .sc-nav__btn { pointer-events: auto; box-shadow: 0 2px 8px rgb(var(--shadow-rgb) / calc(.18 * var(--shadow-strength))); }

/* ---------- صفحهٔ کمپین ---------- */

.sc-offer-pagebody { padding-block: var(--space-m) var(--space-xl); }

.sc-offer-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
    padding: var(--space-m);
    margin-bottom: var(--space-m);
    border-radius: var(--sc-offer-r);
    background: var(--sc-offer-fill);
    color: var(--sc-offer-ink);
}

.sc-offer-banner__title { margin: 0; font-size: var(--fs-heading-s); font-weight: 700;   /* ۸۰۰ نصب نیست و به Black ۹۰۰ می‌رفت (یک فایل فونت اضافه) */ color: inherit; line-height: 1.3; }
.sc-offer-banner__tagline { margin: .25rem 0 0; font-weight: 600; }
.sc-offer-banner__time { display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-s); flex-wrap: wrap; font-weight: 600; }
.sc-offer-banner__poster { display: none; width: 8.5rem; height: auto; aspect-ratio: 1; object-fit: contain; }

@media (min-width: 1024px) {
    .sc-offer-banner__poster { display: block; }
}

.sc-offer-sort {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-s);
    margin-bottom: var(--space-s);
    font-size: var(--fs-body-s);
}

.sc-offer-sort a {
    padding: .3rem .8rem;
    border: 1px solid var(--gray-500);
    border-radius: var(--border-radius-full);
    color: var(--ink-primary);
    text-decoration: none;
}

.sc-offer-sort a:hover { border-color: var(--brand); color: var(--brand); }
.sc-offer-sort a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sc-offer-sort__count { margin-inline-start: auto; color: var(--ink-secondary); }

.sc-offer-pagebody .sc-section--grid { --sc-cols: 2; }
@media (min-width: 768px)  { .sc-offer-pagebody .sc-section--grid { --sc-cols: 3; } }
@media (min-width: 1024px) { .sc-offer-pagebody .sc-section--grid { --sc-cols: 5; } }
@media (min-width: 1440px) { .sc-offer-pagebody .sc-section--grid { --sc-cols: 6; } }

.sc-offer-pages { display: flex; justify-content: center; gap: .4rem; margin-top: var(--space-l); flex-wrap: wrap; }
.sc-offer-pages a {
    min-width: 2.25rem;
    padding: .4rem .7rem;
    border: 1px solid var(--gray-500);
    border-radius: calc(.5rem * var(--radius-scale));
    color: var(--ink-primary);
    text-align: center;
    text-decoration: none;
}
.sc-offer-pages a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.sc-offer-note {
    padding: var(--space-l);
    border: 1px dashed var(--gray-500);
    border-radius: var(--sc-offer-r, .75rem);
    text-align: center;
}

.sc-offer-note__btn {
    display: inline-block;
    padding: .55rem 1.4rem;
    border-radius: var(--border-radius-full);
    background: var(--brand);
    color: var(--on-brand);
    font-weight: 600;
    text-decoration: none;
}

/* ---------- فهرست کمپین‌ها (/offers/) ---------- */

.sc-offer-hub__head h1 { margin: 0 0 var(--space-m); font-size: var(--fs-heading-s); }
.sc-offer-hub { display: grid; gap: var(--space-s); margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .sc-offer-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sc-offer-hub__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-m);
    border-radius: var(--sc-offer-r);
    background: var(--sc-offer-fill);
    color: var(--sc-offer-ink);
}

.sc-offer-hub__link { display: grid; gap: .2rem; color: inherit; text-decoration: none; }
.sc-offer-hub__title { font-size: var(--fs-heading-xs); font-weight: 700;   /* ۸۰۰ نصب نیست و به Black ۹۰۰ می‌رفت (یک فایل فونت اضافه) */ }
.sc-offer-hub__tag, .sc-offer-hub__meta { font-size: var(--fs-body-s); opacity: .92; }


/* لینک‌ها: رنگ قالب (آبی) نباید بر رنگ کمپین غلبه کند */
.sc-offer .sc-offer__more,
.sc-offer .sc-offer__more:visited,
.sc-offer .sc-offer__more:hover,
.sc-offer .sc-offer__more:focus { color: var(--sc-offer-ink); text-decoration: none; }
.sc-offer .sc-offer__more:hover { text-decoration: underline; }
.sc-offer .sc-offer__all,
.sc-offer .sc-offer__all:visited,
.sc-offer .sc-offer__all:focus { color: var(--sc-offer-fill); text-decoration: none; }
.sc-offer .sc-offer__all:hover { color: var(--sc-offer-fill); }
.sc-offer .sc-offer__all:hover .sc-offer__all-ico { color: var(--sc-offer-ink); }
