/* ==========================================
   1. Ola Market Subcategory Grid
   ================================---------- */
.ola-subcategory-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 0 30px !important;
    padding: 0 !important;
}

.ola-subcategory-card {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
    margin: 0 !important;
    background: #ffffff !important;
    text-align: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

.ola-subcategory-image {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 125px !important;
    overflow: hidden !important;
}

.ola-subcategory-image img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 115px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
}

.ola-subcategory-name {
    margin-top: 7px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
    text-align: center !important;
    color: inherit !important;
}

/* Tablet */
@media screen and (max-width: 1024px) {
    .ola-subcategory-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* Mobile */
@media screen and (max-width: 600px) {
    .ola-subcategory-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .ola-subcategory-card {
        padding: 4px !important;
    }

    .ola-subcategory-image {
        height: 90px !important;
    }

    .ola-subcategory-image img {
        max-height: 82px !important;
    }

    .ola-subcategory-name {
        font-size: 12px !important;
    }
}


/* ==========================================
   2. عرض 3 منتجات بجانب بعضها للموبايل
   ================================---------- */
@media screen and (max-width: 767px) {
    .woocommerce ul.products,
    ul.products,
    .products {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .woocommerce ul.products li.product,
    ul.products li.product,
    .products .product {
        width: 100% !important;
        margin: 0 !important;
        padding: 2px !important;
    }
}


/* ==========================================
   3. تعديل الكاتجوري (إخفاء الاسم وتعديل الفريم)
   ================================---------- */
.borobazar-category-rigel-name {
    display: none !important;
}

.borobazar-category-rigel-thumb {
    border: none !important;
    border-top: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
}

.borobazar-category-rigel-thumb figure {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

.borobazar-category-rigel-thumb img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}


/* ==========================================
   4. تصفير الارتفاع والمساحات للسلايدر
   ================================---------- */
.borobazar-product-category-slider-wrapper-rigel,
.elementor-widget-borobazar-product-categories,
.borobazar-block-spacing-margin-wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
}


/* ==========================================
   5. تحويل عنوان الصفحة العلوي إلى شريط نحيف
   ================================---------- */
.borobazar-page-banner,
.borobazar-woo-page-banner {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: auto !important;
    height: auto !important;
}

.borobazar-page-banner span,
.borobazar-page-banner .italic,
.borobazar-woo-page-banner span {
    display: none !important;
}

.borobazar-page-banner h1,
.borobazar-page-banner h2,
.borobazar-woo-page-banner h1,
.borobazar-woo-page-banner h2 {
    font-size: 18px !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    line-height: 1.2 !important;
}

.borobazar-page-banner nav,
.borobazar-page-banner .breadcrumb,
.borobazar-woo-page-banner nav {
    font-size: 12px !important;
    margin-top: 0 !important;
}

/* إزالة القناع البيضاوي والقطع المائل في كافة التصنيفات والأقسام الفرعية */
.borobazar-category-rigel-thumb,
.borobazar-category-thumb,
.product-category img,
.woocommerce-loop-category__title,
[class*="borobazar-category"] {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    mask: none !important;
    border-radius: 12px !important; /* درجة انحناء الزوايا (اجعلها 0px لمربع حاد) */
    aspect-ratio: 1 / 1 !important; /* إجبار الصورة على النسبة المربعة */
    object-fit: cover !important;
}

/* إخفاء أي طبقة SVG شفافة مسببة للشكل البيضاوي */
.borobazar-category-rigel-thumb svg,
.borobazar-category-thumb svg,
.borobazar-category-rigel-thumb::before,
.borobazar-category-rigel-thumb::after {
    display: none !important;
}






/* تقليل الارتفاع وإلغاء الفراغ السفلي الكبير في التصنيفات */
.borobazar-category-rigel-thumb,
.borobazar-category-thumb,
[class*="borobazar-category"] {
    min-height: auto !important;
    height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* ضبط المسافة بين الصورة والنص مباشرة */
.borobazar-category-rigel-thumb + *,
.borobazar-category-thumb + *,
[class*="borobazar-category"] .title,
[class*="borobazar-category"] h3,
[class*="borobazar-category"] a {
    margin-top: 8px !important;
    padding-top: 0 !important;
}

/* إلغاء المسافات الفارغة من الحاوية الكلية */
.borobazar-category-item,
.product-category {
    padding-bottom: 5px !important;
    margin-bottom: 10px !important;
}


/* إلغاء المسافات الداخلية والخارجية لكتل ووردبريس وحاويات المنتجات */
.wp-block-group,
.wp-block-columns,
.wp-block-column,
div.borobazar-block-spacing-wrapper {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* القضاء على أي مسافة فارغة أسفل شبكة المنتجات أو التصنيفات */
.woocommerce-products-header,
.site-main > * {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

