/* ==========================================================================
   Modern Grid Menu Theme Stylesheet (القالب العصري الشبكي)
   - Category Grid: 2 columns in mobile (<= 850px), 3 columns in desktop (> 850px)
   - Vertical Product Card layout (Image -> Title & Description -> Price & Action)
   - Seamless Light & Dark Mode support
   ========================================================================== */

.menu-page.theme-layout-modern-grid,
.theme-layout-modern-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    background-color: var(--theme-menu-bg, #ffffff) !important;
    color: var(--theme-text-title, #0f172a);
    font-family: 'Tajawal', sans-serif;
    padding-bottom: 0 !important;
    box-shadow: none !important;
}

/* Banner Slider / Cover Section - Flush against top, left, and right edges */
.theme-layout-modern-grid .flame-slider-container {
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
    background: #0f172a !important;
}

.theme-layout-modern-grid .flame-slider-wrapper {
    position: relative;
    width: 100%;
    height: 185px;
    overflow: hidden;
}

@media (min-width: 768px) {

    .theme-layout-modern-grid .flame-slider-wrapper,
    .theme-layout-modern-grid .store-cover-slideshow {
        height: 220px !important;
    }
}

.theme-layout-modern-grid .flame-slider-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.theme-layout-modern-grid .flame-slider-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--theme-primary-btn, #10b981) 0%, var(--theme-price-tag, #059669) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ffffff;
}

/* =============================================
   Store Cover Slideshow (سلايد شو الغلاف التفاعلي)
   ============================================= */
.theme-layout-modern-grid .store-cover-slideshow {
    position: relative;
    width: 100%;
    height: 185px;
    overflow: hidden;
    background: #0f172a;
    border-radius: 0 !important;
    user-select: none;
    -webkit-user-select: none;
}

.theme-layout-modern-grid .cover-slideshow-track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.theme-layout-modern-grid .cover-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
    z-index: 1;
}

.theme-layout-modern-grid .cover-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.theme-layout-modern-grid .cover-slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0 !important;
    transform: scale(1);
    transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}

.theme-layout-modern-grid .cover-slide.active .cover-slide-img {
    transform: scale(1.04);
}

/* Floating Capsule Indicator */
.theme-layout-modern-grid .cover-slideshow-dots-capsule {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    background: rgba(30, 25, 20, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 12px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: auto;
}

.theme-layout-modern-grid .cover-slideshow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
    box-shadow: none;
}

.theme-layout-modern-grid .cover-slideshow-dot:hover {
    background: rgba(255, 255, 255, 0.75);
}

.theme-layout-modern-grid .cover-slideshow-dot.active {
    width: 22px;
    height: 8px;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: none;
}

/* Profile Card Below Slider */
.theme-layout-modern-grid .flame-profile-card {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    border-radius: 0 0 20px 20px !important;
    background: var(--theme-header-bg, var(--theme-card-bg, #ffffff)) !important;
    border-bottom: 1px solid var(--theme-card-border, #e2e8f0) !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.theme-layout-modern-grid .flame-profile-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-layout-modern-grid .flame-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid var(--theme-card-border, #e2e8f0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.theme-layout-modern-grid .flame-info-column {
    flex: 1;
}

.theme-layout-modern-grid .flame-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.theme-layout-modern-grid .flame-store-name {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--theme-text-title, #0f172a);
    margin: 0;
    line-height: 1.3;
}

.theme-layout-modern-grid .flame-status-badge,
.theme-layout-modern-grid .header-status-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
}

.theme-layout-modern-grid .flame-store-desc {
    font-family: 'Tajawal', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--theme-text-body, #475569);
    margin: 6px 0 0 0;
    line-height: 1.5;
}

/* ==========================================================================
   Branch Selector Widget Styles (أنماط شريط اختيار الفرع الثلاثة)
   - Style 1: .branch-style-capsule
   - Style 2: .branch-style-app
   - Style 3: .branch-style-pills
   ========================================================================== */
.theme-layout-modern-grid .branch-selector-container {
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px dashed var(--theme-card-border, rgba(226, 232, 240, 0.8)) !important;
}

.theme-layout-modern-grid .branch-switcher-widget {
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    border-radius: 13px !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* 1. النمط الكبسولي التفاعلي (Capsule Bar) */
.theme-layout-modern-grid .branch-style-capsule {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 7px 12px !important;
    background: rgba(37, 99, 235, 0.06) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
    border-radius: 13px !important;
}
.theme-layout-modern-grid .branch-style-capsule:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    transform: translateY(-1px) !important;
}
.theme-layout-modern-grid .branch-style-capsule .branch-widget-info {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-capsule .branch-widget-icon {
    font-size: 1.05rem !important;
    line-height: 1 !important;
}
.theme-layout-modern-grid .branch-style-capsule .branch-widget-label {
    font-size: 0.8rem !important;
    color: var(--theme-text-body, #64748b) !important;
    font-weight: 600 !important;
}
.theme-layout-modern-grid .branch-style-capsule .branch-widget-name {
    font-size: 0.88rem !important;
    color: var(--theme-text-title, #0f172a) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.theme-layout-modern-grid .branch-style-capsule .branch-action-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 11px !important;
    border-radius: 10px !important;
    background: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* 2. شريط الاختيار الذكي (App Style) */
.theme-layout-modern-grid .branch-style-app {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 14px !important;
    background: var(--theme-card-bg, #ffffff) !important;
    border: 1.5px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}
.theme-layout-modern-grid .branch-style-app:hover {
    border-color: var(--theme-primary-btn, #2563eb) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.1) !important;
    transform: translateY(-1px) !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-start {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px !important;
    background: rgba(37, 99, 235, 0.1) !important;
    color: var(--theme-primary-btn, #2563eb) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-text {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.25 !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-sub {
    font-size: 0.7rem !important;
    color: var(--theme-text-body, #64748b) !important;
    font-weight: 600 !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-title {
    font-size: 0.88rem !important;
    color: var(--theme-text-title, #0f172a) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.theme-layout-modern-grid .branch-style-app .branch-app-end {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: var(--theme-primary-btn, #2563eb) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
}

/* 3. كبسولات التبديل السريع (Pill Tabs) */
.theme-layout-modern-grid .branch-style-pills {
    display: block !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pills-scroll {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 2px 0 !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pills-scroll::-webkit-scrollbar {
    display: none !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pills-label {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-inline-end: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pill-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    background: var(--theme-card-bg, #f8fafc) !important;
    border: 1.5px solid var(--theme-card-border, #e2e8f0) !important;
    color: var(--theme-text-body, #475569) !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-height: 36px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pill-item:hover {
    border-color: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn, #2563eb) !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pill-item.active {
    background: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    border-color: var(--theme-primary-btn, #2563eb) !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25) !important;
    font-weight: 800 !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pill-check {
    font-size: 0.85rem !important;
    font-weight: 900 !important;
}
.theme-layout-modern-grid .branch-style-pills .branch-pill-more {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
    color: var(--theme-primary-btn, #2563eb) !important;
}

/* 4. بطاقة الفرع الذكية مع الحالة (Smart Status & Location Card) */
.theme-layout-modern-grid .branch-style-status {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 9px 14px !important;
    background: var(--theme-card-bg, #ffffff) !important;
    border: 1.5px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}
.theme-layout-modern-grid .branch-style-status:hover {
    border-color: var(--theme-primary-btn, #2563eb) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12) !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-start {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: rgba(37, 99, 235, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
    flex-shrink: 0 !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-info {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.25 !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-name {
    font-size: 0.9rem !important;
    color: var(--theme-text-title, #0f172a) !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 0.72rem !important;
    color: #10b981 !important;
    font-weight: 700 !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: #10b981 !important;
    display: inline-block !important;
}
.theme-layout-modern-grid .branch-style-status .branch-status-badge {
    padding: 6px 12px !important;
    border-radius: 20px !important;
    background: rgba(37, 99, 235, 0.08) !important;
    color: var(--theme-primary-btn, #2563eb) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* 5. المفتاح المنزلق بأسلوب آبل (iOS Segmented Switcher) */
.theme-layout-modern-grid .branch-style-segmented {
    display: block !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}
.theme-layout-modern-grid .branch-style-segmented .branch-segmented-track {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: rgba(0, 0, 0, 0.05) !important;
    padding: 4px !important;
    border-radius: 30px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
}
.theme-layout-modern-grid .branch-style-segmented .branch-segmented-track::-webkit-scrollbar {
    display: none !important;
}
.theme-layout-modern-grid .branch-style-segmented .branch-segment-item {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 7px 16px !important;
    border-radius: 24px !important;
    color: var(--theme-text-body, #64748b) !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border: none !important;
    background: transparent !important;
    cursor: pointer !important;
}
.theme-layout-modern-grid .branch-style-segmented .branch-segment-item.active {
    background: var(--theme-card-bg, #ffffff) !important;
    color: var(--theme-text-title, #0f172a) !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}
.theme-layout-modern-grid .branch-style-segmented .branch-segment-more {
    color: var(--theme-primary-btn, #2563eb) !important;
    font-weight: 800 !important;
}

/* 6. الشريط المتوهج العصري (Modern Glow Bar) */
.theme-layout-modern-grid .branch-style-glow {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 9px 14px !important;
    border: 2px solid transparent !important;
    background: linear-gradient(var(--theme-card-bg, #ffffff), var(--theme-card-bg, #ffffff)) padding-box, linear-gradient(135deg, var(--theme-primary-btn, #2563eb), #8b5cf6, #ec4899) border-box !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.1) !important;
}
.theme-layout-modern-grid .branch-style-glow:hover {
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.2) !important;
    transform: translateY(-1px) !important;
}
.theme-layout-modern-grid .branch-style-glow .branch-glow-info {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
}
.theme-layout-modern-grid .branch-style-glow .branch-glow-icon {
    font-size: 1.05rem !important;
}
.theme-layout-modern-grid .branch-style-glow .branch-glow-label {
    font-size: 0.78rem !important;
    color: var(--theme-text-body, #64748b) !important;
    font-weight: 600 !important;
}
.theme-layout-modern-grid .branch-style-glow .branch-glow-name {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
}
.theme-layout-modern-grid .branch-style-glow .branch-glow-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, var(--theme-primary-btn, #2563eb), #8b5cf6) !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* 7. شريط الفرع مع رابط الخريطة (Branch + Map Action Bar) */
.theme-layout-modern-grid .branch-style-map {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 8px 12px !important;
    background: var(--theme-card-bg, #ffffff) !important;
    border: 1.5px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 14px !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-info {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    cursor: pointer !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-icon {
    font-size: 1.05rem !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-name {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-btn-map {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    border-radius: 9px !important;
    background: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}
.theme-layout-modern-grid .branch-style-map .branch-map-btn-switch {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 5px 10px !important;
    border-radius: 9px !important;
    background: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    border: none !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

/* 8. الكبسولة الزجاجية الفاخرة (Glassmorphic Minimal Pill) */
.theme-layout-modern-grid .branch-style-minimal {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    padding: 2px 0 !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-pill-body {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 18px !important;
    border-radius: 30px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid var(--theme-card-border, rgba(226, 232, 240, 0.9)) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-pill-body:hover {
    border-color: var(--theme-primary-btn, #2563eb) !important;
    transform: translateY(-1px) !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-icon {
    font-size: 1rem !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-name {
    font-size: 0.86rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-divider {
    color: var(--theme-card-border, #cbd5e1) !important;
    font-weight: 300 !important;
}
.theme-layout-modern-grid .branch-style-minimal .branch-minimal-action {
    color: var(--theme-primary-btn, #2563eb) !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
}

/* التوافق التام مع الوضع الليلي (Dark Mode) */
body.theme-mode-dark .theme-layout-modern-grid .branch-style-capsule,
.theme-mode-dark .theme-layout-modern-grid .branch-style-capsule,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-capsule {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-app,
.theme-mode-dark .theme-layout-modern-grid .branch-style-app,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-app {
    background: var(--theme-card-bg, #1e293b) !important;
    border-color: var(--theme-card-border, #334155) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-pills .branch-pill-item,
.theme-mode-dark .theme-layout-modern-grid .branch-style-pills .branch-pill-item,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-pills .branch-pill-item {
    background: var(--theme-card-bg, #1e293b) !important;
    border-color: var(--theme-card-border, #334155) !important;
    color: var(--theme-text-body, #cbd5e1) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-status,
.theme-mode-dark .theme-layout-modern-grid .branch-style-status,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-status {
    background: var(--theme-card-bg, #1e293b) !important;
    border-color: var(--theme-card-border, #334155) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-segmented .branch-segmented-track,
.theme-mode-dark .theme-layout-modern-grid .branch-style-segmented .branch-segmented-track,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-segmented .branch-segmented-track {
    background: rgba(255, 255, 255, 0.08) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-segmented .branch-segment-item.active,
.theme-mode-dark .theme-layout-modern-grid .branch-style-segmented .branch-segment-item.active,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-segmented .branch-segment-item.active {
    background: var(--theme-card-bg, #1e293b) !important;
    color: #ffffff !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-glow,
.theme-mode-dark .theme-layout-modern-grid .branch-style-glow,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-glow {
    background: linear-gradient(var(--theme-card-bg, #1e293b), var(--theme-card-bg, #1e293b)) padding-box, linear-gradient(135deg, var(--theme-primary-btn, #3b82f6), #8b5cf6, #ec4899) border-box !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-map,
.theme-mode-dark .theme-layout-modern-grid .branch-style-map,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-map {
    background: var(--theme-card-bg, #1e293b) !important;
    border-color: var(--theme-card-border, #334155) !important;
}
body.theme-mode-dark .theme-layout-modern-grid .branch-style-minimal .branch-minimal-pill-body,
.theme-mode-dark .theme-layout-modern-grid .branch-style-minimal .branch-minimal-pill-body,
[data-theme="dark"] .theme-layout-modern-grid .branch-style-minimal .branch-minimal-pill-body {
    background: rgba(30, 41, 59, 0.85) !important;
    border-color: rgba(51, 65, 85, 0.9) !important;
}
body.theme-mode-dark .about-social-bar,
.theme-mode-dark .about-social-bar,
[data-theme="dark"] .about-social-bar {
    background: transparent !important;
    border: none !important;
}
body.theme-mode-dark .about-social-btn,
.theme-mode-dark .about-social-btn,
[data-theme="dark"] .about-social-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: none !important;
    color: var(--theme-text-title, #f8fafc) !important;
}
body.theme-mode-dark .header-map-btn,
.theme-mode-dark .header-map-btn,
[data-theme="dark"] .header-map-btn {
    background: rgba(16, 185, 129, 0.16) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #34d399 !important;
}

/* Compact Live Search Section */
.theme-layout-modern-grid .menu-search-section {
    padding: 6px 16px 4px 16px !important;
    margin: 0 !important;
    background: transparent !important;
}

.theme-layout-modern-grid .search-wrapper {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.theme-layout-modern-grid .search-wrapper .search-icon {
    position: absolute !important;
    left: 14px !important;
    right: auto !important;
    color: #94a3b8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    transition: color 0.2s ease !important;
}

.theme-layout-modern-grid .search-wrapper .search-icon svg {
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
}

[dir="ltr"] .theme-layout-modern-grid .search-wrapper .search-icon {
    left: auto !important;
    right: 14px !important;
}

.theme-layout-modern-grid .search-wrapper .search-input {
    width: 100% !important;
    height: 38px !important;
    padding: 8px 14px 8px 38px !important;
    border: 1.5px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 12px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.86rem !important;
    color: var(--theme-text-title, #0f172a) !important;
    background-color: var(--theme-card-bg, #f8fafc) !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

[dir="ltr"] .theme-layout-modern-grid .search-wrapper .search-input {
    padding: 8px 38px 8px 14px !important;
}

.theme-layout-modern-grid .search-wrapper .search-input:focus {
    border-color: var(--theme-primary-btn, #10b981) !important;
    background-color: var(--theme-card-bg, #ffffff) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.theme-layout-modern-grid .search-wrapper:focus-within .search-icon {
    color: var(--theme-primary-btn, #10b981) !important;
}

/* =============================================
   Category Tabs (تابات الأقسام العلوية)
   ============================================= */
.theme-layout-modern-grid .category-tabs {
    display: flex !important;
    gap: 14px !important;
    padding: 10px 16px 12px 16px !important;
    margin-bottom: 8px !important;
    background: var(--theme-header-bg, var(--theme-menu-bg, #ffffff)) !important;
    background-color: var(--theme-header-bg, var(--theme-menu-bg, #ffffff)) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 150 !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    border-bottom: 1px solid var(--theme-card-border, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02) !important;
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease !important;
}

.theme-layout-modern-grid .category-tabs::-webkit-scrollbar {
    display: none !important;
}

/* الوضع الليلي: شفاف عند الثبات وعند التحرك تظهر خلفية داكنة مع بلور */
body.theme-mode-dark .theme-layout-modern-grid .category-tabs,
.theme-mode-dark .theme-layout-modern-grid .category-tabs,
[data-theme="dark"] .theme-layout-modern-grid .category-tabs {
    background: transparent !important;
    background-color: transparent !important;
    border-bottom: 1px solid transparent !important;
    box-shadow: none !important;
}

body.theme-mode-dark .theme-layout-modern-grid .category-tabs.is-sticky,
.theme-mode-dark .theme-layout-modern-grid .category-tabs.is-sticky,
[data-theme="dark"] .theme-layout-modern-grid .category-tabs.is-sticky {
    background: var(--theme-header-bg, #1e293b) !important;
    background-color: var(--theme-header-bg, #1e293b) !important;
    border-bottom: 1px solid var(--theme-card-border, #334155) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

.theme-layout-modern-grid .category-tabs {
    display: flex !important;
    align-items: flex-start !important;
}

.theme-layout-modern-grid .category-tab {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    align-self: flex-start !important;
    gap: 6px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    flex: 0 0 76px !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    box-sizing: border-box !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    outline: none !important;
    transition: transform 0.2s ease !important;
}

.theme-layout-modern-grid .category-tab-box {
    width: 58px !important;
    height: 58px !important;
    border-radius: 18px !important;
    background-color: var(--theme-card-bg, #f8fafc) !important;
    border: 1px solid var(--theme-card-border, rgba(226, 232, 240, 0.9)) !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    flex-shrink: 0 !important;
}

.theme-layout-modern-grid .category-tab-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 14px !important;
    display: block !important;
    transition: transform 0.25s ease !important;
    pointer-events: none !important;
}

.theme-layout-modern-grid .category-tab-placeholder {
    font-size: 1.4rem !important;
    line-height: 1 !important;
}

.theme-layout-modern-grid .category-tab-name {
    font-family: 'Tajawal', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: var(--theme-text-body, #64748b) !important;
    text-align: center !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    min-height: 2.5em !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    border: none !important;
    background: transparent !important;
    transition: color 0.2s ease, font-weight 0.2s ease !important;
}

.theme-layout-modern-grid .category-tab:hover .category-tab-box {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
    border-color: var(--theme-primary-btn, rgba(16, 185, 129, 0.35)) !important;
}

.theme-layout-modern-grid .category-tab:hover .category-tab-name {
    color: var(--theme-primary-btn, #10b981) !important;
}

.theme-layout-modern-grid .category-tab.active .category-tab-box {
    border: 1.5px solid var(--theme-primary-btn, rgba(16, 185, 129, 0.4)) !important;
    background-color: var(--theme-card-bg, #ffffff) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12) !important;
    transform: translateY(-1px) !important;
}

.theme-layout-modern-grid .category-tab.active .category-tab-name {
    color: var(--theme-text-title, #0f172a) !important;
    font-weight: 800 !important;
}

/* =============================================
   Featured Horizontal Section (الأكثر طلباً - صف واحد مستمر مع سحب وتمرير)
   ============================================= */
.theme-layout-modern-grid .featured-slider-section {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 0 8px 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 6px !important;
}

.theme-layout-modern-grid .featured-products-slider {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 2px 14px 2px !important;
    margin: 0 !important;
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.theme-layout-modern-grid .featured-products-slider.is-dragging {
    cursor: grabbing !important;
}

.theme-layout-modern-grid .featured-products-slider::-webkit-scrollbar {
    display: none !important;
}

.theme-layout-modern-grid .featured-product-card {
    position: relative !important;
    flex: 0 0 150px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--theme-card-bg, #ffffff) !important;
    border: 1px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 16px !important;
    padding: 9px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
}

.theme-layout-modern-grid .featured-product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06) !important;
}

/* على الشاشات الكبيرة فوق 850px: أبعاد متناسقة وأنيقة مع بقاء الصف واحداً قابلاً للسحب */
@media (min-width: 851px) {
    .theme-layout-modern-grid .featured-products-slider {
        gap: 16px !important;
        padding-bottom: 16px !important;
    }
    .theme-layout-modern-grid .featured-product-card {
        flex: 0 0 180px !important;
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        padding: 10px !important;
    }
}

.theme-layout-modern-grid .featured-product-image-wrap {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: var(--theme-menu-bg, #f8fafc) !important;
    margin-bottom: 6px !important;
    flex-shrink: 0 !important;
}

.theme-layout-modern-grid .featured-product-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.theme-layout-modern-grid .featured-product-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.8rem !important;
    background: rgba(255, 94, 54, 0.08) !important;
}

.theme-layout-modern-grid .featured-badges-overlay {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    z-index: 2 !important;
}

.theme-layout-modern-grid .featured-product-info {
    flex: 1 !important;
    margin-bottom: 4px !important;
    min-height: 30px !important;
}

.theme-layout-modern-grid .featured-product-name {
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.theme-layout-modern-grid .featured-product-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 4px !important;
    margin-top: auto !important;
    padding-top: 3px !important;
}

.theme-layout-modern-grid .featured-price-wrap {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
    margin-inline-end: auto !important;
}

.theme-layout-modern-grid .featured-action-wrap {
    margin-inline-start: auto !important;
}

.theme-layout-modern-grid .featured-price-wrap .product-price {
    font-size: 0.94rem !important;
    font-weight: 900 !important;
    color: var(--theme-price-tag, #b91c1c) !important;
}

.theme-layout-modern-grid .featured-price-wrap .product-old-price {
    font-size: 0.72rem !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
}

/* ==========================================================================
   CATEGORY SECTIONS & PRODUCTS GRID (شبكة منتجات الأقسام)
   - Mobile (<= 850px): 2 columns (repeat(2, 1fr))
   - Desktop (> 850px): 3 columns (repeat(3, 1fr))
   ========================================================================== */
.theme-layout-modern-grid #productsContainer {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    gap: 16px !important;
    padding: 12px 16px !important;
}

.theme-layout-modern-grid .category-section,
.theme-layout-modern-grid .modern-grid-category-section,
.theme-layout-modern-grid .category-section:not(.featured-slider-section) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    box-shadow: none !important;
    padding: 12px 0 !important;
    margin-bottom: 0 !important;
}

.theme-layout-modern-grid .category-title {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    font-family: 'Tajawal', sans-serif !important;
    font-size: 1.2rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
    margin: 0 0 12px 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.theme-layout-modern-grid .category-title-img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 9px !important;
    border: 1px solid var(--theme-card-border, rgba(0, 0, 0, 0.08)) !important;
    object-fit: cover !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
    background: var(--theme-card-bg, #ffffff) !important;
}

/* الشبكة الأساسية للمنتجات (الافتراضي 2 في كل سطر للهواتف) */
.theme-layout-modern-grid .category-products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* الأجهزة اللوحية والشاشات المتوسطة: 3 منتجات بجانب بعضها */
@media (min-width: 680px) {
    .theme-layout-modern-grid .category-products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px 14px !important;
    }
}

/* شاشات اللابتوب والكمبيوتر: 4 منتجات بجانب بعضها */
@media (min-width: 950px) {
    .theme-layout-modern-grid .category-products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px 16px !important;
    }
}

/* الشاشات الكبيرة والعريضة: 5 منتجات كحد أقصى بجانب بعضها */
@media (min-width: 1200px) {
    .theme-layout-modern-grid .category-products-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px 18px !important;
    }
}

/* تصميم كرت المنتج العمودي الشبكي */
.theme-layout-modern-grid .grid-product-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    background: var(--theme-card-bg, #ffffff) !important;
    border: 1px solid var(--theme-card-border, #e2e8f0) !important;
    border-radius: 16px !important;
    padding: 10px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
    box-sizing: border-box !important;
    height: 100% !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.theme-layout-modern-grid .grid-product-card:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* 1. صورة المنتج المربعة في الأعلى */
.theme-layout-modern-grid .grid-product-image-wrap {
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: var(--theme-menu-bg, #f8fafc) !important;
    margin-bottom: 8px !important;
    flex-shrink: 0 !important;
}

.theme-layout-modern-grid .grid-product-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.theme-layout-modern-grid .grid-product-card:hover .grid-product-img {
    transform: scale(1.04) !important;
}

.theme-layout-modern-grid .grid-product-placeholder {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 2.2rem !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

/* 2. عنوان ووصف المنتج في الوسط */
.theme-layout-modern-grid .grid-product-info {
    flex: 1 1 auto !important;
    margin-bottom: 8px !important;
    display: flex !important;
    flex-direction: column !important;
}

.theme-layout-modern-grid .grid-product-name {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    color: var(--theme-text-title, #0f172a) !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.2s ease !important;
}

.theme-layout-modern-grid .grid-product-card:hover .grid-product-name {
    color: var(--theme-price-tag, #b91c1c) !important;
}

.theme-layout-modern-grid .grid-product-desc {
    font-size: 0.76rem !important;
    color: var(--theme-text-body, #64748b) !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 3. أسفل الكرت (الفوتر): السعر وزر الإضافة في طرفين متقابلين تماماً */
.theme-layout-modern-grid .grid-product-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 8px !important;
    margin-top: auto !important;
    padding-top: 8px !important;
    border-top: 1px dashed var(--theme-card-border, #f1f5f9) !important;
}

.theme-layout-modern-grid .grid-price-wrap {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.15 !important;
    margin-inline-end: auto !important;
}

.theme-layout-modern-grid .grid-price-wrap .product-price {
    font-size: 0.98rem !important;
    font-weight: 900 !important;
    color: var(--theme-price-tag, #b91c1c) !important;
}

.theme-layout-modern-grid .grid-price-wrap .product-old-price {
    font-size: 0.74rem !important;
    color: #94a3b8 !important;
    text-decoration: line-through !important;
}

/* زر الإضافة وعداد الكمية في الجهة المقابلة تماماً */
.theme-layout-modern-grid .flame-card-action-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin-inline-start: auto !important;
    flex-shrink: 0 !important;
}

.theme-layout-modern-grid .add-btn.flame-add-btn {
    position: static !important;
    transform: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28) !important;
    white-space: nowrap !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.theme-layout-modern-grid .add-btn.flame-add-btn:active {
    transform: scale(0.92) !important;
}

.theme-layout-modern-grid .add-btn.flame-add-btn.btn-plus-only {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    border-radius: 13px !important;
    font-size: 1.45rem !important;
    line-height: 1 !important;
}

.theme-layout-modern-grid .qty-control,
.theme-layout-modern-grid .grid-action-wrap .qty-control,
.theme-layout-modern-grid .flame-card-action-wrap .qty-control,
.theme-layout-modern-grid .featured-action-wrap .qty-control {
    position: static !important;
    transform: none !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    margin: 0 !important;
    opacity: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    background-color: var(--theme-primary-btn, #2563eb) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    border: none !important;
    border-radius: 13px !important;
    padding: 2px 6px !important;
    height: 38px !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28) !important;
    flex-shrink: 0 !important;
}

.theme-layout-modern-grid .qty-control button {
    background: transparent !important;
    border: none !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    padding: 0 6px !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    height: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.theme-layout-modern-grid .qty-control span {
    color: var(--theme-primary-btn-text, #ffffff) !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    min-width: 18px !important;
    text-align: center !important;
    padding: 0 3px !important;
}

/* بادج المنتجات المخصصة في الزاوية */
.theme-layout-modern-grid .cart-qty-badge,
.theme-layout-modern-grid .grid-product-card>.cart-qty-badge,
.theme-layout-modern-grid .featured-product-card>.cart-qty-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 20 !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    background-color: var(--theme-primary-btn, #10b981) !important;
    color: var(--theme-primary-btn-text, #ffffff) !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28) !important;
    cursor: pointer !important;
    padding: 0 3px !important;
    box-sizing: border-box !important;
}

[dir="ltr"] .theme-layout-modern-grid .cart-qty-badge,
html[dir="ltr"] .theme-layout-modern-grid .cart-qty-badge,
[dir="ltr"] .theme-layout-modern-grid .grid-product-card>.cart-qty-badge,
html[dir="ltr"] .theme-layout-modern-grid .grid-product-card>.cart-qty-badge {
    left: auto !important;
    right: 8px !important;
}

/* البحث: إخفاء العناصر عند البحث */
.theme-layout-modern-grid .product-card.search-hidden,
.theme-layout-modern-grid .featured-product-card.search-hidden,
.theme-layout-modern-grid .category-section.search-hidden,
.theme-layout-modern-grid .featured-slider-section.search-hidden {
    display: none !important;
}

/* Storefront Footer */
.theme-layout-modern-grid .menu-footer {
    background-color: var(--theme-header-bg, var(--theme-card-bg, #ffffff)) !important;
    border-top: 1px solid var(--theme-card-border, #e2e8f0) !important;
    color: var(--theme-text-body, #64748b) !important;
    padding: 18px 20px !important;
    margin-top: 20px !important;
    margin-bottom: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-align: center !important;
}

body.has-cart .theme-layout-modern-grid .menu-footer {
    padding-bottom: 190px !important;
}

.theme-layout-modern-grid .menu-footer a {
    color: var(--theme-primary-btn, #10b981) !important;
    font-weight: 800 !important;
    font-size: 0.98rem !important;
    text-decoration: none !important;
}

.theme-layout-modern-grid .menu-footer a:hover {
    text-decoration: underline !important;
}

/* =========================================================
   Mobile Adjustments (شاشات الهواتف <= 500px)
   ========================================================= */
@media (max-width: 500px) {
    .theme-layout-modern-grid .category-products-grid {
        gap: 10px 8px !important;
    }

    .theme-layout-modern-grid .grid-product-card {
        padding: 8px !important;
        border-radius: 14px !important;
    }

    .theme-layout-modern-grid .grid-product-image-wrap {
        border-radius: 10px !important;
        margin-bottom: 6px !important;
    }

    .theme-layout-modern-grid .grid-product-name {
        font-size: 0.84rem !important;
    }

    .theme-layout-modern-grid .grid-product-desc {
        font-size: 0.72rem !important;
    }

    .theme-layout-modern-grid .grid-price-wrap .product-price {
        font-size: 0.9rem !important;
    }

    .theme-layout-modern-grid .grid-price-wrap .product-old-price {
        font-size: 0.7rem !important;
    }

    .theme-layout-modern-grid .add-btn.flame-add-btn.btn-plus-only {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        border-radius: 11px !important;
        font-size: 1.35rem !important;
    }

    .theme-layout-modern-grid .qty-control {
        height: 34px !important;
        border-radius: 11px !important;
    }

    .theme-layout-modern-grid .qty-control button {
        font-size: 1.05rem !important;
        padding: 0 4px !important;
    }

    .theme-layout-modern-grid .qty-control span {
        font-size: 0.88rem !important;
    }
}