
@media (min-width: 768px) {
    .dc-product-flex-wrapper {
        display: flex;
        gap: 3rem;
        flex-wrap: nowrap;
        margin-bottom: 2rem;
        align-items: flex-start;
    }

    /* Sticky gallery */
    .dc-product-flex-wrapper > .woocommerce-product-gallery {
        position: sticky !important;
        top: 20px;
        flex: 1 1 50%;
        min-width: 280px;
        max-height: 90vh;
        overflow-y: auto;
        z-index: 10;
        scrollbar-width: thin;
        scrollbar-color: rgba(0,0,0,0.25) transparent;
    }

    .dc-product-flex-wrapper > .woocommerce-product-gallery::-webkit-scrollbar {
        width: 8px;
    }
    .dc-product-flex-wrapper > .woocommerce-product-gallery::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.25);
        border-radius: 4px;
        transition: background-color 0.2s ease;
    }
    .dc-product-flex-wrapper > .woocommerce-product-gallery::-webkit-scrollbar-thumb:hover {
        background-color: rgba(0,0,0,0.5);
    }

    /* Summary panel */
    .dc-product-flex-wrapper > .summary.entry-summary {
        flex: 1 1 50%;
        min-width: 300px;
    }

    /* Only force width/display on main structural blocks, not meta elements */
    .dc-product-flex-wrapper > .summary.entry-summary > .product_title,
    .dc-product-flex-wrapper > .summary.entry-summary > .price,
    .dc-product-flex-wrapper > .summary.entry-summary > .woocommerce-product-details__short-description,
    .dc-product-flex-wrapper > .summary.entry-summary > .single_add_to_cart_button {
        width: 100%;
        max-width: none;
        display: block;
    }

    /* Fix Slick slider overflow if using */
    .wpgs-image .slick-list,
    .wpgs-thumb .slick-list {
        overflow: visible;
    }

    /* Ensure parent containers allow sticky to work */
    .single-product .site-content,
    .single-product .content-area,
    .single-product .site-main {
        overflow: visible;
    }
}

/* Mobile fallback */
@media (max-width: 767px) {
    .dc-product-flex-wrapper {
        display: block;
    }
    .dc-product-flex-wrapper > .woocommerce-product-gallery,
    .dc-product-flex-wrapper > .summary.entry-summary {
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}


@media (min-width: 768px) {
    /* Ensure right summary column starts at the same top as left gallery */
    .dc-product-flex-wrapper > .summary.entry-summary {
        margin-top: 0;   /* no negative margin, safe against overlapping breadcrumbs */
        padding-top: 0;  /* remove extra spacing */
    }

    /* Optional: very small nudge for visual balance */
    .dc-product-flex-wrapper > .summary.entry-summary > .product_title {
        margin-top: 0.5rem; /* tweak slightly if needed */
    }
}
/* ======================================= */

/* ==============================
   Catalog-Page Scoped Sidebar + Filter Chips
   ============================== */
body.archive.woocommerce,
body.post-type-archive-product,
body.taxonomy-product_cat,
body.taxonomy-product_tag {

    /* Sidebar fade-in */
    .primary-sidebar.widget-area {
        opacity: 0;
        transition: opacity 0.25s ease-in-out;
    }

    .primary-sidebar.widget-area.js-visible {
        opacity: 1;
    }

    /* WooCommerce Filter Chips – Kadence compatible */

    .wc-block-product-filter-chips__item {
        background: var(--wc-product-filter-chips-background);
        border-color: var(--wc-product-filter-chips-border);
        color: var(--wc-product-filter-chips-text);
        cursor: pointer;
        padding: .25em .75em;
        border-radius: 2px;
        font-family: inherit;
        font-size: .8em;
    }

    /* Keep text and count consistent */
    .wc-block-product-filter-chips__item,
    .wc-block-product-filter-chips__item .wc-block-product-filter-chips__count {
        color: inherit;
    }

    /* Hover state – normal chips */
    .wc-block-product-filter-chips__item:hover:not([aria-checked="true"]) {
        background-color: #ededed !important;
        color: inherit !important;
    }

    /* Selected state – lighter grey background */
    .has-selected-chip-background-color .wc-block-product-filter-chips__item[aria-checked="true"] {
        background: #ededed !important;
    }

    /* Selected state text */
    .has-selected-chip-text-color .wc-block-product-filter-chips__item[aria-checked="true"] {
        color: var(--wc-product-filter-chips-selected-text) !important;
    }

    /* Selected state border */
    .has-selected-chip-border-color .wc-block-product-filter-chips__item[aria-checked="true"] {
        border-color: var(--wc-product-filter-chips-selected-border) !important;
    }

    /* Hover state for selected chips – slightly darker grey */
    .has-selected-chip-background-color .wc-block-product-filter-chips__item[aria-checked="true"]:hover {
        background-color: #e0e0e0 !important;
        color: inherit !important;
    }
}