/**
 * شرائط Marquee موحّدة — حلقة لانهائية سلسة، هوية داكنة + بنفسجي.
 * محتوى مكرَّر في مجموعتين؛ translateX(-50%) بدون قفزة عند تطابق عرض المجموعتين ومسافة الشريط.
 */

.str-mq {
    margin-top: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 0;
}

.str-mq__head-wrap {
    margin-bottom: 0.85rem;
}

.str-mq__heading {
    margin: 0;
    text-align: center;
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    font-weight: 800;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.str-mq__shell {
    position: relative;
    padding: 0.75rem 0;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(10, 11, 30, 0.88));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 48px rgba(124, 58, 237, 0.12);
    overflow: hidden;
    transition:
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .str-mq__shell:hover {
        border-color: rgba(167, 139, 250, 0.42);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 0 56px rgba(124, 58, 237, 0.26),
            0 0 28px rgba(167, 139, 250, 0.12);
    }
}

.str-mq:hover .str-mq__track {
    animation-play-state: paused;
}

.str-mq__viewport {
    overflow: hidden;
    direction: ltr;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.str-mq__fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 44px;
    z-index: 2;
    pointer-events: none;
}

.str-mq__fade--start {
    inset-inline-start: 0;
    background: linear-gradient(90deg, rgba(10, 11, 30, 0.96), transparent);
}

.str-mq__fade--end {
    inset-inline-end: 0;
    background: linear-gradient(270deg, rgba(10, 11, 30, 0.96), transparent);
}

.str-mq__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    width: max-content;
    gap: 0.65rem;
    will-change: transform;
    backface-visibility: hidden;
    animation: str-mq-move var(--str-mq-dur, 52s) linear infinite;
}

html[dir='rtl'] .str-mq__track {
    animation-direction: reverse;
}

@keyframes str-mq-move {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

.str-mq--ai {
    --str-mq-dur: 52s;
}

.str-mq--gifts {
    --str-mq-dur: 56s;
}

.str-mq--subscriptions {
    --str-mq-dur: 58s;
}

.str-mq--tech {
    --str-mq-dur: 62s;
}

.str-mq__group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.str-mq__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.88rem 0.42rem 0.42rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .str-mq__shell:hover .str-mq__item:hover {
        border-color: rgba(196, 181, 253, 0.35);
        box-shadow: 0 0 18px rgba(124, 58, 237, 0.22);
        transform: translateY(-1px);
    }
}

.str-mq__label {
    padding-inline-end: 0.15rem;
}

.str-mq__logo {
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

/* خلفية فاتحة موحّدة توضّح الشعارات الداكنة وتُحافظ على ألوان العلامات الملوّنة */
.str-mq__logo--img {
    width: 2rem;
    height: 2rem;
    padding: 0.22rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.28);
    background: rgba(248, 250, 252, 0.94);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.18);
    transition:
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s ease,
        border-color 0.25s ease;
}

.str-mq__logo--img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .str-mq__shell:hover .str-mq__item:hover .str-mq__logo--img {
        transform: scale(1.08);
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.35);
        border-color: rgba(196, 181, 253, 0.45);
    }
}

.str-mq__logo--raster {
    padding: 0.18rem;
}

.str-mq__logo--text {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.25rem;
    border-radius: 10px;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #ede9fe;
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.55), rgba(59, 7, 100, 0.65));
    border: 1px solid rgba(167, 139, 250, 0.35);
    box-shadow: 0 0 14px rgba(124, 58, 237, 0.22);
}

@media (max-width: 640px) {
    .str-mq {
        --str-mq-dur-mobile: 82s;
    }

    .str-mq--ai {
        --str-mq-dur: var(--str-mq-dur-mobile);
    }

    .str-mq--gifts {
        --str-mq-dur: calc(var(--str-mq-dur-mobile) + 6s);
    }

    .str-mq--subscriptions {
        --str-mq-dur: calc(var(--str-mq-dur-mobile) + 10s);
    }

    .str-mq--tech {
        --str-mq-dur: calc(var(--str-mq-dur-mobile) + 14s);
    }

    .str-mq__item {
        font-size: 0.76rem;
        padding: 0.36rem 0.72rem 0.36rem 0.36rem;
        gap: 0.38rem;
    }

    .str-mq__logo--img {
        width: 1.72rem;
        height: 1.72rem;
        padding: 0.18rem;
    }

    .str-mq__logo--text {
        min-width: 1.72rem;
        height: 1.72rem;
        font-size: 0.52rem;
    }

    .str-mq__heading {
        font-size: 1rem;
    }

    .str-mq__track {
        gap: 0.5rem;
    }

    .str-mq__group {
        gap: 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .str-mq__track {
        animation: none;
        flex-wrap: wrap;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        row-gap: 0.5rem;
        transform: none;
    }

    .str-mq__group[aria-hidden='true'] {
        display: none;
    }

    .str-mq:hover .str-mq__track {
        animation-play-state: running;
    }
}
