section[component-id="1523393433"] .swiper-slide {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 3 / 1 !important;
}

section[component-id="1523393433"] .swiper-slide > div:first-child {
    height: 100% !important;
    width: 100% !important;

    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}




























/* =========================================================
   DESKTOP CATEGORIES MODAL & CARDS - OPTIMIZED HEIGHTS
   ========================================================= */

@media (min-width: 1024px) {

    /* إخفاء القائمة الأصلية من الهيدر */
    custom-main-menu:not(.in-modal) {
        position: absolute !important;
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* زر فتح الـ Modal */
    .desktop-menu-trigger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 9px;
        height: 42px;
        padding: 0 18px;
        border: 0;
        border-radius: 10px;
        background: #f3f4f6;
        color: #111827;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        transition: all .2s ease;
    }

    .desktop-menu-trigger:hover {
        background: #111827;
        color: #ffffff;
    }

    /* الـ Overlay خلف الـ Modal */
    .categories-modal-overlay {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        background: rgba(17, 24, 39, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        z-index: 99998;
        transition: opacity .3s ease, visibility .3s ease;
    }

    .categories-modal-overlay.is-active {
        opacity: 1;
        visibility: visible;
    }

    /* نافذة الـ Modal */
    .categories-modal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -46%) scale(0.96);
        width: min(1080px, 92vw);
        max-height: 85vh;
        background: #ffffff;
        border-radius: 20px;
        z-index: 99999;
        opacity: 0;
        visibility: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
        direction: rtl;
        overflow: hidden;
    }

    .categories-modal.is-active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }

    /* هيدر الـ Modal */
    .categories-modal-header {
        padding: 20px 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #f3f4f6;
        background: #ffffff;
    }

    .categories-modal-title {
        font-size: 18px;
        font-weight: 800;
        color: #111827;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .categories-modal-close {
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 10px;
        background: #f3f4f6;
        color: #374151;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        transition: all .2s ease;
    }

    .categories-modal-close:hover {
        background: #ef4444;
        color: #ffffff;
    }

    /* جسم الـ Modal */
    .categories-modal-body {
        padding: 24px 28px;
        overflow-y: auto;
        flex: 1;
    }

    /* شبكة الكروت - تم تعديل المحاذاة حتى لا تتمدد الكروت الفارغة */
    .categories-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
        align-items: start; /* يمنع الكروت القصيرة من التمدد طولياً */
    }

    /* الكرت الفردي */
    .category-card {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 16px;
        height: fit-content; /* تجعل الارتفاع يعتمد على المحتوى فقط */
        transition: border-color .2s ease, box-shadow .2s ease;
    }

    .category-card:hover {
        border-color: #d1d5db;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    }

    /* رأس الكرت (التصنيف الرئيسي) */
    .category-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    .category-card-title {
        font-size: 15px;
        font-weight: 800;
        color: #111827;
        text-decoration: none;
        transition: color .2s ease;
    }

    .category-card-title:hover {
        color: #2563eb;
    }

    /* زر التوسيع والإغلاق */
    .category-card-toggle {
        width: 28px;
        height: 28px;
        border: 0;
        border-radius: 6px;
        background: #ffffff;
        color: #6b7280;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        transition: all .2s ease;
        border: 1px solid #e5e7eb;
    }

    .category-card-toggle:hover {
        background: #111827;
        color: #ffffff;
        border-color: #111827;
    }

    /* حاوية التصنيفات الفرعية */
    .category-card-subs {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px dashed #e5e7eb;
        display: flex;
        flex-direction: column;
        gap: 8px;
        max-height: 800px;
        overflow: hidden;
        transition: max-height .3s ease, margin .3s ease, padding .3s ease, opacity .2s ease;
        opacity: 1;
    }

    .category-card-subs.is-collapsed {
        max-height: 0 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top-color: transparent !important;
        opacity: 0;
        pointer-events: none;
    }

    /* المجموعات الفرعية (Level 2) */
    .category-sub-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .category-sub-item {
        font-size: 13.5px;
        font-weight: 700;
        color: #374151;
        text-decoration: none;
        padding: 5px 8px;
        border-radius: 8px;
        transition: all .2s ease;
    }

    .category-sub-item:hover {
        background: #ffffff;
        color: #111827;
    }

    /* التصنيفات العميقة (Level 3 - Child) */
    .category-child-list {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-right: 12px;
        padding-right: 8px;
        border-right: 2px solid #e5e7eb;
    }

    .category-child-item {
        font-size: 12.5px;
        font-weight: 500;
        color: #6b7280;
        text-decoration: none;
        padding: 4px 8px;
        border-radius: 6px;
        transition: all .2s ease;
    }

    .category-child-item:hover {
        color: #111827;
        background: #ffffff;
        padding-right: 12px;
    }

    body.categories-modal-open {
        overflow: hidden !important;
    }
}

@media (max-width: 1023px) {
    .desktop-menu-trigger,
    .categories-modal,
    .categories-modal-overlay {
        display: none !important;
    }
}