/* MarketBashi Product Sidebar Builder — v0.1.2.
 * Activate ONLY when a valid Elementor sidebar is enabled on classic product pages.
 * Keep all existing Woo gallery, purchase, tabs and related hooks/layout intact.
 */
body.single-product.mb-product-sidebar-enabled .content-area {
    width: calc(100% - 2 * var(--mb-page-gutter, 24px));
    max-width: 1480px;
    min-width: 0;
    margin-inline: auto;
}
body.single-product.mb-product-sidebar-enabled .content-area .site-main,
body.single-product.mb-product-sidebar-enabled .woocommerce div.product {
    min-width: 0;
}
body.single-product.mb-product-sidebar-enabled .mb-product-page-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    min-width: 0;
    clear: both;
    direction: rtl;
}
body.single-product.mb-product-sidebar-enabled .mb-product-page-main,
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
body.single-product.mb-product-sidebar-enabled .mb-product-page-main > div.product {
    width: 100%;
    min-width: 0;
}
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar {
    align-self: start;
    overflow-wrap: anywhere;
}
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor,
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .e-con,
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor-widget {
    min-width: 0;
    max-width: 100%;
}
/* On large screens the whole Woo page, including its tabs, stays to the right
   while any number of Elementor sidebar sections stack on the physical LEFT. */
@media (min-width: 1100px) {
    body.single-product.mb-product-sidebar-enabled .mb-product-page-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) clamp(200px, 17vw, 238px);
        gap: 24px;
        align-items: start;
        direction: rtl;
    }
    body.single-product.mb-product-sidebar-enabled .mb-product-page-main {
        grid-column: 1;
        grid-row: 1;
    }
    body.single-product.mb-product-sidebar-enabled .mb-product-sidebar {
        grid-column: 2;
        grid-row: 1;
    }
}
/* Mobile/tablet: JS moves the single sidebar instance before the first product recommendation list. */
@media (max-width: 1099px) {
    body.single-product.mb-product-sidebar-enabled .mb-product-sidebar {
        padding-inline: 16px;
    }
}

@media (max-width: 1099px) {
    body.single-product.mb-product-sidebar-enabled .mb-product-page-main > .product > .mb-product-sidebar {
        display: block;
        float: none;
        clear: both;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin-block: 24px;
        padding-inline: 16px;
    }
}

/* v0.1.2: Elementor Free legacy Inner Section columns are self-contained blocks.
 * Each inner column owns its title and carousel. Do not grid widget-wrap children.
 * Several independent Inner Sections are supported; each flows in document order.
 */
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor-inner-section > .elementor-container {
    display: grid !important;
    gap: 16px !important;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) !important;
}
body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor-inner-section > .elementor-container > .elementor-inner-column {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
}
@media (min-width: 768px) and (max-width: 1099px) {
    body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor-inner-section > .elementor-container {
        grid-template-columns: repeat(var(--mb-psb-tablet-columns, 2), minmax(0, 1fr)) !important;
    }
}
@media (max-width: 767px) {
    body.single-product.mb-product-sidebar-enabled .mb-product-sidebar .elementor-inner-section > .elementor-container {
        grid-template-columns: repeat(var(--mb-psb-mobile-columns, 1), minmax(0, 1fr)) !important;
    }
}
