/* Featured deal — graphics matched to rtl-theme (راست‌چین) product UI */

.rt-featured-deal {
    --fd-brand: #8ed557;
    --fd-brand-hover: #7fc945;
    --fd-ink: #3c4354;
    --fd-mute: #959595;
    --fd-line: #ededed;
    --fd-soft: #f7f8fa;
    margin-block: 1.15rem;
    color: var(--fd-ink);
}

.rt-fd-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rt-fd-card {
    display: grid;
    grid-template-columns: 325px minmax(0, 1fr);
    gap: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(60, 67, 84, .08);
    transition: box-shadow .3s;
}
.rt-fd-card:hover {
    box-shadow: 0 10px 28px rgba(60, 67, 84, .14);
}
.rt-fd-card.is-switching {
    animation: rtFdSwitch .28s ease;
}
@keyframes rtFdSwitch {
    from { opacity: .6; }
    to { opacity: 1; }
}

/* Media — like rastchin card image inset */
.rt-fd-media {
    position: relative;
    display: block;
    padding: 12px 0 12px 12px;
    background: #fff;
    overflow: hidden;
}
.rt-fd-media img,
.rt-fd-media__fallback {
    width: 100%;
    height: 100%;
    min-height: 168px;
    aspect-ratio: 911 / 451;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: #eef2f4;
    transition: opacity .25s ease;
}
.rt-fd-media__fallback {
    display: grid;
    place-items: center;
    color: var(--fd-brand);
    font-size: 2rem;
    font-weight: 800;
    background: #eef8ea;
}
.rt-fd-media__shine { display: none; }

.rt-fd-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 18px 14px 14px;
    gap: 14px;
}

.rt-fd-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.rt-fd-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 400;
    line-height: 32px;
    max-height: none;
}
.rt-fd-title a {
    color: var(--fd-ink);
    text-decoration: none;
    transition: color .2s;
}
.rt-fd-title a:hover { color: var(--fd-brand); }

.rt-fd-cat {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--fd-mute);
    font-size: 13px;
    font-weight: 400;
}
.rt-fd-cat strong {
    color: var(--fd-mute);
    font-weight: 400;
}

.rt-fd-pro {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.rt-fd-pro__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 4px;
    background: var(--fd-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.rt-fd-pro__text {
    color: var(--fd-mute);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
}

/* Timer — soft boxes, rastchin soft gray */
.rt-fd-timer {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.rt-fd-unit {
    min-width: 54px;
    padding: 8px 6px 7px;
    border-radius: 8px;
    background: var(--fd-soft);
    border: 1px solid var(--fd-line);
    text-align: center;
}
.rt-fd-unit b {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--fd-ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.rt-fd-unit b.is-flip {
    animation: rtFdFlip .25s ease;
}
@keyframes rtFdFlip {
    from { opacity: .4; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}
.rt-fd-unit span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--fd-mute);
    font-weight: 400;
}
.rt-fd-unit.is-live b { color: #689e3f; }
.rt-fd-timer.is-ended .rt-fd-unit {
    background: #fff5f5;
    border-color: #f0d0d0;
}
.rt-fd-timer.is-ended .rt-fd-unit b { color: #c0392b; }

/* Foot — details + price (rastchin card footer) with always-visible actions */
.rt-fd-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    min-height: 68px;
    padding: 8px 0 0;
    border-top: 1px solid var(--fd-line);
}

.rt-fd-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Buy = rastchin downloadBtn exact */
.rt-fd-buy {
    appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    min-width: 115px;
    padding: 10px 15px;
    border-radius: 4px;
    background: #8ed557 !important;
    color: #fff !important;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    box-shadow: none !important;
    transition: background .2s;
}
.rt-fd-buy:hover {
    background: #7fc945 !important;
    filter: none;
    box-shadow: none !important;
}
.rt-fd-buy.is-loading { opacity: .8; cursor: wait; }
.rt-fd-buy__spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    animation: rtFdSpin .7s linear infinite;
}
@keyframes rtFdSpin { to { transform: rotate(360deg); } }

/* Preview = rastchin previewBtn exact */
.rt-fd-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    min-width: auto;
    padding: 10px 14px;
    border-radius: 4px;
    background: #f1f3f5;
    color: #a2a6ab;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    text-decoration: none;
    box-shadow: none;
    transition: .2s;
}
.rt-fd-preview:hover {
    background: #e7e9ed;
    color: #6a6a6a;
}

.rt-fd-meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    flex: 1 1 auto;
    min-width: 0;
}
.rt-fd-detail {
    margin: 0 4px;
    text-align: center;
    min-width: 40px;
}
.rt-fd-detail--sale {
    background: #f3f5f7;
    border-radius: 8px;
    padding: 6px 10px;
    min-width: 48px;
}
.rt-fd-detail b {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #3c4354;
    line-height: 1.2;
}
.rt-fd-detail--support b {
    color: rgb(60 67 84 / .85);
    font-size: 14px;
}
.rt-fd-detail span {
    display: block;
    font-size: 11px;
    color: hsla(0, 0%, 42.7%, .85);
    font-weight: 400;
    margin-top: 2px;
}
.rt-fd-detail-new,
.rt-fd-detail-support {
    display: block;
}
.rt-fd-pill,
.rt-fd-sales { display: none; }

/* Price — rastchin productPrice */
.rt-fd-price {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    min-width: 118px;
    min-height: 54px;
    padding-right: 14px;
    text-align: left;
    direction: ltr;
    flex: 0 0 auto;
}
.rt-fd-price::after {
    content: "";
    position: absolute;
    border-right: 1px solid var(--fd-line);
    right: 0;
    height: 43px;
    bottom: 6px;
}
.rt-fd-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    direction: ltr;
    margin-bottom: 1px;
    min-height: 22px;
}
.rt-fd-price-row:empty,
.rt-fd-price:not(.has-off) .rt-fd-price-row {
    display: none;
}
.rt-fd-off {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 22px;
    padding: 0 6px;
    border-radius: 4px;
    color: #fff;
    background: #8ed557;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.rt-fd-price-row s {
    font-size: 13px;
    font-weight: 400;
    color: var(--fd-mute);
    text-decoration: line-through;
}
.rt-fd-final {
    display: flex;
    align-items: baseline;
    gap: 4px;
    direction: rtl;
    white-space: nowrap;
}
.rt-fd-final strong {
    font-size: 17px;
    font-weight: 700;
    color: var(--fd-ink);
    line-height: 1.4;
}
.rt-fd-final span {
    font-size: 12px;
    font-weight: 700;
    color: #6d6d6d;
}

/* Bottom strip — soft rastchin bar */
.rt-fd-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 12px;
    border-radius: 12px;
    background: #f0f1f3;
}
.rt-fd-strip__viewport { min-width: 0; overflow: hidden; }
.rt-fd-strip__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
    outline: none;
}
.rt-fd-strip__track::-webkit-scrollbar { display: none; }
.rt-fd-strip__track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.rt-fd-chip {
    scroll-snap-align: start;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    min-height: 46px;
    padding: 4px 10px 4px 4px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--fd-ink);
    font: inherit;
    text-align: right;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
}
.rt-fd-chip:hover,
.rt-fd-chip.is-active {
    background: #fff;
    box-shadow: 0 2px 10px rgba(60, 67, 84, .1);
}
.rt-fd-chip__thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    background: #eef2f4;
    flex-shrink: 0;
}
.rt-fd-chip__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.rt-fd-chip__thumb em {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-style: normal;
    font-weight: 700;
    color: var(--fd-brand);
    background: #eef8ea;
}
.rt-fd-chip__title {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--fd-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rt-fd-strip__nav {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 0;
    background: #fff;
    color: var(--fd-mute);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(60, 67, 84, .08);
    transition: color .2s;
}
.rt-fd-strip__nav:hover { color: var(--fd-brand-hover); }

.rt-fd-toast {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 90;
    padding: .7rem 1rem;
    border-radius: 8px;
    background: var(--fd-ink);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(0,0,0,.16);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: .2s ease;
}
.rt-fd-toast.is-show {
    opacity: 1;
    transform: none;
}
.rt-fd-toast.is-err { background: #c0392b; }

@media (max-width: 980px) {
    .rt-fd-card {
        grid-template-columns: 1fr;
    }
    .rt-fd-media {
        padding: 12px 12px 0;
    }
    .rt-fd-media img,
    .rt-fd-media__fallback {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
    .rt-fd-head { flex-direction: column; }
    .rt-fd-timer { width: 100%; }
    .rt-fd-unit { flex: 1; min-width: 0; }
    .rt-fd-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .rt-fd-price {
        order: 1;
        width: 100%;
        padding-right: 0;
        align-items: center;
    }
    .rt-fd-price::after { display: none; }
    .rt-fd-meta { order: 2; justify-content: center; }
    .rt-fd-actions {
        order: 3;
        display: grid;
        grid-template-columns: 1.15fr .9fr;
        width: 100%;
    }
    .rt-fd-buy,
    .rt-fd-preview { width: 100%; }
}

@media (max-width: 640px) {
    .rt-fd-card { border-radius: 16px; }
    .rt-fd-body { padding: 14px 14px 16px; }
    .rt-fd-title { font-size: 1.05rem; line-height: 1.55; }
    .rt-fd-actions { grid-template-columns: 1fr; }
    .rt-fd-unit { padding: .55rem .35rem; }
    .rt-fd-unit b { font-size: 1.05rem; }
    .rt-fd-unit span { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .rt-fd-card,
    .rt-fd-buy,
    .rt-fd-chip,
    .rt-fd-unit b { transition: none; animation: none !important; }
}
