/* ==========================================================================
   العروض — offer carousel
   --------------------------------------------------------------------------
   A scroll-snap carousel rather than a JS slider: the viewport is a plain
   overflow-x container, so touch swipe, trackpad, keyboard and the scrollbar
   all work natively and correctly in RTL without a library. The buttons and
   dots call scrollIntoView(); if the script never runs, the carousel degrades
   to a usable horizontal scroller.
   ========================================================================== */

.rn-offers {
    position: relative;
}

/* ---------- viewport + track ---------- */

.rn-offers__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    /* Pairs with scroll-snap-align: start on the slides — see there for why
       start rather than center. */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Bleed to the container edge so a peeking slide is not clipped mid-shadow. */
    margin-inline: -0.75rem;
    padding: 0.5rem 0.75rem 1.25rem;
}

.rn-offers__viewport::-webkit-scrollbar {
    display: none;
}

.rn-offers__track {
    display: flex;
    gap: 1.25rem;
    align-items: stretch;
    /* Load-bearing. As a block-level child the track is clamped to the viewport's
       content width and the slides merely spill out of it — and overflow toward
       the inline end is unreachable in RTL, so scrollLeft stays pinned at 0 and
       the carousel cannot move at all. Sizing the track to its content puts the
       slides inside a properly-sized in-flow box and scrolling works both ways. */
    width: max-content;
    /* Breathing room past the last card so its shadow is not clipped. */
    padding-inline-end: 0.25rem;
}

.rn-offers__slide {
    flex: 0 0 auto;
    width: 300px;
    /* start, not center. A centred first slide has no reachable scroll position —
       centring it would mean scrolling before the beginning — so goTo(1) produced
       a positive delta, clamped against the RTL scroll range that ends at 0, and
       the carousel would not leave the first card. Aligning to the leading edge
       gives every slide a position that exists. */
    scroll-snap-align: start;
}

/* ---------- card ---------- */

.rn-offers__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid var(--ct-border);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(160deg, var(--ct-surface) 0%, var(--ct-secondary) 100%);
    box-shadow: 0 10px 30px var(--ct-shadow);
    text-align: right;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s ease;
}

.rn-offers__card:hover,
.rn-offers__card:focus-within {
    transform: translateY(-6px);
    border-color: var(--ct-accent);
    box-shadow: 0 18px 40px var(--ct-shadow), var(--ct-accent-glow);
}

/* The image is the lightbox trigger, so it is a real button — stripped back to
   look like the plain frame it replaced. */
.rn-offers__frame {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--ct-light);
    /* Every campaign design is exported 1080x1350, so one ratio fits all and no
       row ever ends up taller than its content. */
    aspect-ratio: 4 / 5;
    overflow: hidden;
    cursor: zoom-in;
}

.rn-offers__frame:focus-visible {
    outline: 2px solid var(--ct-accent-light);
    outline-offset: -3px;
}

.rn-offers__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.rn-offers__card:hover .rn-offers__img {
    transform: scale(1.04);
}

.rn-offers__price {
    position: absolute;
    top: 0.75rem;
    inset-inline-start: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--ct-accent-gradient);
    color: #16162b;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.6;
    box-shadow: 0 4px 14px rgba(5, 5, 15, 0.45);
    white-space: nowrap;
}

.rn-offers__zoom {
    position: absolute;
    inset-block-end: 0.75rem;
    inset-inline-end: 0.75rem;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(13, 13, 24, 0.72);
    color: var(--ct-text);
    font-size: 0.95rem;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.rn-offers__card:hover .rn-offers__zoom,
.rn-offers__card:focus-within .rn-offers__zoom {
    opacity: 1;
    transform: scale(1);
}

.rn-offers__body {
    display: flex;
    flex-direction: column;
    /* Fills the leftover height and pushes the CTA to the bottom edge of every
       card, however long the title wraps — a ragged row of buttons reads as
       broken. space-between does the pinning; the gap guarantees breathing room
       when a two-line title leaves nothing spare. */
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1rem 1.1rem;
    border-top: 1px solid rgba(208, 177, 212, 0.18);
}

.rn-offers__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ct-text);
    line-height: 1.5;
}

.rn-offers__sub {
    margin: 0.2rem 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--ct-muted);
    text-transform: uppercase;
    direction: ltr;
    text-align: right;
}

/* ---------- CTA ---------- */

.rn-offers__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* 46px clears the 44px minimum touch target. */
    min-height: 46px;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: var(--ct-accent-gradient);
    color: #16162b;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(191, 171, 211, 0.28);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.25s ease;
}

.rn-offers__cta:hover,
.rn-offers__cta:focus-visible {
    color: #16162b;
    filter: brightness(1.08);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(191, 171, 211, 0.45);
    outline: none;
}

.rn-offers__cta:focus-visible {
    outline: 2px solid var(--ct-text);
    outline-offset: 2px;
}

.rn-offers__cta:active {
    transform: translateY(0);
}

.rn-offers__cta .bi {
    font-size: 1.1rem;
}

/* ---------- controls ---------- */

.rn-offers__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.rn-offers__nav {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--ct-border);
    background: rgba(31, 31, 52, 0.85);
    color: var(--ct-text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

.rn-offers__nav:hover:not(:disabled),
.rn-offers__nav:focus-visible {
    background: var(--ct-accent-gradient);
    color: #16162b;
    border-color: transparent;
    box-shadow: var(--ct-accent-glow);
    outline: none;
}

.rn-offers__nav:disabled {
    opacity: 0.3;
    cursor: default;
}

.rn-offers__dots {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rn-offers__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(208, 177, 212, 0.35);
    cursor: pointer;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rn-offers__dot:hover {
    background: var(--ct-accent-dark);
}

.rn-offers__dot.is-active {
    width: 26px;
    background: var(--ct-accent-gradient);
}

/* ---------- responsive ---------- */

@media (max-width: 1199.98px) {
    .rn-offers__slide { width: 280px; }
}

@media (max-width: 767.98px) {
    .rn-offers__track { gap: 1rem; }
    /* Deliberately under 100% so the next card peeks — that edge is the only
       affordance telling a phone user the row scrolls. */
    .rn-offers__slide { width: 78vw; max-width: 320px; }
    /* The nav buttons deliberately do NOT shrink here — 46px is already the
       floor for a comfortable touch target, and this is the one breakpoint
       where every interaction is a touch. */
}

@media (prefers-reduced-motion: reduce) {
    .rn-offers__viewport { scroll-behavior: auto; }
    .rn-offers__card,
    .rn-offers__img,
    .rn-offers__cta,
    .rn-offers__zoom { transition: none; }
    .rn-offers__card:hover,
    .rn-offers__card:focus-within { transform: none; }
    .rn-offers__card:hover .rn-offers__img { transform: none; }
    .rn-offers__cta:hover,
    .rn-offers__cta:focus-visible { transform: none; }
}
