/**
 * Category Layout Styles
 * Two-column layout for category pages (RTL optimized)
 */

/* Override theme container width for category pages */
.woocommerce-page .site-main,
.woocommerce-page .container,
.woocommerce-page .elementor-container {
    max-width: 1440px !important;
}

.sp-category-layout-container {
    display: flex;
    gap: 30px;
    max-width: 1440px;
    margin: 0 auto;
    align-items: flex-start;
    direction: rtl;
    padding: 0 20px;
}

.sp-category-main-content {
    flex: 0 0 70%;
    width: 70%;
    direction: ltr;
}

.sp-category-sidebar {
    flex: 0 0 30%;
    width: 30%;
    position: sticky;
    top: 20px;
    direction: ltr;
}

/* Ensure proper spacing for category content */
.sp-category-main-content .woocommerce-products-header {
    margin-bottom: 20px;
}

.sp-category-main-content .sp-categories-container,
.sp-category-main-content .sp-categories-grid-container,
.sp-category-main-content .sp-category-products-container {
    margin-bottom: 20px;
}

/* Sidebar styling */
.sp-category-sidebar {
    background: #d7e4ea;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(8, 48, 67, 0.1);
}

/* Responsive design */
@media (max-width: 1480px) {
    .sp-category-layout-container {
        padding: 0 20px;
    }
}

@media (max-width: 1024px) {
    .sp-category-layout-container {
        gap: 20px;
        padding: 0 15px;
    }

    .sp-category-main-content {
        flex: 0 0 65%;
        width: 65%;
    }

    .sp-category-sidebar {
        flex: 0 0 35%;
        width: 35%;
    }
}

@media (max-width: 768px) {
    .sp-category-layout-container {
        flex-direction: column;
        gap: 20px;
        direction: ltr;
        padding: 0 15px;
    }

    .sp-category-main-content,
    .sp-category-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .sp-category-sidebar {
        order: 1;
        margin-bottom: 20px;
        padding: 15px;
    }

    .sp-category-main-content {
        order: 2;
    }

    /* Ensure tables are responsive on mobile */
    .sp-category-main-content .sp-categories-container,
    .sp-category-main-content .sp-category-products-container {
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .sp-category-layout-container {
        gap: 15px;
        padding: 0 10px;
    }

    .sp-category-sidebar {
        padding: 15px;
        margin-bottom: 15px;
        margin-top: 0;
    }
}