/* =====================================================================
   محرّك أنماط الصفحة الرئيسية وشكل البطاقات وطريقة التصفح (حاسوب + هاتف)
   يُتحكّم به عبر سمات html:
     data-home-layout : default | app_store | marketplace_2col | showcase_rails | bento_editorial | compact_catalog | brutalist_poster
     data-card-style  : default | glass_overlay | horizontal_split | floating_tile | neon_frame | minimal_flat
     data-hero-style  : default | compact_search | gradient_card | minimal_bar | hidden_mobile
   ===================================================================== */

/* =====================================================================
   أولاً: 6 أنماط تصفّح مختلفة كلياً للصفحة الرئيسية (index.php)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1) APP_STORE — أسلوب متجر التطبيقات (قصص دائرية للأقسام + قائمة صفّية للمنتجات)
   --------------------------------------------------------------------- */
html[data-home-layout="app_store"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 4px 2px 10px;
}
html[data-home-layout="app_store"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="app_store"] .page-storefront .category-card {
    flex: 0 0 92px !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 8px 6px !important;
    gap: 6px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    scroll-snap-align: start;
}
html[data-home-layout="app_store"] .page-storefront .category-icon {
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    border-radius: 22px !important;
    background: var(--surface, #ffffff) !important;
    border: 2px solid color-mix(in srgb, var(--primary, #4f46e5) 35%, var(--border, #e2e8f0)) !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    font-size: 1.65rem !important;
}
html[data-home-layout="app_store"] .page-storefront .category-name {
    font-size: 0.78rem !important;
    line-height: 1.25;
}
html[data-home-layout="app_store"] .page-storefront .category-meta { display: none !important; }

html[data-home-layout="app_store"] .page-storefront .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}
html[data-home-layout="app_store"] .page-storefront .product-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px !important;
    gap: 12px !important;
    border-radius: 18px !important;
}
html[data-home-layout="app_store"] .page-storefront .product-thumb {
    width: 74px !important;
    min-width: 74px !important;
    height: 74px !important;
    border-radius: 18px !important;
    flex-shrink: 0;
}
html[data-home-layout="app_store"] .page-storefront .product-thumb .digital-tag { display: none !important; }
html[data-home-layout="app_store"] .page-storefront .product-body {
    padding: 0 !important;
    gap: 4px !important;
    flex: 1;
    min-width: 0;
}
html[data-home-layout="app_store"] .page-storefront .product-title {
    font-size: 0.94rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html[data-home-layout="app_store"] .page-storefront .product-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.78rem !important;
    margin: 0 !important;
}
html[data-home-layout="app_store"] .page-storefront .product-footer {
    margin-top: 4px !important;
    padding-top: 0 !important;
    border-top: none !important;
}
html[data-home-layout="app_store"] .page-storefront .product-footer .btn {
    border-radius: 999px !important;
    padding: 6px 14px !important;
    font-size: 0.78rem !important;
}
@media (max-width: 820px) {
    html[data-home-layout="app_store"] .page-storefront .products-grid {
        grid-template-columns: 1fr !important;
        gap: 9px !important;
    }
    html[data-home-layout="app_store"] .page-storefront .product-thumb {
        width: 64px !important;
        min-width: 64px !important;
        height: 64px !important;
        border-radius: 16px !important;
    }
}

/* ---------------------------------------------------------------------
   2) MARKETPLACE_2COL — سوق كثيف (عمودان متجاوران على الهاتف / 4 على الحاسوب)
   --------------------------------------------------------------------- */
html[data-home-layout="marketplace_2col"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
}
html[data-home-layout="marketplace_2col"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="marketplace_2col"] .page-storefront .category-card {
    flex: 0 0 auto !important;
    padding: 7px 13px !important;
    border-radius: 999px !important;
    gap: 7px !important;
}
html[data-home-layout="marketplace_2col"] .page-storefront .category-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 1rem !important;
    border-radius: 50% !important;
}
html[data-home-layout="marketplace_2col"] .page-storefront .category-meta { display: none !important; }

html[data-home-layout="marketplace_2col"] .page-storefront .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}
@media (max-width: 1024px) {
    html[data-home-layout="marketplace_2col"] .page-storefront .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 768px) {
    html[data-home-layout="marketplace_2col"] .page-storefront .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-thumb {
        height: 118px !important;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-body {
        padding: 10px !important;
        gap: 5px !important;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-title {
        font-size: 0.84rem !important;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-desc { display: none !important; }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        padding-top: 7px !important;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-footer .price {
        font-size: 0.92rem !important;
    }
    html[data-home-layout="marketplace_2col"] .page-storefront .product-footer .btn {
        width: 100%;
        padding: 7px 8px !important;
        font-size: 0.76rem !important;
        text-align: center;
    }
}

/* ---------------------------------------------------------------------
   3) SHOWCASE_RAILS — رفوف سينمائية أفقية (Snap-Scroll Carousel)
   --------------------------------------------------------------------- */
html[data-home-layout="showcase_rails"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 4px 2px 10px;
}
html[data-home-layout="showcase_rails"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="showcase_rails"] .page-storefront .category-card {
    flex: 0 0 185px !important;
    scroll-snap-align: start;
    background: linear-gradient(135deg, var(--surface, #fff), var(--primary-soft, rgba(79,70,229,0.08))) !important;
    border-radius: 18px !important;
}

html[data-home-layout="showcase_rails"] .page-storefront .products-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 16px;
}
html[data-home-layout="showcase_rails"] .page-storefront .product-card {
    flex: 0 0 275px !important;
    scroll-snap-align: start;
    border-radius: 20px !important;
}
html[data-home-layout="showcase_rails"] .page-storefront .product-thumb {
    height: 175px !important;
}
@media (max-width: 640px) {
    html[data-home-layout="showcase_rails"] .page-storefront .product-card {
        flex: 0 0 78vw !important;
        max-width: 300px;
    }
    html[data-home-layout="showcase_rails"] .page-storefront .category-card {
        flex: 0 0 155px !important;
    }
}

/* ---------------------------------------------------------------------
   4) BENTO_EDITORIAL — بنتو غير متماثل (بطاقة بطل عريضة + بطاقتان 1+2)
   --------------------------------------------------------------------- */
html[data-home-layout="bento_editorial"] .page-storefront .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)) !important;
    gap: 10px !important;
}
html[data-home-layout="bento_editorial"] .page-storefront .categories-grid .category-card:first-child {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--primary, #4f46e5), var(--accent, #06b6d4)) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
html[data-home-layout="bento_editorial"] .page-storefront .categories-grid .category-card:first-child .category-name,
html[data-home-layout="bento_editorial"] .page-storefront .categories-grid .category-card:first-child .category-meta {
    color: #ffffff !important;
}

html[data-home-layout="bento_editorial"] .page-storefront .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:nth-child(4n + 1) {
    grid-column: span 2;
    flex-direction: row !important;
}
html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:nth-child(4n + 1) .product-thumb {
    width: 44% !important;
    min-width: 170px !important;
    height: auto !important;
    min-height: 210px !important;
}
@media (max-width: 768px) {
    html[data-home-layout="bento_editorial"] .page-storefront .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:nth-child(3n + 1) {
        grid-column: span 2 !important;
        flex-direction: row !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:nth-child(3n + 1) .product-thumb {
        width: 38% !important;
        min-width: 112px !important;
        min-height: 138px !important;
        height: auto !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:not(:nth-child(3n + 1)) {
        grid-column: span 1 !important;
        flex-direction: column !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:not(:nth-child(3n + 1)) .product-thumb {
        width: 100% !important;
        min-width: 0 !important;
        height: 112px !important;
        min-height: 112px !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:not(:nth-child(3n + 1)) .product-desc {
        display: none !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:not(:nth-child(3n + 1)) .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    html[data-home-layout="bento_editorial"] .page-storefront .products-grid .product-card:not(:nth-child(3n + 1)) .product-footer .btn {
        width: 100%;
        padding: 7px 8px !important;
        font-size: 0.76rem !important;
    }
}

/* ---------------------------------------------------------------------
   5) COMPACT_CATALOG — دليل سريع فائق الكثافة (مثالي للموزعين والشراء السريع)
   --------------------------------------------------------------------- */
html[data-home-layout="compact_catalog"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .category-card {
    padding: 6px 12px !important;
    border-radius: 10px !important;
    gap: 6px !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .category-icon {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    font-size: 0.95rem !important;
    background: transparent !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .category-meta { display: none !important; }

html[data-home-layout="compact_catalog"] .page-storefront .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .product-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 9px 12px !important;
    gap: 10px !important;
    border-radius: 12px !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .product-thumb {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    border-radius: 10px !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .product-thumb svg { width: 24px !important; height: 24px !important; }
html[data-home-layout="compact_catalog"] .page-storefront .product-thumb .digital-tag,
html[data-home-layout="compact_catalog"] .page-storefront .product-desc { display: none !important; }
html[data-home-layout="compact_catalog"] .page-storefront .product-body {
    padding: 0 !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex: 1;
    min-width: 0;
}
html[data-home-layout="compact_catalog"] .page-storefront .product-title {
    font-size: 0.86rem !important;
    margin: 0 !important;
}
html[data-home-layout="compact_catalog"] .page-storefront .stock-meta { display: none !important; }
html[data-home-layout="compact_catalog"] .page-storefront .product-footer {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    gap: 8px !important;
    flex-shrink: 0;
}
html[data-home-layout="compact_catalog"] .page-storefront .product-footer .btn {
    padding: 6px 11px !important;
    font-size: 0.76rem !important;
}
@media (max-width: 820px) {
    html[data-home-layout="compact_catalog"] .page-storefront .products-grid {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }
    html[data-home-layout="compact_catalog"] .page-storefront .categories-grid {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scrollbar-width: none;
    }
}

/* ---------------------------------------------------------------------
   6) BRUTALIST_POSTER — ملصقات هندسية جريئة (Neo-Brutalist Storefront)
   --------------------------------------------------------------------- */
html[data-home-layout="brutalist_poster"] .page-storefront .category-card,
html[data-home-layout="brutalist_poster"] .page-storefront .product-card {
    border-radius: 0 !important;
    border: 2.5px solid var(--text, #0f172a) !important;
    box-shadow: 5px 5px 0 var(--text, #0f172a) !important;
    transition: transform 0.14s ease, box-shadow 0.14s ease !important;
}
html[data-home-layout="brutalist_poster"] .page-storefront .category-card:hover,
html[data-home-layout="brutalist_poster"] .page-storefront .product-card:hover {
    transform: translate(-2px, -2px) !important;
    box-shadow: 7px 7px 0 var(--primary, #4f46e5) !important;
}
html[data-home-layout="brutalist_poster"] .page-storefront .product-thumb {
    border-bottom: 2.5px solid var(--text, #0f172a);
    border-radius: 0 !important;
}
html[data-home-layout="brutalist_poster"] .page-storefront .product-footer .btn {
    border-radius: 0 !important;
    border: 2px solid var(--text, #0f172a) !important;
    box-shadow: 3px 3px 0 var(--text, #0f172a) !important;
}
@media (max-width: 768px) {
    html[data-home-layout="brutalist_poster"] .page-storefront .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
    html[data-home-layout="brutalist_poster"] .page-storefront .product-thumb { height: 112px !important; }
    html[data-home-layout="brutalist_poster"] .page-storefront .product-desc { display: none !important; }
    html[data-home-layout="brutalist_poster"] .page-storefront .product-body { padding: 10px !important; }
    html[data-home-layout="brutalist_poster"] .page-storefront .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    html[data-home-layout="brutalist_poster"] .page-storefront .product-footer .btn {
        width: 100%;
        padding: 7px 8px !important;
        font-size: 0.76rem !important;
    }
}

/* =====================================================================
   ثانياً: 6 أشكال مستقلة للبطاقات (Card Styles — تعمل مع أي نمط تصفح)
   ===================================================================== */

/* 1) GLASS_OVERLAY — صورة بارزة مع طبقة سفلية زجاجية */
html[data-card-style="glass_overlay"] .page-storefront .product-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px !important;
    background: var(--surface, #ffffff);
}
html[data-card-style="glass_overlay"] .page-storefront .product-thumb {
    background: linear-gradient(160deg, var(--primary, #4f46e5), color-mix(in srgb, var(--accent, #06b6d4) 75%, #0f172a)) !important;
    color: #ffffff !important;
}
html[data-card-style="glass_overlay"] .page-storefront .product-body {
    margin-top: -18px;
    position: relative;
    z-index: 2;
    background: var(--surface-glass, rgba(255, 255, 255, 0.92));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 18px 18px 0 0;
    border-top: 1px solid var(--border, #e2e8f0);
}

/* 2) HORIZONTAL_SPLIT — بطاقة أفقية مقسومة */
html[data-card-style="horizontal_split"] .page-storefront .product-card {
    flex-direction: row !important;
    align-items: stretch !important;
}
html[data-card-style="horizontal_split"] .page-storefront .product-thumb {
    width: 126px !important;
    min-width: 126px !important;
    height: auto !important;
    min-height: 130px !important;
}
@media (max-width: 640px) {
    html[data-card-style="horizontal_split"] .page-storefront .products-grid {
        grid-template-columns: 1fr !important;
    }
    html[data-card-style="horizontal_split"] .page-storefront .product-thumb {
        width: 108px !important;
        min-width: 108px !important;
        min-height: 112px !important;
    }
}

/* 3) FLOATING_TILE — بلاطة بصورة عائمة مستديرة في الأعلى */
html[data-card-style="floating_tile"] .page-storefront .product-card {
    padding: 12px !important;
    border-radius: 22px !important;
    background: var(--surface, #ffffff);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07) !important;
}
html[data-card-style="floating_tile"] .page-storefront .product-thumb {
    border-radius: 16px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
html[data-card-style="floating_tile"] .page-storefront .product-body {
    padding: 12px 4px 2px !important;
}

/* 4) NEON_FRAME — إطار بحافة لونية مضيئة وشريط سعر بارز */
html[data-card-style="neon_frame"] .page-storefront .product-card,
html[data-card-style="neon_frame"] .page-storefront .category-card {
    border-inline-start: 4px solid var(--primary, #4f46e5) !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary, #4f46e5) 14%, transparent) !important;
}
html[data-card-style="neon_frame"] .page-storefront .product-footer .price {
    color: var(--primary, #4f46e5) !important;
    font-weight: 900 !important;
}

/* 5) MINIMAL_FLAT — مسطّح فائق البساطة بدون ظلال */
html[data-card-style="minimal_flat"] .page-storefront .product-card,
html[data-card-style="minimal_flat"] .page-storefront .category-card {
    box-shadow: none !important;
    background: var(--bg-subtle, #f8fafc) !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    border-radius: 12px !important;
}
html[data-card-style="minimal_flat"] .page-storefront .product-card:hover {
    background: var(--surface, #ffffff) !important;
    border-color: var(--primary, #4f46e5) !important;
}

/* =====================================================================
   ثالثاً: 4 أشكال للهيرو (Hero Styles)
   ===================================================================== */
html[data-hero-style="compact_search"] .page-storefront .hero,
html[data-hero-style="compact_search"] .page-storefront .dyn-hero {
    padding: 16px 0 12px !important;
    min-height: 0 !important;
}
html[data-hero-style="compact_search"] .page-storefront :is(.hero-badge, .hero-subtitle, .trust-pills, .dyn-hero-badge, .dyn-hero-sub, .dyn-hero-pills, .dyn-hero-metrics) {
    display: none !important;
}
html[data-hero-style="compact_search"] .page-storefront :is(.hero h1, .dyn-hero h1) {
    font-size: 1.25rem !important;
    margin-bottom: 10px !important;
}

html[data-hero-style="gradient_card"] .page-storefront .hero,
html[data-hero-style="gradient_card"] .page-storefront .dyn-hero {
    margin: 14px auto 8px !important;
    max-width: 1240px;
    border-radius: 26px !important;
    background: linear-gradient(135deg, var(--primary, #4f46e5), var(--accent, #06b6d4)) !important;
    color: #ffffff !important;
    padding: 28px 22px !important;
    box-shadow: 0 18px 40px color-mix(in srgb, var(--primary, #4f46e5) 28%, transparent);
}
html[data-hero-style="gradient_card"] .page-storefront :is(.hero, .dyn-hero) :is(h1, p, span, div) {
    color: #ffffff !important;
}
@media (max-width: 768px) {
    html[data-hero-style="gradient_card"] .page-storefront .hero,
    html[data-hero-style="gradient_card"] .page-storefront .dyn-hero {
        margin: 10px 12px 6px !important;
        padding: 20px 16px !important;
        border-radius: 20px !important;
    }
}

html[data-hero-style="minimal_bar"] .page-storefront .hero,
html[data-hero-style="minimal_bar"] .page-storefront .dyn-hero {
    padding: 10px 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
html[data-hero-style="minimal_bar"] .page-storefront :is(.hero h1, .hero-badge, .hero-subtitle, .trust-pills, .dyn-hero h1, .dyn-hero-badge, .dyn-hero-sub, .dyn-hero-pills, .dyn-hero-metrics) {
    display: none !important;
}

@media (max-width: 768px) {
    html[data-hero-style="hidden_mobile"] .page-storefront .hero,
    html[data-hero-style="hidden_mobile"] .page-storefront .dyn-hero {
        display: none !important;
    }
}

/* =====================================================================
   رابعاً: شريط التطبيق السفلي الأصلي للمتجر على الهاتف (Native Storefront Bottom Nav)
   ===================================================================== */
.sf-mob-appbar { display: none; }
.sf-mob-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
}
.sf-mob-search-overlay.open { display: flex; }
.sf-mob-search-box {
    width: 100%;
    max-width: 520px;
    margin-top: 10vh;
    background: var(--surface, #ffffff);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

@media (max-width: 860px) {
    html[data-mobile-appbar="1"] body.page-storefront {
        padding-bottom: 76px !important;
    }
    html[data-mobile-appbar="1"] .sf-mob-appbar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        inset-inline: 0;
        z-index: 970;
        background: var(--surface-glass, rgba(255, 255, 255, 0.94));
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid var(--border, #e2e8f0);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        padding: 6px 8px calc(7px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: center;
        gap: 4px;
    }
    .sf-mob-appbar-btn {
        position: relative;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 4px;
        border-radius: 12px;
        border: none;
        background: transparent;
        color: var(--muted, #64748b);
        font-family: inherit;
        font-size: 0.68rem;
        font-weight: 800;
        text-decoration: none;
        cursor: pointer;
        transition: background 0.14s ease, color 0.14s ease;
    }
    .sf-mob-appbar-btn .ic { font-size: 1.18rem; line-height: 1; }
    .sf-mob-appbar-btn.active {
        color: var(--primary, #4f46e5);
        background: var(--primary-soft, rgba(79, 70, 229, 0.12));
    }
    .sf-mob-appbar-badge {
        position: absolute;
        top: 2px;
        inset-inline-end: 18%;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--danger, #ef4444);
        color: #fff;
        font-size: 0.64rem;
        font-weight: 800;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* =====================================================================
   6 أشكال إضافية للصفحة الرئيسية (المجموع 13) + 4 أشكال بطاقات (المجموع 10)
   ===================================================================== */

/* ---------------------------------------------------------------------
   7) GAMING_STORE — متجر الألعاب والبطاقات (أغلفة طولية متوهجة)
   --------------------------------------------------------------------- */
html[data-home-layout="gaming_store"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 2px 10px;
}
html[data-home-layout="gaming_store"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="gaming_store"] .page-storefront .category-card {
    flex: 0 0 auto !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1.5px solid color-mix(in srgb, var(--primary, #4f46e5) 55%, #1e293b) !important;
    border-radius: 14px !important;
    padding: 8px 14px !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
html[data-home-layout="gaming_store"] .page-storefront .category-name { color: #ffffff !important; }
html[data-home-layout="gaming_store"] .page-storefront .category-meta { color: #94a3b8 !important; }

html[data-home-layout="gaming_store"] .page-storefront .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
html[data-home-layout="gaming_store"] .page-storefront .product-card {
    background: #0b1120 !important;
    color: #f8fafc !important;
    border: 1.5px solid color-mix(in srgb, var(--primary, #4f46e5) 40%, #1e293b) !important;
    border-radius: 18px !important;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.35) !important;
}
html[data-home-layout="gaming_store"] .page-storefront .product-thumb {
    height: 195px !important;
    background: radial-gradient(circle at top, color-mix(in srgb, var(--primary, #4f46e5) 45%, #0f172a), #090d16) !important;
}
html[data-home-layout="gaming_store"] .page-storefront .product-title { color: #ffffff !important; }
html[data-home-layout="gaming_store"] .page-storefront .product-desc,
html[data-home-layout="gaming_store"] .page-storefront .stock-meta { color: #94a3b8 !important; }
html[data-home-layout="gaming_store"] .page-storefront .product-footer {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-home-layout="gaming_store"] .page-storefront .product-footer .price {
    color: var(--accent, #38bdf8) !important;
}
@media (max-width: 960px) {
    html[data-home-layout="gaming_store"] .page-storefront .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    html[data-home-layout="gaming_store"] .page-storefront .product-thumb { height: 138px !important; }
    html[data-home-layout="gaming_store"] .page-storefront .product-desc { display: none !important; }
    html[data-home-layout="gaming_store"] .page-storefront .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    html[data-home-layout="gaming_store"] .page-storefront .product-footer .btn { width: 100%; font-size: 0.78rem !important; }
}

/* ---------------------------------------------------------------------
   8) NETFLIX_ROWS — صفوف العرض العريضة (16:9 Media Snap Cards)
   --------------------------------------------------------------------- */
html[data-home-layout="netflix_rows"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 8px;
}
html[data-home-layout="netflix_rows"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="netflix_rows"] .page-storefront .category-card {
    flex: 0 0 170px !important;
    border-radius: 12px !important;
    border-bottom: 3px solid var(--primary, #4f46e5) !important;
}
html[data-home-layout="netflix_rows"] .page-storefront .products-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 2px 18px;
}
html[data-home-layout="netflix_rows"] .page-storefront .product-card {
    flex: 0 0 320px !important;
    scroll-snap-align: start;
    border-radius: 14px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
html[data-home-layout="netflix_rows"] .page-storefront .product-card:hover {
    transform: scale(1.03) !important;
    z-index: 4;
}
html[data-home-layout="netflix_rows"] .page-storefront .product-thumb {
    aspect-ratio: 16 / 9;
    height: auto !important;
}
@media (max-width: 640px) {
    html[data-home-layout="netflix_rows"] .page-storefront .product-card { flex: 0 0 84vw !important; }
}

/* ---------------------------------------------------------------------
   9) SOCIAL_FEED — خلاصة التسوّق (بطاقة كاملة فخمة مع زر شراء عريض)
   --------------------------------------------------------------------- */
html[data-home-layout="social_feed"] .page-storefront .categories-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 6px;
}
html[data-home-layout="social_feed"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
html[data-home-layout="social_feed"] .page-storefront .category-card {
    flex: 0 0 auto !important;
    border-radius: 999px !important;
    padding: 7px 14px !important;
}
html[data-home-layout="social_feed"] .page-storefront .category-meta { display: none !important; }

html[data-home-layout="social_feed"] .page-storefront .products-grid {
    max-width: 820px;
    margin-inline: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
}
html[data-home-layout="social_feed"] .page-storefront .product-card {
    border-radius: 24px !important;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
}
html[data-home-layout="social_feed"] .page-storefront .product-thumb { height: 220px !important; }
html[data-home-layout="social_feed"] .page-storefront .product-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
}
html[data-home-layout="social_feed"] .page-storefront .product-footer .btn {
    width: 100%;
    padding: 11px 16px !important;
    border-radius: 14px !important;
    font-size: 0.92rem !important;
}
@media (max-width: 720px) {
    html[data-home-layout="social_feed"] .page-storefront .products-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    html[data-home-layout="social_feed"] .page-storefront .product-thumb { height: 210px !important; }
}

/* ---------------------------------------------------------------------
   10) TICKET_DEALS — قسائم وتذاكر العروض (خط قطع متقطّع وشكل تذكرة)
   --------------------------------------------------------------------- */
html[data-home-layout="ticket_deals"] .page-storefront .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}
html[data-home-layout="ticket_deals"] .page-storefront .product-card {
    border-radius: 16px !important;
    border: 1.5px dashed color-mix(in srgb, var(--primary, #4f46e5) 50%, var(--border, #cbd5e1)) !important;
    position: relative;
    overflow: visible !important;
}
html[data-home-layout="ticket_deals"] .page-storefront .product-footer {
    border-top: 2px dashed var(--border, #cbd5e1) !important;
    margin-top: 10px !important;
    padding-top: 12px !important;
}
@media (max-width: 820px) {
    html[data-home-layout="ticket_deals"] .page-storefront .products-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    html[data-home-layout="ticket_deals"] .page-storefront .product-card {
        flex-direction: row !important;
        align-items: center !important;
        padding: 10px !important;
        gap: 10px !important;
    }
    html[data-home-layout="ticket_deals"] .page-storefront .product-thumb {
        width: 78px !important;
        min-width: 78px !important;
        height: 78px !important;
        border-radius: 12px !important;
    }
    html[data-home-layout="ticket_deals"] .page-storefront .product-body { padding: 0 !important; }
    html[data-home-layout="ticket_deals"] .page-storefront .product-desc { display: none !important; }
}

/* ---------------------------------------------------------------------
   11) SIDEBAR_CATALOG — الكتالوج المقسوم (أقسام جانبية على المكتب + شريط مثبّت على الهاتف)
   --------------------------------------------------------------------- */
@media (min-width: 960px) {
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container {
        display: grid;
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 22px;
        align-items: start;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container > * {
        grid-column: 1 / -1;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container > #categories-section,
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container > section:has(.categories-grid) {
        grid-column: 1 !important;
        position: sticky;
        top: 84px;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container > #products-section,
    html[data-home-layout="sidebar_catalog"] .page-storefront main.container > section:has(.products-grid) {
        grid-column: 2 !important;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 959px) {
    html[data-home-layout="sidebar_catalog"] .page-storefront .categories-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 6px;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .categories-grid::-webkit-scrollbar { display: none; }
    html[data-home-layout="sidebar_catalog"] .page-storefront .category-card {
        flex: 0 0 auto !important;
        border-radius: 12px !important;
        padding: 7px 12px !important;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .product-thumb { height: 118px !important; }
    html[data-home-layout="sidebar_catalog"] .page-storefront .product-desc { display: none !important; }
    html[data-home-layout="sidebar_catalog"] .page-storefront .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    html[data-home-layout="sidebar_catalog"] .page-storefront .product-footer .btn { width: 100%; font-size: 0.76rem !important; }
}

/* ---------------------------------------------------------------------
   12) MOSAIC_MASONRY — الفسيفساء المتدرّجة (ارتفاعات متبادلة جذابة)
   --------------------------------------------------------------------- */
html[data-home-layout="mosaic_masonry"] .page-storefront .products-grid {
    display: block !important;
    column-count: 3;
    column-gap: 14px;
}
html[data-home-layout="mosaic_masonry"] .page-storefront .product-card {
    break-inside: avoid;
    margin-bottom: 14px;
    border-radius: 20px !important;
}
html[data-home-layout="mosaic_masonry"] .page-storefront .product-card:nth-child(odd) .product-thumb {
    height: 190px !important;
}
html[data-home-layout="mosaic_masonry"] .page-storefront .product-card:nth-child(even) .product-thumb {
    height: 125px !important;
}
@media (max-width: 820px) {
    html[data-home-layout="mosaic_masonry"] .page-storefront .products-grid {
        column-count: 2;
        column-gap: 10px;
    }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-card { margin-bottom: 10px; }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-card:nth-child(odd) .product-thumb { height: 146px !important; }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-card:nth-child(even) .product-thumb { height: 96px !important; }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-desc { display: none !important; }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-body { padding: 10px !important; }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    html[data-home-layout="mosaic_masonry"] .page-storefront .product-footer .btn { width: 100%; font-size: 0.75rem !important; }
}

/* =====================================================================
   4 أشكال إضافية لبطاقة المنتج (المجموع 10 أشكال بطاقات)
   ===================================================================== */

/* 6) TICKET_NOTCH — بطاقة قسيمة بخط متقطّع */
html[data-card-style="ticket_notch"] .page-storefront .product-card {
    border: 1.5px dashed color-mix(in srgb, var(--primary, #4f46e5) 55%, var(--border, #cbd5e1)) !important;
    border-radius: 16px !important;
}
html[data-card-style="ticket_notch"] .page-storefront .product-footer {
    border-top: 1.5px dashed var(--border, #cbd5e1) !important;
}

/* 7) TACTILE_3D — بطاقة بارزة ثلاثية الأبعاد بظل سفلي سميك */
html[data-card-style="tactile_3d"] .page-storefront .product-card,
html[data-card-style="tactile_3d"] .page-storefront .category-card {
    border-radius: 18px !important;
    border: 2px solid var(--border, #cbd5e1) !important;
    border-bottom: 5px solid color-mix(in srgb, var(--primary, #4f46e5) 50%, var(--border, #cbd5e1)) !important;
    box-shadow: none !important;
    transition: transform 0.14s ease !important;
}
html[data-card-style="tactile_3d"] .page-storefront .product-card:hover {
    transform: translateY(-3px) !important;
}

/* 8) DARK_SPOTLIGHT — بطاقة داكنة فاخرة بتوهّج علوي */
html[data-card-style="dark_spotlight"] .page-storefront .product-card {
    background: radial-gradient(circle at top center, color-mix(in srgb, var(--primary, #4f46e5) 24%, #0f172a), #0b1120 68%) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
}
html[data-card-style="dark_spotlight"] .page-storefront .product-title { color: #ffffff !important; }
html[data-card-style="dark_spotlight"] .page-storefront .product-desc,
html[data-card-style="dark_spotlight"] .page-storefront .stock-meta { color: #94a3b8 !important; }
html[data-card-style="dark_spotlight"] .page-storefront .product-footer { border-top-color: rgba(255, 255, 255, 0.1) !important; }
html[data-card-style="dark_spotlight"] .page-storefront .product-footer .price { color: var(--accent, #38bdf8) !important; }

/* 9) BORDERED_PILL — حواف دائرية عميقة وإطار مزدوج ناعم */
html[data-card-style="bordered_pill"] .page-storefront .product-card {
    border-radius: 28px !important;
    padding: 8px !important;
    border: 2px solid color-mix(in srgb, var(--primary, #4f46e5) 28%, var(--border, #e2e8f0)) !important;
    box-shadow: 0 0 0 3px var(--surface, #ffffff) inset !important;
}
html[data-card-style="bordered_pill"] .page-storefront .product-thumb {
    border-radius: 22px !important;
    overflow: hidden;
}
