@property --black-friday-coupon-edge {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.black-friday-offers {
    --offer-surface: #e8d6d0;
    --offer-card: #fbf4f0;
    --offer-ink: #311a1e;
    --offer-accent: #a91936;
    --offer-muted: #72565a;
    --offer-rule: #dcbeb9;
    container-type: inline-size;
    margin-bottom: 20px;
    border: 1px solid #d5b3ae;
    border-radius: 16px;
    background-color: var(--offer-surface);
    background-image: linear-gradient(106deg, transparent 42%, rgba(237, 137, 156, 0.15) 50%, transparent 58%);
    background-position: right center;
    background-repeat: no-repeat;
    background-size: 250% 100%;
    animation: black-friday-coupon-shimmer 10s ease-in-out infinite;
    color: var(--offer-ink);
}

.black-friday-offers .black-friday-header {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 18px 24px 17px;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(115deg, #861630, #5e1329 70%, #431c2a);
    color: #fff5f1;
}

.black-friday-offers .black-friday-header::after {
    position: absolute;
    z-index: -1;
    inset-block: 0;
    inset-inline-start: 0;
    width: 44%;
    border-start-start-radius: 16px;
    background: repeating-linear-gradient(135deg, transparent 0 10px, #ffd9bb2c 10px 11px);
    mask-image: linear-gradient(to left, #000, transparent);
    content: "";
    pointer-events: none;
}

.black-friday-offers .black-friday-deal p {
    margin: 0;
    font-family: "iranyekanbold", sans-serif;
    font-size: clamp(12px, 1.45cqi, 15px);
    line-height: 1.55;
}

.black-friday-offers .black-friday-max-discount {
    white-space: nowrap;
}

.black-friday-offers .black-friday-max-discount strong {
    display: inline-block;
    padding-inline: 2px;
    color: #ffe7ae;
    font-size: clamp(29px, 4.8cqi, 50px);
    line-height: 1;
    -webkit-text-stroke: 0.65px currentColor;
    text-shadow: 0 2px 1px #381020a0, 0 0 16px #ffc66b4d;
}

.black-friday-offers .black-friday-title {
    margin: 0;
    color: #fff5f1;
    font: 950 clamp(27px, 6cqi, 54px)/0.98 "Arial Black", Arial, sans-serif;
    letter-spacing: -0.068em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: no-preference) {
    @supports (background-clip: text) {
        .black-friday-offers .black-friday-title {
            background-image: linear-gradient(105deg, #fff5f1 42%, #ffd68a 49%, #fff8df 52%, #fff5f1 59%);
            background-position: right center;
            background-size: 245% 100%;
            background-clip: text;
            color: transparent;
            animation: black-friday-title-glint 4.6s ease-in-out infinite;
        }
    }
}

.black-friday-offers .black-friday-group-title {
    margin: 0;
    padding: 2px 18px 6px;
    color: var(--offer-ink);
    font: 700 13px/1.65 iranyekanbold, sans-serif;
}

.black-friday-offers .black-friday-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding: 4px 18px 18px;
}

.black-friday-offers .item {
    position: relative;
    display: grid;
    grid-template-rows: 1fr 1fr;
    min-width: 0;
    min-height: 172px;
    border: 1px solid var(--offer-rule);
    border-radius: 11px;
    background: var(--offer-card);
    text-align: center;
    cursor: pointer;
}

.black-friday-offers .item:hover,
.black-friday-offers .item.active {
    border-color: var(--offer-accent);
}

.black-friday-offers .item:focus-visible {
    outline: 2px solid var(--offer-accent);
    outline-offset: 2px;
}

@supports (mask-composite: exclude) {
    .black-friday-offers .item::before {
        position: absolute;
        inset: 0;
        padding: 1px;
        border-radius: inherit;
        background: conic-gradient(
            from var(--black-friday-coupon-edge),
            transparent 0deg 225deg,
            rgba(208, 78, 101, 0.12) 261deg,
            rgba(208, 78, 101, 0.48) 295deg,
            transparent 335deg
        );
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask-composite: exclude;
        pointer-events: none;
        animation: black-friday-coupon-border 12s linear infinite;
        content: "";
    }

    .black-friday-offers .item:nth-child(even)::before {
        animation-delay: -5s;
    }
}

.black-friday-offers .item.active {
    background: #f9eeea;
    box-shadow: inset 0 0 0 1px var(--offer-accent);
}

.black-friday-offers .black-friday-card-top,
.black-friday-offers .black-friday-card-bottom {
    display: grid;
    align-content: center;
    justify-items: center;
    row-gap: 4px;
    min-width: 0;
    padding: 8px;
}

.black-friday-offers .black-friday-card-top {
    position: relative;
    padding-inline: 12px;
    border-block-end: 1px dashed var(--offer-rule);
}

.black-friday-offers .black-friday-card-bottom {
    container-type: inline-size;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    column-gap: 3px;
}

.black-friday-offers .black-friday-card-bottom .black-friday-discount {
    grid-row: 1;
    grid-column: 1;
    padding-inline: 4px;
    font-size: clamp(8px, 5.8cqi, 11px);
}

.black-friday-offers .black-friday-discount {
    justify-self: start;
    padding: 2px 8px;
    border-radius: 4px;
    background: #951d39;
    color: #fff8f5;
    font-family: "iranyekanbold", sans-serif;
    font-size: 11px;
    line-height: 2;
    white-space: nowrap;
    animation: black-friday-discount-pulse 5.6s ease-out infinite;
}

.black-friday-offers .item:nth-child(even) .black-friday-discount {
    animation-delay: -2.8s;
}

.black-friday-offers .number,
.black-friday-offers .price,
.black-friday-offers .trunk-discount-countdown {
    margin: 0;
}

.black-friday-offers .number {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
    color: var(--offer-ink);
    direction: ltr;
    font-family: "iranyekanbold", sans-serif;
    font-size: clamp(20px, 3.1cqi, 26px);
    line-height: 1.35;
}

.black-friday-offers .number > span {
    display: inline-block;
}

.black-friday-offers .item.gold {
    --tier-background: #f3e8cd;
    --tier-color: #815d1d;
    --number-solid: #e8b731;
    --number-rim: #98600a;
    --number-light: #fff3a0;
    --number-edge: #be7d11;
    --number-depth: #88440d;
    --number-prefix: #a5741b;
    --number-shine: #fff5b6ad;
    --number-face: linear-gradient(175deg, #fff1a0 0%, #f9dc65 24%, #eaba35 49%, #f5d05b 68%, #d8971b 100%);
}

.black-friday-offers .item.silver {
    --tier-background: #e8edf3;
    --tier-color: #566778;
    --number-solid: #98a5b4;
    --number-rim: #536173;
    --number-light: #e1e7ee;
    --number-edge: #78899d;
    --number-depth: #4e5e72;
    --number-prefix: #637285;
    --number-shine: #dce4ed26;
    --number-stroke: 0.45px;
    --number-shadow: drop-shadow(0 0.5px 0 var(--number-edge)) drop-shadow(0 1px 0 var(--number-depth));
    --number-face: linear-gradient(175deg, #b6c1cd 0%, #a6b3c2 24%, #8595a8 49%, #b0bdcc 68%, #7d8fa4 100%);
}

.black-friday-offers .item.bronze {
    --tier-background: #efe1d6;
    --tier-color: #82532f;
    --number-solid: #c98a57;
    --number-rim: #7b431f;
    --number-light: #ffe2b9;
    --number-edge: #a96535;
    --number-depth: #6f381d;
    --number-prefix: #93603b;
    --number-shine: #ffe1b6ad;
    --number-face: linear-gradient(175deg, #f2cc9c 0%, #dba46c 24%, #b77543 49%, #e4b27e 68%, #a76136 100%);
}

.black-friday-offers .black-friday-tier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    padding: 0 5px;
    border: 1px solid #00000009;
    border-radius: 5px;
    background: var(--tier-background, #ede9e7);
    color: var(--tier-color, #645b59);
    font-size: 11px;
    line-height: 1.8;
}

.black-friday-offers .black-friday-tier:empty {
    display: none;
}

.black-friday-offers .item:is(.gold, .silver, .bronze) .number > span {
    color: var(--number-solid);
    -webkit-text-stroke: var(--number-stroke, 0.35px) var(--number-rim);
    text-shadow: 0 -0.5px 0 var(--number-light), 0 1px 0 var(--number-edge), 0 2px 0 var(--number-depth);
}

@supports (background-clip: text) {
    .black-friday-offers .item:is(.gold, .silver, .bronze) .number > span {
        background-image:
            radial-gradient(ellipse at 30% 22%, var(--number-shine), transparent 55%),
            var(--number-face);
        background-clip: text;
        color: transparent;
        text-shadow: none;
        filter: var(--number-shadow, drop-shadow(0 1px 0 var(--number-edge)) drop-shadow(0 1px 0 var(--number-depth)) drop-shadow(1px 2px 0.75px #30231c30));
    }
}

.black-friday-offers .number small {
    color: var(--offer-muted);
}

.black-friday-offers .item:is(.gold, .silver, .bronze) .number small {
    color: var(--number-prefix);
    text-shadow: 0 -0.5px 0 var(--number-light), 0 0.5px 0 var(--number-depth);
}

.black-friday-offers .black-friday-card-top::before,
.black-friday-offers .black-friday-card-top::after {
    position: absolute;
    bottom: -5px;
    width: 6px;
    height: 10px;
    border: 1px solid var(--offer-rule);
    background: var(--offer-surface);
    content: "";
    pointer-events: none;
}

.black-friday-offers .black-friday-card-top::before {
    left: -1px;
    border-left: 0;
    border-radius: 0 6px 6px 0;
}

.black-friday-offers .black-friday-card-top::after {
    right: -1px;
    border-right: 0;
    border-radius: 6px 0 0 6px;
}

.black-friday-offers .price {
    color: var(--offer-muted);
    font-size: 12px;
}

.black-friday-offers .number small {
    font-size: 12px;
}

.black-friday-offers .price {
    padding-inline: 5px;
    line-height: 1.4;
}

.black-friday-offers .sell-price s {
    font-size: clamp(10px, 6.8cqi, 14px);
    text-decoration-color: var(--offer-accent);
}

.black-friday-offers .sell-price {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    padding-inline: 0;
}

.black-friday-offers .real-price {
    grid-row: 1;
    grid-column: 3;
    align-self: center;
    justify-self: end;
    padding-inline: 0;
}

.black-friday-offers .real-price .numberFormat {
    color: var(--offer-accent);
    font-family: "iranyekanbold", sans-serif;
    font-size: clamp(12px, 9cqi, 18px);
    white-space: nowrap;
}

@container (max-width: 650px) {
    .black-friday-offers .black-friday-header {
        padding: 18px 16px 15px;
    }

    .black-friday-offers .black-friday-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 4px 12px 12px;
    }

    .black-friday-offers .black-friday-group-title {
        padding-inline: 12px;
    }

    .black-friday-offers .black-friday-card-top {
        padding-inline: 8px;
    }
}

@container (max-width: 310px) {
    .black-friday-offers .black-friday-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .black-friday-offers .black-friday-cards {
        grid-template-columns: 1fr;
    }
}

.black-friday-offers .trunk-discount-countdown:empty {
    display: none;
}

.black-friday-offers .trunk-discount-countdown {
    grid-column: 1 / -1;
}

.black-friday-offers .trunk-discount-countdown ul {
    align-items: center;
    gap: 3px;
    margin: 1px 0 0;
    padding: 0;
}

.black-friday-offers .trunk-discount-countdown li {
    display: flex;
    align-items: center;
    gap: 3px;
}

.black-friday-offers .trunk-discount-countdown ul li span:is(.hours, .minutes, .seconds) {
    position: relative;
    display: grid;
    place-items: center;
    width: auto;
    min-width: 27px;
    min-height: 27px;
    margin: 0;
    padding: 0 4px;
    background: #fff;
    border: 1px solid #e8bfc7;
    color: #492531;
    font-family: "iranyekanbold", sans-serif;
    font-size: 14px;
    line-height: 1;
    perspective: 100px;
    animation: black-friday-timer-pulse 2.4s ease-in-out infinite;
}

.black-friday-offers .trunk-discount-countdown ul li span.minutes {
    animation-delay: 0.15s;
}

.black-friday-offers .trunk-discount-countdown ul li span.seconds {
    animation-delay: 0.3s;
}

.black-friday-offers .trunk-discount-countdown .countdown-flap {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: inherit;
    background: inherit;
    clip-path: inset(0 0 50%);
    pointer-events: none;
}

.black-friday-offers .trunk-discount-countdown .countdown-flap-lower {
    clip-path: inset(50% 0 0);
}

.black-friday-offers .trunk-discount-countdown .seprator {
    color: var(--offer-accent);
    line-height: 1;
}

@keyframes black-friday-coupon-border {
    to {
        --black-friday-coupon-edge: 360deg;
    }
}

@keyframes black-friday-coupon-shimmer {
    0%, 15% {
        background-position: right center;
    }

    65%, 100% {
        background-position: left center;
    }
}

@keyframes black-friday-title-glint {
    0%, 12% { background-position: right center; }
    32%, 100% { background-position: left center; }
}

@keyframes black-friday-discount-pulse {
    0%, 66%, 100% { box-shadow: 0 0 0 0 #951d3900; }
    77% { box-shadow: 0 0 0 3px #951d393b; }
}

@keyframes black-friday-timer-pulse {
    0%, 60%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 132, 151, 0);
    }

    22% {
        box-shadow: 0 0 0 4px rgba(255, 132, 151, 0.52);
    }
}

@media (prefers-reduced-motion: reduce) {
    .black-friday-offers {
        background-image: none;
        animation: none;
    }

    .black-friday-offers .item::before,
    .black-friday-offers .black-friday-discount,
    .black-friday-offers .trunk-discount-countdown ul li span:is(.hours, .minutes, .seconds) {
        animation: none;
    }
}
