* {
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
        }

        body {
            min-height: 100vh;
            margin: 0;
            overflow-x: hidden;
            background:
                radial-gradient(
                    circle at top right,
                    color-mix(in srgb, var(--primary) 17%, transparent),
                    transparent 34%
                ),
                var(--background);
            color: var(--text);
            font-family: Arial, Tahoma, sans-serif;
        }

        body.store-menu-open,
        body.welcome-popup-open,
        body.loading-active {
            overflow: hidden;
        }

        a {
            color: inherit;
            text-decoration: none;
        }

        button,
        input,
        select,
        textarea {
            font: inherit;
        }

        button {
            cursor: pointer;
        }

        img {
            max-width: 100%;
        }

        /*
        |--------------------------------------------------------------------------
        | شاشة انتقال وتحميل فوق الصفحة الحالية
        |--------------------------------------------------------------------------
        |
        | تبقى الصفحة ظاهرة خلف طبقة شفافة، ويتحرك شعار الموقع حتى تنتهي
        | العملية وينتقل المتصفح إلى الصفحة التالية.
        |
        */

        .page-loader-overlay {
            position: fixed;
            inset: 0;
            z-index: 999999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(7, 8, 23, .48);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            opacity: 1;
            visibility: visible;
            pointer-events: all;
            transition:
                opacity .25s ease,
                visibility .25s ease;
        }

        .page-loader-overlay.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .page-loader-face {
            position: relative;
            width: 92px;
            height: 92px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: #ffffff;
            box-shadow:
                0 15px 40px rgba(0, 0, 0, .30),
                0 0 30px color-mix(in srgb, var(--primary) 55%, transparent);
            animation: pageLoaderPulse 1.25s ease-in-out infinite;
        }

        .page-loader-face::before {
            content: '';
            position: absolute;
            inset: -9px;
            border: 4px solid transparent;
            border-top-color: var(--primary);
            border-right-color: var(--secondary);
            border-radius: 50%;
            animation: pageLoaderSpin .8s linear infinite;
        }

        .page-loader-face::after {
            content: '';
            position: absolute;
            inset: -17px;
            border: 2px solid
                color-mix(in srgb, var(--primary) 25%, transparent);
            border-radius: 50%;
            animation: pageLoaderOuterPulse 1.4s ease-in-out infinite;
        }

        .page-loader-face img {
            position: relative;
            z-index: 2;
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
            padding: 5px;
            border-radius: 50%;
        }

        @keyframes pageLoaderSpin {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        @keyframes pageLoaderPulse {
            0%,
            100% {
                transform: scale(.96);
            }

            50% {
                transform: scale(1.05);
            }
        }

        @keyframes pageLoaderOuterPulse {
            0%,
            100% {
                opacity: .25;
                transform: scale(.92);
            }

            50% {
                opacity: .9;
                transform: scale(1.08);
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .page-loader-face,
            .page-loader-face::before,
            .page-loader-face::after {
                animation-duration: 2.5s;
            }
        }

        html.store-light-mode-preload body {
            --background: #f2f4fa;
            --surface: #ffffff;
            --surface-2: #f7f8fc;
            --surface-3: #eef1f7;
            --text: #171b29;
            --muted: #737d91;
            --border: rgba(20, 28, 48, .10);
            background: #f2f4fa;
            color: var(--text);
        }

        .store-header {
            position: sticky;
            top: 0;
            z-index: 900;
            min-height: var(--header-height);
            border-bottom: 1px solid rgba(255, 255, 255, .11);
            background:
                linear-gradient(
                    110deg,
                    var(--secondary),
                    color-mix(in srgb, var(--primary) 82%, var(--secondary))
                );
            box-shadow: 0 12px 35px rgba(0, 0, 0, .28);
        }

        .store-header-inner {
            width: min(var(--page-width), 94%);
            min-height: var(--header-height);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 14px;
            margin: auto;
        }

        .store-brand {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 11px;
        }

        .store-brand-image {
            width: auto;
            max-width: 165px;
            height: 47px;
            object-fit: contain;
        }

        .store-brand-fallback {
            font-size: 22px;
            font-weight: 800;
            letter-spacing: .3px;
        }

        .store-header-actions {
            display: flex;
            align-items: center;
            gap: 9px;
        }

        .store-menu-button {
            width: 50px;
            height: 50px;
            display: grid;
            flex: 0 0 50px;
            place-items: center;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, .18);
            border-radius: 17px;
            background: rgba(255, 255, 255, .13);
            color: #ffffff;
            box-shadow: 0 10px 25px rgba(0, 0, 0, .20);
            font-size: 28px;
            line-height: 1;
            backdrop-filter: blur(12px);
        }

        .store-menu-button:active {
            transform: scale(.96);
        }

        .store-global-vip {
            min-width: 0;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border: 1px solid rgba(250, 204, 21, .32);
            border-radius: 999px;
            background: rgba(250, 204, 21, .11);
            color: #facc15;
            font-size: 12px;
            font-weight: 900;
        }

        .store-global-vip-badge {
            width: 29px;
            height: 29px;
            display: grid;
            flex: 0 0 29px;
            place-items: center;
            overflow: hidden;
            border-radius: 50%;
            background: rgba(250, 204, 21, .15);
            color: #facc15;
            font-size: 16px;
        }

        .store-global-vip-badge img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
        }

        .store-global-vip-name {
            max-width: 110px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .store-main {
            width: min(var(--page-width), 94%);
            min-height: calc(100vh - var(--header-height));
            margin: auto;
            padding: 22px 0 calc(var(--bottom-height) + 38px);
        }

        .store-card {
            padding: 20px;
            border: 1px solid var(--border);
            border-radius: 22px;
            background: rgba(17, 23, 42, .94);
            box-shadow: 0 16px 42px rgba(0, 0, 0, .24);
        }

        .store-section-title {
            margin: 28px 0 15px;
            font-size: clamp(23px, 5vw, 32px);
        }

        .store-muted {
            color: var(--muted);
        }

        .store-menu-overlay {
            position: fixed;
            inset: 0;
            z-index: 1100;
            visibility: hidden;
            background: rgba(3, 5, 15, .68);
            opacity: 0;
            backdrop-filter: blur(5px);
            transition:
                opacity .25s ease,
                visibility .25s ease;
        }

        .store-menu-overlay.open {
            visibility: visible;
            opacity: 1;
        }

        .store-sidebar {
            position: fixed;
            top: 0;
            right: 0;
            z-index: 1200;
            width: min(400px, 91vw);
            height: 100vh;
            height: 100dvh;
            overflow-x: hidden;
            overflow-y: auto;
            transform: translateX(105%);
            border-left: 1px solid rgba(255, 255, 255, .08);
            background:
                linear-gradient(
                    180deg,
                    #17112f 0,
                    #0d1020 240px,
                    #090d19 100%
                );
            color: #ffffff;
            box-shadow: -25px 0 70px rgba(0, 0, 0, .50);
            transition: transform .28s ease;
            overscroll-behavior: contain;
        }

        .store-sidebar.open {
            transform: translateX(0);
        }

        .store-sidebar-head {
            position: sticky;
            top: 0;
            z-index: 3;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, .09);
            background: rgba(20, 13, 44, .94);
            backdrop-filter: blur(16px);
        }

        .store-sidebar-brand {
            min-width: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .store-sidebar-logo {
            width: 48px;
            height: 48px;
            display: grid;
            flex: 0 0 48px;
            place-items: center;
            overflow: hidden;
            border-radius: 15px;
            background: linear-gradient(135deg, var(--primary), #e879f9);
            font-weight: bold;
        }

        .store-sidebar-logo img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .store-sidebar-brand strong {
            display: block;
            overflow: hidden;
            font-size: 18px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .store-sidebar-brand small {
            display: block;
            margin-top: 4px;
            color: var(--muted);
        }

        .store-menu-close {
            width: 43px;
            height: 43px;
            display: grid;
            flex: 0 0 43px;
            place-items: center;
            padding: 0;
            border: 1px solid rgba(255, 255, 255, .10);
            border-radius: 14px;
            background: rgba(255, 255, 255, .08);
            color: #ffffff;
            font-size: 25px;
        }

        .store-sidebar-content {
            padding: 17px 15px 34px;
        }

        .store-profile {
            margin-bottom: 18px;
            padding: 17px;
            border: 1px solid rgba(255, 255, 255, .10);
            border-radius: 21px;
            background:
                linear-gradient(
                    135deg,
                    rgba(124, 58, 237, .22),
                    rgba(255, 255, 255, .04)
                );
        }

        .store-profile-top {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .store-profile-avatar {
            width: 55px;
            height: 55px;
            display: grid;
            flex: 0 0 55px;
            place-items: center;
            overflow: hidden;
            border-radius: 18px;
            background: linear-gradient(135deg, var(--primary), #db2777);
            font-size: 22px;
            font-weight: bold;
        }

        .store-profile-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .store-profile-info {
            min-width: 0;
            flex: 1;
        }

        .store-profile-info strong,
        .store-profile-info span {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .store-profile-info strong {
            font-size: 18px;
        }

        .store-profile-info span {
            margin-top: 5px;
            color: var(--muted);
            font-size: 13px;
        }

        .store-balance {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-top: 15px;
            padding: 12px 14px;
            border-radius: 14px;
            background: rgba(0, 0, 0, .25);
        }

        .store-balance span {
            color: var(--muted);
            font-size: 13px;
        }

        .store-balance strong {
            color: #facc15;
            direction: ltr;
        }

        .store-sidebar-nav {
            display: grid;
            gap: 8px;
        }

        .store-sidebar-link {
            display: flex;
            align-items: center;
            gap: 13px;
            padding: 11px 12px;
            border: 1px solid transparent;
            border-radius: 15px;
            color: #e9edf7;
            transition: .18s;
        }

        .store-sidebar-link:hover,
        .store-sidebar-link.active {
            border-color: rgba(255, 255, 255, .10);
            background:
                linear-gradient(
                    90deg,
                    color-mix(in srgb, var(--primary) 80%, transparent),
                    rgba(255, 255, 255, .07)
                );
            transform: translateX(-2px);
        }

        .store-sidebar-icon {
            width: 43px;
            height: 43px;
            display: grid;
            flex: 0 0 43px;
            place-items: center;
            border-radius: 13px;
            background: rgba(255, 255, 255, .07);
            font-size: 21px;
        }

        .store-sidebar-label {
            flex: 1;
            font-size: 16px;
            font-weight: bold;
        }

        .store-sidebar-arrow {
            color: var(--muted);
        }

        .store-sidebar-separator {
            height: 1px;
            margin: 15px 3px;
            background: rgba(255, 255, 255, .09);
        }

        .store-sidebar-logout {
            width: 100%;
            margin-top: 15px;
            padding: 13px;
            border: 1px solid rgba(248, 113, 113, .22);
            border-radius: 15px;
            background: rgba(220, 38, 38, .14);
            color: #fda4af;
            font-weight: bold;
        }

        .store-sidebar-vip-card {
            display: flex;
            align-items: center;
            gap: 11px;
            margin-top: 13px;
            padding: 11px 12px;
            border: 1px solid rgba(250, 204, 21, .22);
            border-radius: 15px;
            background:
                linear-gradient(
                    135deg,
                    rgba(250, 204, 21, .13),
                    rgba(255, 255, 255, .04)
                );
        }

        .store-sidebar-vip-badge {
            width: 43px;
            height: 43px;
            display: grid;
            flex: 0 0 43px;
            place-items: center;
            overflow: hidden;
            border-radius: 13px;
            background: rgba(250, 204, 21, .13);
            color: #facc15;
            font-size: 23px;
        }

        .store-sidebar-vip-badge img {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
        }

        .store-sidebar-vip-content {
            min-width: 0;
            flex: 1;
        }

        .store-sidebar-vip-content span,
        .store-sidebar-vip-content strong {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .store-sidebar-vip-content span {
            color: #d1d5db;
            font-size: 10px;
        }

        .store-sidebar-vip-content strong {
            margin-top: 4px;
            color: #facc15;
            font-size: 14px;
        }

        .store-sidebar-vip-rate {
            flex: 0 0 auto;
            color: #facc15;
            font-size: 11px;
            font-weight: 900;
            direction: ltr;
        }

        body.store-light-mode {
            --background: #f2f4fa;
            --surface: #ffffff;
            --surface-2: #f7f8fc;
            --surface-3: #eef1f7;
            --text: #171b29;
            --muted: #737d91;
            --border: rgba(20, 28, 48, .10);
            background: #f2f4fa;
            color: var(--text);
        }

        body.store-light-mode .store-card {
            background: #ffffff;
            box-shadow: 0 14px 35px rgba(48, 58, 90, .10);
        }


        @media (max-width: 600px) {
            :root {
                --header-height: 67px;
                --bottom-height: 72px;
            }

            .store-header-inner,
            .store-main {
                width: 93%;
            }

            .store-brand-image {
                max-width: 135px;
                height: 42px;
            }

            .store-brand-fallback {
                font-size: 19px;
            }

            .store-menu-button {
                width: 47px;
                height: 47px;
                flex-basis: 47px;
                font-size: 25px;
            }

            .store-main {
                padding-top: 17px;
            }


            .store-global-vip {
                padding: 5px 7px;
            }

            .store-global-vip-name {
                max-width: 70px;
                font-size: 10px;
            }
        }




        /* WATAN_PROGRESSIVE_IMAGES_V1
         * الصور الحقيقية لا تبدأ بالتحميل أثناء بناء الصفحة.
         * نعرض الهيكل أولاً ثم نحمل الصور تدريجياً بعد أول رسم للواجهة.
         */
        img.wtn-deferred-image {
            opacity: 0;
            transition: opacity .22s ease;
        }

        img.wtn-deferred-image.wtn-image-loaded {
            opacity: 1;
        }

        @media (prefers-reduced-motion: reduce) {
            img.wtn-deferred-image {
                transition: none;
            }
        }


/* ============================================================
   Stage 12 - cached welcome popup
   ============================================================ */
.welcome-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(7px);
}

.welcome-popup-overlay.show {
    display: flex;
}

.welcome-popup-card {
    width: min(520px, 100%);
    max-height: min(700px, 90dvh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 25px;
    background: linear-gradient(145deg, #111a31, #0b1224);
    color: #ffffff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
    animation: welcomePopupShow .28s ease;
}

.welcome-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.welcome-popup-title {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}

.welcome-popup-close-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
    font-size: 24px;
}

.welcome-popup-content {
    padding: 22px 20px;
    overflow-x: hidden;
    overflow-y: auto;
    color: #f8fafc;
    font-size: 17px;
    line-height: 2;
    overflow-wrap: anywhere;
}

.welcome-popup-content a {
    color: #60a5fa;
    text-decoration: underline;
}

.welcome-popup-content p:first-child {
    margin-top: 0;
}

.welcome-popup-content p:last-child {
    margin-bottom: 0;
}

.welcome-popup-footer {
    padding: 0 20px 20px;
}

.welcome-popup-close-button {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(
        135deg,
        var(--primary, #4f46e5),
        var(--secondary, #3b82f6)
    );
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
}

@keyframes welcomePopupShow {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ============================================================
   Stage 12 - cached home page styles
   ============================================================ */
.home-page {
        width: min(1050px, 94%);
        margin: 0 auto;
        padding: 5px 0 40px;
    }

    /* البنرات */
    .home-slider {
        position: relative;
        height: clamp(140px, 35vw, 240px);
        margin-bottom: 12px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: var(--surface);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .home-slide {
        position: absolute;
        inset: 0;
        visibility: hidden;
        opacity: 0;
        transform: scale(1.02);
        transition: opacity .5s ease, visibility .5s ease, transform .8s ease;
        display: block;
    }

    .home-slide.active {
        visibility: visible;
        opacity: 1;
        transform: scale(1);
    }

    .home-slide img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

    .home-slider-dots {
        position: absolute;
        right: 50%;
        bottom: 8px;
        z-index: 5;
        display: flex;
        align-items: center;
        gap: 5px;
        transform: translateX(50%);
        padding: 5px 10px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .home-slider-dot {
        width: 7px;
        height: 7px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: 0.3s;
    }

    .home-slider-dot.active {
        width: 20px;
        border-radius: 999px;
        background: var(--primary);
    }

    /* شريط الإعلان */
    .home-announcement {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
        padding: 8px 12px;
        overflow: hidden;
        border: 1px solid rgba(124, 58, 237, 0.2);
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), var(--surface));
        color: var(--text);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .home-announcement-icon {
        display: grid;
        flex: 0 0 34px;
        height: 34px;
        place-items: center;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        font-size: 16px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        z-index: 2;
    }

    .home-announcement-text-wrapper {
        flex: 1;
        overflow: hidden;
        position: relative;
        white-space: nowrap;
    }

    .home-announcement-text {
        display: inline-block;
        font-size: 14px;
        font-weight: 700;
        padding-right: 100%;
        animation: marquee 15s linear infinite;
    }

    @keyframes marquee {
        0% { transform: translateX(100%); }
        100% { transform: translateX(-100%); }
    }

    /* البحث */
    .home-search {
        position: relative;
        margin-bottom: 25px; /* مسافة بسيطة لترتيب العناصر بعد إزالة نصوص الأقسام */
    }

    .home-search input {
        width: 100%;
        height: 50px;
        padding: 0 55px 0 15px;
        border: 1px solid var(--border);
        border-radius: 16px;
        outline: none;
        background: var(--surface);
        color: var(--text);
        font-family: inherit;
        font-size: 14px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        transition: 0.3s;
    }

    .home-search input:focus {
        border-color: var(--primary);
        background: rgba(255, 255, 255, 0.03);
    }

    .home-search input::placeholder {
        color: var(--muted);
    }

    .home-search button {
        position: absolute;
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s;
    }

    .home-search button:active {
        transform: scale(0.95);
    }

    .home-search button svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }

    /* شبكة الأقسام */
    .home-categories {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px 10px;
    }

    @media(min-width: 600px) {
        .home-categories {
            grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
            gap: 20px 15px;
        }
    }

    /* تعديل تصميم القسم ليكون بدون خلفية ولا حواف */
    .home-category {
        content-visibility: auto;
        contain-intrinsic-size: 150px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        transition: transform 0.2s;
        text-decoration: none;
        color: inherit;
        background: transparent; /* إزالة الخلفية البيضاء */
        border: none; /* إزالة الحواف */
        padding: 0; /* إزالة المسافات الداخلية للمربع القديم */
        gap: 8px; /* مسافة بين الصورة والنص */
    }

    .home-category:hover {
        transform: translateY(-4px);
    }

    .home-category-image-wrap {
        width: 100%;
        aspect-ratio: 1;
        border-radius: 16px; /* زوايا ناعمة للصورة */
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 40px;
        color: var(--muted);
        overflow: hidden;
        background: transparent;
    }

    .home-category-image {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: inherit; /* أخذ نفس الدوران */
        transition: transform 0.3s ease;
    }

    .home-category:hover .home-category-image {
        transform: scale(1.05);
    }

    .home-category-name {
        font-size: 12px;
        font-weight: 800;
        color: var(--text);
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.4;
    }

    .home-empty {
        grid-column: 1 / -1;
        padding: 30px 20px;
        border: 1px dashed var(--border);
        border-radius: 16px;
        background: var(--surface);
        color: var(--muted);
        text-align: center;
    }
