body { 
        background-color: var(--page-bg) !important; 
        color: var(--text-color) !important;
        font-family: 'Tajawal', sans-serif !important;
        font-size: 0.86rem;
        transition: background-color 0.3s ease, color 0.3s ease; 
    }

    /* توحيد خط الصفحة بالكامل مع الهيدر وصفحات الدخول */
    .site-container,
    .site-container input,
    .site-container button,
    .site-container a,
    .site-container span,
    .site-container p,
    .site-container h1,
    .site-container h2,
    .site-container h3,
    .fancy-toast {
        font-family: 'Tajawal', sans-serif !important;
    }

    /* 🚀 تطبيق الـ Padding العام 🚀 */
    .site-container {
        max-width: 1140px; 
        margin: 0 auto; 
        padding: 0 var(--global-padding) 50px var(--global-padding) !important;
        min-height: calc(100vh - 120px);
    }

    /* 🚀 تنسيقات الإشعار الطائر (Premium Toast) 🚀 */
    .fancy-toast {
        position: fixed;
        top: 30px;
        left: 50%;
        transform: translate(-50%, -150%);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: #1e293b;
        padding: 12px 25px 12px 20px;
        border-radius: 50px;
        font-weight: 700;
        font-size: 0.84rem;
        box-shadow: 0 15px 35px rgba(0,0,0,0.1), 0 5px 15px rgba(0,0,0,0.05);
        display: flex;
        align-items: center;
        gap: 12px;
        z-index: 999999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        direction: rtl;
        border: 1px solid rgba(255,255,255,0.5);
        white-space: nowrap;
    }
    [data-theme="dark"] .fancy-toast {
        background: rgba(12, 23, 25, 0.95);
        color: #f8fafc;
        border-color: rgba(255,255,255,0.1);
        box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    }
    .fancy-toast.show {
        transform: translate(-50%, 0);
        opacity: 1;
        visibility: visible;
    }
    .fancy-toast-icon {
        background: linear-gradient(135deg, #10b981, #34d399);
        color: white;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 1.1rem;
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    }

    /* 🚀 السلايدر القابل للسحب باليد 🚀 */
    .banner-slider-wrapper {
        position: relative;
        width: 100%;
        margin-top: 20px;
        border-radius: var(--slider-radius);
        overflow: hidden;
        background-color: transparent;
        aspect-ratio: 16 / 6; 
    }
    .swipe-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; 
    }
    .swipe-container::-webkit-scrollbar { display: none; }
    
    .banner-slide {
        flex: 0 0 100%;
        scroll-snap-align: start;
        width: 100%;
        position: relative; 
        aspect-ratio: 16 / 6;
    }
    
    .main-banner {
        width: 100%;
        height: 100%; 
        object-fit: cover; 
        display: block; 
        border-radius: var(--slider-radius);
        pointer-events: none; 
        position: relative;
        z-index: 2;
        opacity: 1;
    }

    /* =====================================================================
       شريط الإعلان الهادئ — تصميم Kayan Clean Notice
       ===================================================================== */
    .super-ticker-container {
        position: relative;
        width: 100%;
        height: 47px;
        margin-top: 26px !important;
        margin-bottom: 0 !important;
        padding: 0 10px;
        display: flex;
        align-items: center;
        overflow: hidden;
        white-space: nowrap;
        box-sizing: border-box;
        direction: ltr !important;
        border: none !important;
        border-radius: 0 !important;
        outline: none !important;
        background: #ffffff !important;
        box-shadow:
            0 10px 22px -11px rgba(0, 0, 0, 0.34),
            0 -7px 18px -13px rgba(0, 0, 0, 0.20);
        transform: translateZ(0);
        will-change: transform;
        -webkit-tap-highlight-color: transparent;
    }

    /* تظليل خفيف جداً عند أطراف الشريط حتى دخول وخروج النص يبقى أنعم */
    .super-ticker-container::before,
    .super-ticker-container::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 30px;
        z-index: 3;
        pointer-events: none;
    }

    .super-ticker-container::before {
        left: 0;
        background:
            linear-gradient(
                90deg,
                #ffffff 0%,
                rgba(255, 255, 255, 0) 100%
            );
    }

    .super-ticker-container::after {
        right: 0;
        background:
            linear-gradient(
                270deg,
                #ffffff 0%,
                rgba(255, 255, 255, 0) 100%
            );
    }

    [data-theme="dark"] .super-ticker-container {
        border: none !important;
        background:
            linear-gradient(
                180deg,
                color-mix(
                    in srgb,
                    var(--ticker-bg-color, #111827) 96%,
                    #ffffff 4%
                ) 0%,
                var(--ticker-bg-color, #111827) 100%
            ) !important;
        box-shadow:
            0 11px 24px -11px rgba(0, 0, 0, 0.72),
            0 -7px 18px -13px rgba(0, 0, 0, 0.58);
    }

    [data-theme="dark"] .super-ticker-container::before {
        background:
            linear-gradient(
                90deg,
                var(--ticker-bg-color, #111827) 0%,
                rgba(17, 24, 39, 0) 100%
            );
    }

    [data-theme="dark"] .super-ticker-container::after {
        background:
            linear-gradient(
                270deg,
                var(--ticker-bg-color, #111827) 0%,
                rgba(17, 24, 39, 0) 100%
            );
    }

    .super-ticker-track {
        position: relative;
        z-index: 2;
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        width: max-content;
        min-width: max-content;
        max-width: none;
        white-space: nowrap;
        will-change: transform;
        transform: translate3d(var(--ticker-start, 100vw), 0, 0);
        animation: none !important;
        -webkit-animation: none !important;
        opacity: 0;
    }

    .super-ticker-track.ticker-ready {
        opacity: 1;
        animation:
            super-marquee-single
            var(--ticker-duration, 22s)
            linear
            var(--ticker-delay, 0s)
            infinite !important;
        -webkit-animation:
            super-marquee-single
            var(--ticker-duration, 22s)
            linear
            var(--ticker-delay, 0s)
            infinite !important;
    }

    @keyframes super-marquee-single {
        0% {
            transform: translate3d(
                var(--ticker-start, 100vw),
                0,
                0
            );
        }
        100% {
            transform: translate3d(
                var(--ticker-end, -100%),
                0,
                0
            );
        }
    }

    @-webkit-keyframes super-marquee-single {
        0% {
            -webkit-transform: translate3d(
                var(--ticker-start, 100vw),
                0,
                0
            );
        }
        100% {
            -webkit-transform: translate3d(
                var(--ticker-end, -100%),
                0,
                0
            );
        }
    }

    .super-ticker-container:hover .super-ticker-track,
    .super-ticker-container:focus-within .super-ticker-track {
        animation-play-state: running !important;
        -webkit-animation-play-state: running !important;
    }

    .super-ticker-item {
        min-height: 47px;
        padding: 0 38px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        direction: rtl !important;
        unicode-bidi: plaintext;
        flex: 0 0 auto;
        color: #000000 !important;
        font-size: 1.20rem !important;
        font-weight: 400 !important;
        line-height: 1.5;
        letter-spacing: 0;
    }

    /* نقطة صغيرة فقط بدل بادج إعلان الكبير */
    .super-ticker-item::before {
        content: "";
        width: 7px;
        height: 7px;
        flex: 0 0 auto;
        border-radius: 50%;
        background: var(--auth-color, #2563eb);
        box-shadow:
            0 0 0 4px
            color-mix(
                in srgb,
                var(--auth-color, #2563eb) 11%,
                transparent
            );
    }

    [data-theme="dark"] .super-ticker-item {
        color: #000000 !important;
    }

    @supports (-webkit-touch-callout: none) {
        .super-ticker-container {
            -webkit-transform: translate3d(0, 0, 0);
        }

        .super-ticker-track {
            -webkit-transform: translate3d(
                var(--ticker-start, 100vw),
                0,
                0
            );
            animation-delay: var(--ticker-delay, 0s) !important;
            -webkit-animation-delay: var(--ticker-delay, 0s) !important;
        }
    }

    @media (max-width: 600px) {
        .super-ticker-container {
            height: 43px;
            margin-top: 24px !important;
            padding: 0 7px;
            border-radius: 0 !important;
        }

        .super-ticker-container::before,
        .super-ticker-container::after {
            width: 22px;
        }

        .super-ticker-item {
            min-height: 43px;
            padding: 0 27px !important;
            gap: 10px;
            font-size: 1.12rem !important;
            font-weight: 400 !important;
        }

        .super-ticker-item::before {
            width: 7px;
            height: 7px;
            box-shadow:
                0 0 0 3px
                color-mix(
                    in srgb,
                    var(--auth-color, #2563eb) 10%,
                    transparent
                );
        }
    }





    /* 🔍 شريط البحث: بيضاوي 🔍 */
    .search-container {
        margin-top: 27px !important;
    }

    .search-container input {
        background-color: var(--search-bg) !important; 
        color: var(--text-color) !important; 
        border: 1px solid transparent !important; 
        padding: 15px 25px !important; 
        font-size: 1rem; 
        font-weight: 400;
        border-radius: 50px !important; 
        outline: none !important; 
        width: 100%;
        box-shadow: none !important; 
        -webkit-appearance: none; 
        transition: 0.3s ease;
    }

    [data-theme="dark"] .search-container input {
        border: 1px solid #1a2f34 !important; 
    }

    .search-container input::placeholder {
        color: #9a9a9a !important;
        font-weight: 400 !important;
        opacity: 1;
    }

    [data-theme="dark"] .search-container input::placeholder {
        color: #888888 !important; 
        font-weight: 400 !important;
    }
    
    [data-theme="dark"] .search-container input:focus {
        background-color: #0c1719 !important;
        border-color: #243e45 !important; 
        box-shadow: 0 0 10px rgba(255,255,255,0.02) !important;
    }

    /* 🚀 تنسيقات الأقسام المربعة الديناميكية 🚀 */
    .category-grid {
        margin-top: 25px; 
        display: grid !important; 
        grid-template-columns: repeat(var(--grid-cols-pc), minmax(0, 1fr)) !important; 
        column-gap: var(--grid-gap); 
        row-gap: calc(var(--grid-gap) + 4px); 
        padding-bottom: 40px;
        align-items: start;
    }

    .royal-card {
        display: flex;
        flex-direction: column;
        text-decoration: none; 
        background-color: transparent !important; 
        transition: transform 0.22s ease, filter 0.22s ease;
        height: 100%; 
        border-radius: var(--card-radius);
        overflow: hidden; 
        gap: 5px; 
        min-width: 0;
    }

    @media (hover: hover) and (pointer: fine) {
        .royal-card:hover {
            transform: translateY(-4px);
            filter: saturate(1.04);
        }
    }

    .royal-card:active { transform: scale(0.95); }

    .royal-img-wrapper {
        width: 100%;
        aspect-ratio: var(--home-aspect-ratio, 1 / 1) !important; 
        border-radius: var(--card-radius, 8px) !important; 
        overflow: hidden;
        flex-shrink: 0; 
        /* 👈 التعديل هنا: جعل الخلفية شفافة تماماً لإزالة الخط الرمادي */
        background-color: transparent !important; 
        position: relative; 
        /* 👈 التعديل هنا: تأكيد إزالة أي إطار أو ظل يحيط بالصورة */
        border: none !important;
        box-shadow: none !important;
        isolation: isolate;
    }

    .royal-img-wrapper img { 
        width: 100%; 
        height: 100%; 
        object-fit: var(--home-object-fit, cover) !important; 
        display: block;
        opacity: 1;
        position: relative;
        z-index: 2;
    }

    /* 🎨 استايل الخلفية الممتازة بديل الصور الفارغة 🎨 */
    .text-placeholder-bg {
        width: 100%;
        height: 100%;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: linear-gradient(135deg, var(--auth-color), #2563eb) !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        font-size: 0.84rem !important;
        text-align: center !important;
        padding: 12px !important;
        box-sizing: border-box !important;
        line-height: 1.4;
    }
    
    [data-theme="dark"] .text-placeholder-bg {
        background: linear-gradient(135deg, var(--box-bg), var(--search-bg)) !important;
        color: var(--text-color) !important;
        border: none !important;
    }

    /* إزالة الظل من الوضع الداكن أيضاً */
    [data-theme="dark"] .royal-img-wrapper {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .product-title, .product-name, .prod-title {
        color: var(--prod-title-color) !important;
    }

    .product-price, .price, .prod-price {
        color: var(--prod-price-color) !important;
    }

    .royal-title {
        display: flex;
        align-items: flex-start; 
        justify-content: center;
        text-align: center;
        padding: 5px 2px 5px 2px; 
    }

   .cat-title-text {
        color: var(--cat-title-color) !important; 
        margin: 0;
        font-weight: 600 !important; 
        font-size: 0.84rem; 
        line-height: 1.3; 
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* 🚀 تصميم الرسالة لو الموقع فاضي 🚀 */
    .empty-state-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 80px 20px;
        text-align: center;
        color: #94a3b8;
        grid-column: 1 / -1; 
    }
    .empty-state-box i { font-size: 4rem; opacity: 0.4; margin-bottom: 15px; }
    .empty-state-box h3 { font-size: 1.08rem; font-weight: 700; color: var(--text-color); margin-bottom: 5px; }
    .empty-state-box p { font-size: 0.83rem; font-weight: 500; margin: 0; }

    @media (max-width: 899.98px) {
        .category-grid {
            grid-template-columns: repeat(var(--grid-cols-mobile), minmax(0, 1fr)) !important; 
        }
    }

    @media (max-width: 600px) {
        .cat-title-text {
            font-size: 0.78rem !important; 
            line-height: 1.35;
        }


        .fancy-toast {
            width: calc(100% - 28px);
            max-width: 360px;
            white-space: normal;
            font-size: 0.81rem;
            padding: 10px 16px 10px 13px;
            top: 20px;
        }

        .fancy-toast-icon {
            width: 31px;
            height: 31px;
            font-size: 0.95rem;
            flex-shrink: 0;
        }
    }
    @media (max-width: 600px) {
        .site-container {
            padding-bottom: 35px !important;
        }

        .banner-slider-wrapper {
            margin-top: 14px;
        }

        .super-ticker-container {
            margin-top: 24px !important;
        }

        .search-container {
            margin-top: 24px !important;
        }

        .category-grid {
            margin-top: 20px;
            row-gap: var(--grid-gap);
            padding-bottom: 30px;
        }

        .royal-card {
            gap: 3px;
        }

        .royal-title {
            padding: 4px 2px 3px;
        }

        .text-placeholder-bg {
            font-size: 0.80rem !important;
            padding: 9px !important;
        }
    }

    /* تكبير خط شريط الإعلان على iPhone وiPad بعد جميع قواعد الموبايل */
    @supports (-webkit-touch-callout: none) {
        .super-ticker-item {
            font-size: 1.14rem !important;
            font-weight: 400 !important;
        }
    }

/* ==========================================================================
   قواعد نهائية حاسمة لشريط الإعلان
   توضع في آخر الملف حتى تتغلب على أي قاعدة قديمة توقف الحركة أو تصغر الشريط.
   ========================================================================== */
.super-ticker-container,
[data-theme="dark"] .super-ticker-container {
    height: 47px !important;
    min-height: 47px !important;
    background: #ffffff !important;
}

.super-ticker-container::before,
[data-theme="dark"] .super-ticker-container::before {
    background: linear-gradient(90deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%) !important;
}

.super-ticker-container::after,
[data-theme="dark"] .super-ticker-container::after {
    background: linear-gradient(270deg, #ffffff 0%, rgba(255, 255, 255, 0) 100%) !important;
}

.super-ticker-item,
[data-theme="dark"] .super-ticker-item {
    min-height: 47px !important;
    color: #000000 !important;
    font-size: 1.20rem !important;
    font-weight: 400 !important;
}

.super-ticker-track.ticker-ready,
.super-ticker-container:hover .super-ticker-track.ticker-ready,
.super-ticker-container:focus .super-ticker-track.ticker-ready,
.super-ticker-container:focus-within .super-ticker-track.ticker-ready,
.super-ticker-container:active .super-ticker-track.ticker-ready {
    animation-play-state: running !important;
    -webkit-animation-play-state: running !important;
}

@media (max-width: 600px) {
    .super-ticker-container,
    [data-theme="dark"] .super-ticker-container {
        height: 43px !important;
        min-height: 43px !important;
    }

    .super-ticker-item,
    [data-theme="dark"] .super-ticker-item {
        min-height: 43px !important;
        color: #000000 !important;
        font-size: 1.12rem !important;
        font-weight: 400 !important;
    }
}
