/* ══════════════════════════════════════════════════════════
   COMPACT & BRANDED FLASH SALE
   ══════════════════════════════════════════════════════════ */
:root {
    --flash-bg: #0a0a0b;
    --flash-accent: #d92323; /* Brand Red */
    --flash-text: #ffffff;
}

.flash-sale-section {
    padding: 1rem 0 3rem; /* Reduced top padding to 1rem */
    background: #f8fafc;
}

.flash-sale-banner {
    background: linear-gradient(135deg, #1a1a1c 0%, #0a0a0b 100%);
    border-radius: 24px; /* Reduced from 40px */
    padding: 2rem; /* Reduced from 3.5rem */
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.flash-sale-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(217, 35, 35, 0.1) 0%, transparent 70%);
    filter: blur(30px);
}

.flash-sale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem; /* Reduced from 3.5rem */
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.flash-sale-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flash-sale-title i {
    font-size: 2rem;
    color: var(--flash-accent);
    filter: drop-shadow(0 0 10px rgba(217, 35, 35, 0.4));
}

.flash-sale-title h2 {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 2rem; /* Reduced from 2.8rem */
    margin: 0;
    color: #fff;
}

.flash-sale-timer {
    display: flex;
    gap: 0.8rem;
}

.timer-segment {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    min-width: 70px; /* Reduced from 95px */
    text-align: center;
}

.timer-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.4rem; /* Reduced from 2rem */
    color: var(--flash-accent);
    display: block;
    line-height: 1;
}

.timer-label {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

.flash-card-link {
    text-decoration: none !important;
    display: block;
    color: inherit;
}

/* Flash Sale Grid */
.flash-sale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adaptive: 1 card = full width, 2+ cards = grid */
    gap: 1.2rem;
    position: relative;
    z-index: 2;
}

.flash-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1rem;
    transition: all 0.3s ease;
    height: 100%;
}

.flash-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--flash-accent);
}

.flash-img-wrap {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    height: 200px; /* Increased from 170px */
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Shimmer effect for "loading" feel */
}

.flash-img-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite linear;
    pointer-events: none;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.flash-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
    transition: transform 0.5s ease;
    z-index: 1;
}

.flash-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--flash-accent);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 8px;
    z-index: 2;
}

.flash-name {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.6rem;
    height: 2.8rem;
    overflow: hidden;
    line-height: 1.4;
}

.flash-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 0.5rem;
}

.new-price {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--flash-accent);
}

.old-price {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: rgba(255, 255, 255, 0.3);
}

/* Buy Button inside card on hover */
.flash-card::after {
    content: 'عرض المنتج';
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: var(--flash-accent);
    color: #fff;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.flash-card:hover .flash-info {
    padding-bottom: 35px;
}

.flash-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .flash-sale-section {
        padding: 0.1rem 0 0.2rem;
    }
    .flash-sale-header { 
        flex-direction: column; 
        text-align: center;
        gap: 0.4rem;
    }
    .flash-sale-title h2 { font-size: 1rem; }
    .flash-sale-banner { padding: 0.5rem; border-radius: 12px; }
    
    /* Timer Refinements for Mobile */
    .flash-sale-timer {
        gap: 0.2rem;
        justify-content: center;
        width: 100%;
    }
    .timer-segment {
        min-width: 44px;
        padding: 0.2rem 0.1rem;
        border-radius: 6px;
    }
    .timer-val { font-size: 0.9rem; }
    .timer-label { font-size: 0.5rem; margin-top: 1px; }

    /* Force 2 Columns on all Mobile */
    .flash-sale-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.3rem;
    }

    .flash-card {
        padding: 0.3rem;
        border-radius: 10px;
    }

    .flash-img-wrap {
        height: 95px;
        margin-bottom: 0.4rem;
    }

    /* Make button always visible on mobile */
    .flash-card::after {
        opacity: 1;
        transform: translateY(0);
        bottom: 5px;
        left: 5px;
        right: 5px;
        font-size: 0.65rem;
        padding: 3px;
    }

    .flash-info {
        padding-bottom: 22px; /* Room for smaller button */
    }

    .flash-name {
        font-size: 0.75rem;
        height: 1.8rem;
        margin-bottom: 0.3rem;
        line-height: 0.9rem;
    }

    .flash-price {
        gap: 4px;
        margin-bottom: 0.3rem;
    }

    .new-price {
        font-size: 1rem;
    }
    .old-price {
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .timer-segment {
        min-width: 50px;
    }
    .flash-sale-grid {
        gap: 0.4rem;
    }
    .flash-sale-title h2 { font-size: 1.15rem; }
    .flash-sale-title i { font-size: 1.3rem; }
    .flash-sale-header { gap: 0.5rem; }
}

@media (max-width: 480px) and (min-width: 361px) {
    .flash-sale-title h2 { font-size: 1.35rem; }
    .flash-sale-title i { font-size: 1.5rem; }
}
