/* Flash Sale Widget — NoRecoil Gaming Edition
   Cyberpunk / gaming timer, fixed image, logo, category, light effects, RTL responsive. */

.fsw-box {
    direction: rtl;
    font-family: "IRANSans", "Vazirmatn", Tahoma, sans-serif;
    color: #fff;
    background: rgba(8, 8, 14, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 14px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* ===== Light beams on box ===== */
.fsw-box::before,
.fsw-box::after {
    content: "";
    position: absolute;
    top: -50%;
    width: 60%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,0.1), transparent);
    transform: rotate(25deg);
    pointer-events: none;
    z-index: 0;
}
.fsw-box::before {
    left: -100%;
    animation: fsw-box-beam 5s ease-in-out infinite;
}
.fsw-box::after {
    right: -100%;
    animation: fsw-box-beam 7s ease-in-out 2s infinite reverse;
}

/* ===== Gaming Timer bar ===== */
.fsw-timer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.12);
}
.fsw-timer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg, rgba(34,211,238,0.12) 0px, rgba(34,211,238,0.12) 2px, transparent 2px, transparent 10px);
    opacity: 0.35;
    pointer-events: none;
}
.fsw-timer-title {
    position: relative;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}
.fsw-timer-cells {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ===== Gaming Flip Cell ===== */
.fsw-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 56px;
    box-sizing: border-box;
}
.fsw-cell-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 6;
    border-radius: 12px;
    background: #0b0c15;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(34, 211, 238, 0.15);
    overflow: hidden;
}
.fsw-cell-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(34,211,238,0.08) 0px, rgba(34,211,238,0.08) 1px, transparent 1px, transparent 4px), repeating-linear-gradient(90deg, rgba(34,211,238,0.08) 0px, rgba(34,211,238,0.08) 1px, transparent 1px, transparent 4px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 2;
}
/* corner accents */
.fsw-cell-inner::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid transparent;
    border-top-color: rgba(34, 211, 238, 0.5);
    border-bottom-color: rgba(217, 70, 239, 0.5);
    border-radius: 8px;
    pointer-events: none;
    z-index: 3;
}

.fsw-digit-static,
.fsw-digit-flip {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    overflow: hidden;
    backface-visibility: hidden;
    background: rgba(11, 12, 21, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fsw-digit-static-top { top: 0; border-bottom: 1px solid rgba(0,0,0,0.5); z-index: 1; }
.fsw-digit-static-bottom { bottom: 0; border-top: 1px solid rgba(255,255,255,0.08); z-index: 1; }
.fsw-digit-static span,
.fsw-digit-flip span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200%;
    font-weight: 900;
    font-size: 22px;
    color: #fff;
    text-shadow: 0 0 8px rgba(34,211,238,0.8), 0 0 16px rgba(34,211,238,0.5);
    font-family: "Orbitron", "Courier New", monospace;
}
.fsw-digit-static-bottom span,
.fsw-digit-flip.fsw-flip-bottom span { margin-top: -100%; }

.fsw-digit-flip { z-index: 4; }
.fsw-digit-flip.fsw-flip-top {
    top: 0;
    border-bottom: 1px solid rgba(34, 211, 238, 0.3);
    transform-origin: bottom;
}
.fsw-digit-flip.fsw-flip-bottom {
    bottom: 0;
    border-top: 1px solid rgba(217, 70, 239, 0.3);
    transform-origin: top;
    transform: rotateX(90deg);
}
.fsw-digit-flip.fsw-flip-top.fsw-animate { animation: fsw-flip-top 0.5s ease-in forwards; }
.fsw-digit-flip.fsw-flip-bottom.fsw-animate { animation: fsw-flip-bottom 0.5s ease-out forwards; }

.fsw-cell .fsw-lbl {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(34, 211, 238, 0.8);
    margin-top: 6px;
}

/* colon dots */
.fsw-sep {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
    margin-left: 2px;
    margin-right: 2px;
}
.fsw-sep::before,
.fsw-sep::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 8px #22d3ee;
}
.fsw-sep::after {
    background: #d946ef;
    box-shadow: 0 0 8px #d946ef;
    animation: fsw-pulse 1s ease-in-out 0.5s infinite;
}
.fsw-sep::before { animation: fsw-pulse 1s ease-in-out infinite; }

/* timer progress line */
.fsw-timer-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}
.fsw-timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #d946ef);
    box-shadow: 0 0 10px #d946ef;
    animation: fsw-progress 3s ease-in-out infinite alternate;
}

/* ===== Hero ===== */
.fsw-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 320px;
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.35), rgba(10, 10, 18, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 1;
}
.fsw-hero-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    pointer-events: none;
}
.fsw-hero-grid path,
.fsw-hero-grid line,
.fsw-hero-grid rect { stroke: rgba(34, 211, 238, 0.3); }

.fsw-light-beam {
    position: absolute;
    top: -50%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(34,211,238,0.14), transparent);
    transform: rotate(20deg);
    pointer-events: none;
    filter: blur(4px);
    z-index: 2;
}
.fsw-light-beam-1 { left: -60%; animation: fsw-hero-beam 5s ease-in-out infinite; }
.fsw-light-beam-2 { right: -60%; animation: fsw-hero-beam 7s ease-in-out 2s infinite reverse; }

/* fixed image box */
.fsw-img-wrap {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    max-height: 320px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fsw-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}
.fsw-box:hover .fsw-img { transform: scale(1.08); }

/* Logo */
.fsw-logo {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
    box-sizing: border-box;
    overflow: hidden;
}
.fsw-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.fsw-logo-text {
    font-weight: 900;
    font-size: 10px;
    color: #22d3ee;
    text-align: center;
    line-height: 1.15;
    text-shadow: 0 0 8px rgba(34,211,238,0.5);
}

.fsw-discount {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 900;
    font-size: 12px;
    box-sizing: border-box;
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

/* Category badge */
.fsw-category {
    position: absolute;
    top: 54px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(217, 70, 239, 0.4);
    color: #f0abfc;
    font-weight: 700;
    font-size: 10px;
    box-sizing: border-box;
    text-shadow: 0 0 6px rgba(217,70,239,0.5);
}

.fsw-team {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(34, 211, 238, 0.4);
    color: #22d3ee;
    font-weight: 900;
    font-size: 9px;
    line-height: 1.2;
    padding: 8px;
    box-sizing: border-box;
    text-shadow: 0 0 6px rgba(34,211,238,0.5);
}
.fsw-game-title {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 4;
    font-weight: 900;
    font-size: 48px;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    text-shadow: 0 0 10px rgba(34,211,238,0.7), 0 0 30px rgba(217,70,239,0.5);
    line-height: 1;
    letter-spacing: -0.03em;
}

/* ===== Title ===== */
.fsw-title {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    padding: 0 6px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.6;
    color: #fff;
}
.fsw-subtitle {
    position: relative;
    z-index: 1;
    padding: 0 6px;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

/* ===== Footer row ===== */
.fsw-footer {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-sizing: border-box;
}
.fsw-price { text-align: right; }
.fsw-price-old {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}
.fsw-price-new {
    font-size: 18px;
    font-weight: 900;
    color: #22d3ee;
    text-shadow: 0 0 10px rgba(34,211,238,0.4);
}
.fsw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(270deg, rgba(6,182,212,0.25), rgba(217,70,239,0.25));
    border: 1px solid rgba(34, 211, 238, 0.4);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
    transition: filter 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    line-height: 1;
    box-sizing: border-box;
}
.fsw-btn:hover {
    filter: brightness(1.15);
    color: #fff;
    transform: translateY(-1px);
}

/* ===== Animations ===== */
@keyframes fsw-box-beam {
    0% { transform: translateX(0) rotate(25deg); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(220%) rotate(25deg); opacity: 0; }
}
@keyframes fsw-hero-beam {
    0% { transform: translateX(0) rotate(20deg); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(250%) rotate(20deg); opacity: 0; }
}
@keyframes fsw-flip-top {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(-90deg); }
}
@keyframes fsw-flip-bottom {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}
@keyframes fsw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .4; transform: scale(.7); }
}
@keyframes fsw-progress {
    0% { width: 20%; }
    100% { width: 85%; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .fsw-timer { flex-direction: column; align-items: stretch; }
    .fsw-timer-cells { justify-content: space-between; }
    .fsw-cell { width: 100%; max-width: 64px; }
    .fsw-digit-static span, .fsw-digit-flip span { font-size: 18px; }
    .fsw-hero { min-height: 260px; }
    .fsw-game-title { font-size: 36px; }
    .fsw-footer { flex-direction: row; flex-wrap: wrap; }
    .fsw-img-wrap { max-height: 260px; }
}
@media (max-width: 480px) {
    .fsw-box { padding: 10px; border-radius: 24px; }
    .fsw-hero { min-height: 220px; }
    .fsw-game-title { font-size: 28px; bottom: 12px; left: 12px; }
    .fsw-team { width: 52px; height: 52px; font-size: 8px; bottom: 12px; right: 12px; }
    .fsw-logo { width: 40px; height: 40px; }
    .fsw-category { top: 46px; right: 10px; font-size: 9px; padding: 4px 10px; }
    .fsw-discount { font-size: 10px; padding: 5px 10px; }
    .fsw-cell { width: 100%; max-width: 52px; }
    .fsw-digit-static span, .fsw-digit-flip span { font-size: 16px; }
    .fsw-footer { flex-direction: column; align-items: stretch; }
    .fsw-price { text-align: center; }
    .fsw-btn { justify-content: center; }
    .fsw-img-wrap { max-height: 220px; }
}

/* Editor preview helper */
.elementor-editor-active .fsw-box { outline: 1px dashed rgba(34,211,238,0.25); }