﻿/* Flash Offers Marquee Banner - Enhanced Style */
.flash-offers-marquee {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: white;
    padding: 12px 0;
    z-index: 999;
    box-shadow: 0 4px 25px rgba(48, 43, 99, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #ff6b9d, #c44569, #ff6b9d) 1;
    overflow: hidden;
    cursor: pointer;
    display: block;
    visibility: visible;
    opacity: 1;
}

.flash-offers-marquee::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 107, 157, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

    .flash-offers-marquee:hover {
        box-shadow: 0 8px 30px rgba(48, 43, 99, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }

.marquee-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, rgba(255, 107, 157, 0.15) 0%, rgba(196, 69, 105, 0.2) 50%, rgba(255, 107, 157, 0.15) 100%);
    padding: 10px 15px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
}

    .marquee-header .badge {
        background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #a0356a 100%);
        color: white;
        padding: 6px 16px;
        border-radius: 25px;
        font-weight: 700;
        font-size: 14px;
        display: flex;
        align-items: center;
        box-shadow: 0 4px 15px rgba(196, 69, 105, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.15);
        white-space: nowrap;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        animation: badge-pulse 2s ease-in-out infinite;
    }

    @keyframes badge-pulse {
        0%, 100% { box-shadow: 0 4px 15px rgba(196, 69, 105, 0.5); }
        50% { box-shadow: 0 4px 25px rgba(255, 107, 157, 0.8); }
    }

        .marquee-header .badge i {
            margin-right: 8px;
            animation: flash-icon 1s ease-in-out infinite;
        }

    @keyframes flash-icon {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.7; transform: scale(1.2); }
    }

    .marquee-header .timer {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(48, 43, 99, 0.6) 100%);
        padding: 6px 18px;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        white-space: nowrap;
        border: 1px solid rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(5px);
    }

        .marquee-header .timer i {
            margin-right: 8px;
            color: #ffd700;
            animation: timer-pulse 1s ease-in-out infinite;
            filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.6));
        }

    @keyframes timer-pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.15); }
    }

/* Marquee content - BASE STYLES */
.marquee-content {
    display: flex;
    width: fit-content;
    animation-play-state: running;
    will-change: transform;
    gap: 0;
    margin: 0;
    padding: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

    .marquee-content:hover {
        animation-play-state: paused;
    }

    /* English/LTR Animation */
    .marquee-content:not(.rtl-direction) {
        animation: marquee-scroll-ltr 600s linear infinite;
    }

    /* Arabic/RTL Animation */
    .marquee-content.rtl-direction {
        animation: marquee-scroll-rtl 600s linear infinite;
        direction: rtl;
        unicode-bidi: plaintext;
    }

.marquee-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 45px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    color: #fff;
    flex-shrink: 0;
    box-sizing: border-box;
    margin: 0;
    height: 100%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.marquee-item:hover {
    color: #ff6b9d;
    text-shadow: 0 0 15px rgba(255, 107, 157, 0.6);
}

.marquee-text {
    display: inline-block;
    line-height: 1.5;
    background: linear-gradient(180deg, #ffffff 0%, #e8e8ff 100%);
    -webkit-background-clip: text; 
    background-clip: text;
}

/* English styling */
.marquee-item:not(.ar) .marquee-text {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: ltr;
    text-align: left;
}

/* Arabic styling - FIXED */
.marquee-item.ar .marquee-text {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
    letter-spacing: 0;
}

.marquee-item i {
    font-size: 20px;
    flex-shrink: 0;
    min-width: 26px;
    color: #ff6b9d;
    filter: drop-shadow(0 0 6px rgba(255, 107, 157, 0.5));
    animation: icon-glow 2s ease-in-out infinite;
}

@keyframes icon-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.4)); }
    50% { filter: drop-shadow(0 0 10px rgba(255, 107, 157, 0.8)); }
}

/* Icon positioning for different directions */
.marquee-item:not(.ar) i {
    margin-right: 12px;
    margin-left: 0;
}

.marquee-item.ar i {
    margin-left: 12px;
    margin-right: 0;
}

.marquee-item::after {
    content: '✦';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #c44569;
    text-shadow: 0 0 8px rgba(196, 69, 105, 0.6);
    animation: star-twinkle 1.5s ease-in-out infinite;
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.3); }
}

.marquee-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255, 107, 157, 0.4), transparent);
    pointer-events: none;
}

.marquee-item .highlight {
    background: rgba(255, 71, 87, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0 5px;
    font-weight: 600;
    display: inline-block;
    line-height: inherit;
}

.marquee-item .arrow {
    color: #ffdd59;
    display: inline-block;
    line-height: inherit;
    vertical-align: baseline;
}

/* Different arrow animations for RTL vs LTR */
.marquee-item:not(.ar) .arrow {
    animation: bounce-arrow-ltr 1s infinite alternate;
}

.marquee-item.ar .arrow {
    animation: bounce-arrow-rtl 1s infinite alternate;
}

.marquee-controls {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    pointer-events: auto;
}

    .marquee-controls button {
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s;
        font-size: 12px;
        pointer-events: auto;
    }

        .marquee-controls button:hover {
            background: rgba(255, 71, 87, 0.7);
        }

/* ANIMATIONS */
/* LTR Animation (English) */
@keyframes marquee-scroll-ltr {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* RTL Animation (Arabic) - FIXED */
@keyframes marquee-scroll-rtl {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(50%);
    }
}

/* Arrow animations */
@keyframes bounce-arrow-ltr {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(5px);
    }
}

@keyframes bounce-arrow-rtl {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-5px);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .marquee-header {
        flex-direction: column;
        gap: 8px;
        padding: 8px 10px;
    }

        .marquee-header .badge,
        .marquee-header .timer {
            width: 100%;
            justify-content: center;
        }

    .marquee-item {
        font-size: 14px;
        padding: 0 25px;
    }

    .marquee-controls {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        justify-content: center;
        margin-top: 10px;
    }

    .flash-offers-marquee {
        padding-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .marquee-item {
        font-size: 13px;
        padding: 0 15px;
    }

    .marquee-header .badge,
    .marquee-header .timer {
        font-size: 12px;
        padding: 4px 10px;
    }
}

/* Prevent text selection */
.flash-offers-marquee {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Import Arabic fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap');
