/* (removed) Global 3:4 crop – now scoped to mobile left column only */

/* ============================================
   v3.0.0: CSS-First Bundle Collapse (MOBILE ONLY)
   Modern browsers use :has() for instant collapse/expand
   Older browsers fall back to JavaScript
   96% browser support (Chrome 105+, Safari 15.4+, Firefox 121+)
   CRITICAL: Only applies on mobile (max-width: 768px)
   Desktop bundles remain fully expanded
   ============================================ */
@media screen and (max-width: 768px) {
    @supports selector(:has(*)) {
        /* Collapsed state (checkbox not checked) */
        .bundled_product:not(:has(.bundled_product_checkbox:checked)) {
            max-height: 80px;
            overflow: hidden;
            transition: max-height 0.3s ease-in-out;
        }
        
        /* Expanded state (checkbox checked) */
        .bundled_product:has(.bundled_product_checkbox:checked) {
            max-height: 5000px; /* Large enough for any content */
            transition: max-height 0.5s ease-out;
        }
        
        /* Performance optimization */
        .bundled_product {
            will-change: max-height;
        }
        
        /* Ensure checkbox/label stay visible in collapsed state */
        .bundled_product:not(:has(.bundled_product_checkbox:checked)) .bundled_product_checkbox,
        .bundled_product:not(:has(.bundled_product_checkbox:checked)) label[for*="bundle_selected"] {
            position: relative;
            z-index: 10;
        }
        
        /* Disable JavaScript collapse when CSS works */
        body.css-collapse-supported .bundled_product.js-collapsed,
        body.css-collapse-supported .bundled_product.js-expanded {
            max-height: none !important;
            height: auto !important;
        }
        
        body.css-collapse-supported .bundled_product:not(:has(.bundled_product_checkbox:checked)) {
            max-height: 80px;
        }
        
        body.css-collapse-supported .bundled_product:has(.bundled_product_checkbox:checked) {
            max-height: 5000px;
        }
    }

    /* Fallback for browsers without :has() support (4% market share) */
    @supports not selector(:has(*)) {
        .bundled_product {
            transition: max-height 0.3s ease-in-out;
        }
    }
}

/* Bundle product fixes - MUST apply to all screen sizes */
.cart.bundle_form .bundled_product.bundled_product_summary {
    /* Establish new block formatting context (BFC) so floats are contained */
    overflow: hidden !important; /* critical: contain floated .bundled_product_images */
    /* Allow natural height expansion - no max-height limit */
}

/* Force near-flush spacing between gallery image and thumbnails on mobile for ALL products */
@media screen and (max-width: 768px) {
	body.single-product .mk-product-gallery .flex-viewport {
		margin-bottom: 10px !important; /* requested spacing */
		padding-bottom: 0 !important;
	}
	body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
	/* Remove stray duplicate images that can appear outside the slider on mobile */
	body.single-product .woocommerce-product-gallery > img,
	body.single-product .woocommerce-product-gallery .flex-viewport + img,
	body.single-product .woocommerce-product-gallery__image > a + img {
		display: none !important;
	}
}

/* Quantity inputs - compact styling for ALL product types - MUST apply to all screen sizes */
.cart.bundle_form .bundled_product_summary .input-text.qty.bundled_qty.text,
.bundle_form .bundled_product_summary .input-text.qty.bundled_qty.text,
.bundled_product_summary .input-text.qty.bundled_qty.text,
input[type="number"].input-text.qty,
.input-text.qty.text,
.quantity .qty {
    width: 80px !important;
    height: 48px !important;
    text-align: center !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    font-size: 18px !important;
    margin: 0 5px 0 0 !important;
    padding: 4px 8px !important;
    max-width: 80px !important;
    min-width: 80px !important;
    box-sizing: border-box !important;
}

/* PhotoSwipe gallery features completely disabled via WordPress hooks to prevent positioning conflicts with mobile layout */

/* Bundle stock styling moved to bundle-presentation.css to avoid duplication */

/* Restore original 200px bundle image sizing for proper layout */

/* Default bundle image sizing (desktop-context). On mobile sticky we override to full width */
.cart.bundle_form .bundled_product_images,
.cart.bundle_form .bundled_product_image {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 3px !important;
    /* Force container to not expand beyond image size */
    min-height: 0 !important;
}

.cart.bundle_form .bundled_product_image img {
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    aspect-ratio: auto !important;
    max-height: none !important;
    border-radius: 3px !important;
}

/* CRITICAL: Fix container height to prevent 1500px expansion - MAXIMUM SPECIFICITY */
body.single-product .cart.bundle_form div.bundled_product_summary .bundled_product_images,
body.single-product .cart.bundle_form .bundled_product_summary .bundled_product_images,
.woocommerce .cart.bundle_form div.bundled_product_summary .bundled_product_images,
.woocommerce .cart.bundle_form .bundled_product_summary .bundled_product_images {
    height: 150px !important;
    max-height: 150px !important;
    min-height: 0 !important;
    width: 150px !important;
    max-width: 150px !important;
    overflow: hidden !important;
    float: left !important;
    margin-right: 15px !important;
}

/* NUCLEAR OPTION: Maximum specificity to override WooCommerce Product Bundles plugin */
body.single-product .cart.bundle_form div.bundled_product_summary .bundled_product_images img,
body.single-product .cart.bundle_form div.bundled_product_summary .bundled_product_image img,
body.woocommerce .cart.bundle_form div.bundled_product_summary .bundled_product_images img,
body.woocommerce .cart.bundle_form div.bundled_product_summary .bundled_product_image img,
.woocommerce .cart.bundle_form div.bundled_product_summary .bundled_product_images img,
.woocommerce .cart.bundle_form div.bundled_product_summary .bundled_product_image img,
.cart.bundle_form div.bundled_product_summary .bundled_product_images img,
.cart.bundle_form div.bundled_product_summary .bundled_product_image img,
.cart.bundle_form div.bundled_product_summary .bundled_product_images .bundled_product_image img,
.cart.bundle_form div.bundled_product_summary .bundled_product_images .woocommerce-product-gallery__image img,
.cart.bundle_form div.bundled_product_summary .bundled_product_images .image.zoom img,
.cart.bundle_form .bundled_product_summary .bundled_product_images img,
.cart.bundle_form .bundled_product_summary .bundled_product_image img,
.cart.bundle_form .bundled_product_summary .bundled_product_images .bundled_product_image img,
.cart.bundle_form .bundled_product_summary .bundled_product_images .woocommerce-product-gallery__image img,
.cart.bundle_form .bundled_product_summary .bundled_product_images .image.zoom img {
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    object-fit: contain !important;
    max-height: none !important;
}

/* ==========================================================================
   MOBILE PRODUCT LAYOUT - CLEAN TWO-COLUMN FLOAT-BASED SYSTEM
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* Simple sticky positioning for left column only */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 6 !important;
        background: #fff !important;
    }
    /* Main wrapper */
    .mk-product-columns { width: 100%; clear: both; }

    /* Summary default flow for bundle only on MOBILE (single products use 35/65 floats below) */
    /* These rules only apply on mobile - desktop uses default WooCommerce layout */
    @media screen and (max-width: 768px) {
        /* Remove duplicate inline images inside slides (keep anchor-wrapped image) */
        /* Scope to bundle pages to avoid side effects on other product types */
        body.product-type-bundle .mk-product-gallery .woocommerce-product-gallery__image > img { display: none !important; }
        body.product-type-bundle .summary.entry-summary { 
            width: 100%; 
            float: none; 
            display: block !important; 
            margin: 0 0 12px 0; 
        }
        /* Gallery full-width clear ONLY on bundle products on MOBILE */
        body.product-type-bundle .mk-product-gallery { 
            clear: both !important; 
            width: 100% !important; 
            float: none !important; 
            display: block; 
        }
    }
    .mk-gallery-sticky-inner {
        display: block;
        position: sticky;
        top: 0;
        z-index: 5;
        background: #fff;
    }
    
    /* ==========================================================================
       MOBILE NON-YARN PRODUCT LAYOUT IMPROVEMENTS
       ========================================================================== */
    
    /* For non-yarn products on mobile, move variant selector and cart below the columns */
    body:not(.mk-yarn-product) .variations {
        clear: both !important;
        width: 100% !important;
        margin-top: 1.5em !important;
        padding: 1em !important;
        background: #f8f8f8 !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
        float: none !important;
        display: block !important;
    }
    
    body:not(.mk-yarn-product) .woocommerce-variation-add-to-cart,
    body:not(.mk-yarn-product) .single_variation_wrap {
        clear: both !important;
        width: 100% !important;
        margin-top: 1em !important;
        padding: 1em !important;
        background: #f8f8f8 !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
        float: none !important;
        display: block !important;
    }
    
    /* Force the summary container to not float on mobile for non-yarn products */
    body:not(.mk-yarn-product) .summary.entry-summary {
        float: none !important;
        width: 100% !important;
        clear: both !important;
        display: block !important;
    }
    
    /* Ensure the gallery also clears properly */
    body:not(.mk-yarn-product) .mk-product-gallery {
        float: none !important;
        width: 100% !important;
        clear: both !important;
        display: block !important;
        margin-bottom: 1em !important;
    }
    
    /* Gallery image constraints (apply to all products on mobile like in the working commit) */
    /* Split rules to allow JS to switch the OUTER gallery container to position: fixed
       without being overridden by !important. Inner wrappers remain relative for cropping. */
    .mk-product-gallery .woocommerce-product-gallery {
        display: block !important;
        width: 100%;
        position: relative; /* allow JS to override to fixed */
        clear: both !important;
        margin-bottom: 0 !important;
        border-radius: 3px !important;
        overflow: visible !important; /* allow sticky/fixed children and avoid clipping */
    }
    .mk-product-gallery .flex-viewport {
        display: block !important;
        width: 100% !important;
        overflow: hidden !important; /* viewport should clip sliding track */
        border-radius: 3px !important;
    }

    /* Make wide tables horizontally scrollable on mobile */
    .woocommerce-product-details__short-description,
    .mk-table-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .woocommerce-product-details__short-description table,
    .mk-table-section table {
        display: block;            /* allow horizontal scroll */
        width: max-content;        /* keep natural table width */
        min-width: 100%;           /* never smaller than viewport */
    }

    /* Ensure table scrolling works with higher specificity */
    body.single-product .woocommerce-product-details__short-description { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
    body.single-product .woocommerce-product-details__short-description table { display: block !important; width: max-content !important; min-width: 100% !important; white-space: nowrap; }
    
    body.single-product .woocommerce-product-details__short-description table th,
    body.single-product .woocommerce-product-details__short-description table td {
        white-space: nowrap;
    }
    
    /* Ensure extracted table sections also scroll horizontally */
    body.single-product .mk-table-section { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
    body.single-product .mk-table-section table { display: block !important; width: max-content !important; min-width: 100% !important; white-space: nowrap; }
    
    body.single-product .mk-table-section table th,
    body.single-product .mk-table-section table td {
        white-space: nowrap;
    }

    /* (reverted) Sticky positioning overrides removed to preserve original cart styling */

    /* Scale images to container without cropping on mobile */
    .mk-product-gallery .woocommerce-product-gallery__image img,
    .mk-product-gallery .woocommerce-product-gallery__image a img,
    .mk-product-gallery .flex-viewport img {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: none !important;
        object-fit: contain !important;
        object-position: center center !important;
        display: block !important;
    }

    /* CRITICAL FIX: Allow thumbnails to appear directly below main image.
       The gallery containers above were given a fixed aspect-ratio and
       overflow: hidden, which clips the thumbnails (ol.flex-control-thumbs)
       because WooCommerce renders them as a sibling of .flex-viewport inside
       .woocommerce-product-gallery. These overrides restore natural height
       and visibility on mobile so thumbnails are not clipped. */
    .mk-product-gallery .woocommerce-product-gallery {
        overflow: hidden !important; /* contain slides, let thumbs sit directly below */
        height: auto !important;
    }
    .mk-product-gallery .woocommerce-product-gallery__wrapper {
        /* let Flexslider set width/transform; no forced overflow/height/aspect */
    }
    .mk-product-gallery .flex-viewport {
        overflow: hidden !important; /* clip sliding track */
        height: auto !important;
    }

    /* Let Flexslider control slide visibility; do not hide non-active slides here */
    /* (Removed display toggles that interfered with track width calculations) */

    /* MOBILE: Full-bleed main gallery on bundle pages (remove side gutters) */
    @media screen and (max-width: 768px) {
        body.single-product.product-type-bundle .mk-product-gallery {
            width: 100vw !important;
            margin-left: calc(50% - 50vw) !important;
            margin-right: calc(50% - 50vw) !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
        }

        /* Keep the gallery wrapper and flexslider elements within normal document flow */
        body.single-product.product-type-bundle .mk-product-gallery .woocommerce-product-gallery,
        body.single-product.product-type-bundle .mk-product-gallery .flex-viewport {
            width: 100% !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
            position: relative !important;
        }

        /* CRITICAL: Ensure flexslider track stays within viewport bounds */
        body.single-product.product-type-bundle .mk-product-gallery .woocommerce-product-gallery__wrapper {
            position: relative !important;
        }

        /* Do not force slide widths/floats; Flexslider handles layout */

        /* Thumbnails: left align, tight spacing, 10px below image */
        body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs,
        body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
            display: block !important;         /* no flex on mobile */
            text-align: left !important;
            margin-top: 0 !important;         /* spacing handled by viewport margin */
            margin-bottom: 0 !important;
            padding: 0 !important;            /* full width like product photo */
            background: transparent !important;
            width: 100% !important;
        }
        body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs li,
        body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
            display: block !important;
            float: left !important;            /* float-based layout, Storefront-style */
            vertical-align: top !important;
            box-sizing: border-box !important;
            width: 23.5% !important;           /* 4 per row on typical mobile */
            margin: 0 2% 10px 0 !important;    /* horizontal gutter + 10px bottom spacing */
        }
        /* Remove right gutter on each 4th item */
        body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs li:nth-child(4n),
        body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:nth-child(4n) {
            margin-right: 0 !important;
        }
        /* Very narrow screens: switch to 3 per row */
        @media screen and (max-width: 380px) {
            body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs li,
            body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
                width: 31.33% !important;      /* 3 per row */
                margin: 0 3% 10px 0 !important;
            }
            body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs li:nth-child(3n),
            body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:nth-child(3n) {
                margin-right: 0 !important;
            }
        }
        /* Clearfix to contain floated thumbnails */
        body.single-product .mk-product-gallery .flex-control-nav.flex-control-thumbs::after,
        body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs::after {
            content: '';
            display: table;
            clear: both;
        }
    }

    /* Restore viewport clipping to prevent slide images from animating out of view */
    @media screen and (max-width: 768px) {
        .mk-product-gallery .flex-viewport { overflow: hidden !important; }
        .mk-product-gallery .woocommerce-product-gallery { margin-left: 0 !important; margin-right: 0 !important; }
        /* Let Flexslider manage slide visibility/positioning (no overrides here) */
    }

    

    /* (reverted) Fallback width for sticky gallery removed; JS sets exact dimensions */
    
    /* Right column: Summary (65%) – restore working 35/65 mobile floats for single products */
    body:not(.product-type-bundle) .mk-product-gallery {
        float: left;
        width: 35%;
        background: #fff;
        clear: both !important;
    }
    body:not(.product-type-bundle) .summary.entry-summary {
        float: right;
        width: 65%;
        display: block !important;
        clear: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding-left: 15px;
        box-sizing: border-box;
    }
    /* Ensure single-product title/price are stacked in the right column (not 50/50) */
    body:not(.product-type-bundle) .product .entry-summary .product_title,
    body:not(.product-type-bundle) .product .entry-summary .price {
        float: none !important;
        width: 100% !important;
        margin: 0 0 0.5em 0 !important;
    }
    
    /* Product title and price in right column - ensure proper positioning */
    .summary.entry-summary h1.product_title {
        margin: 0 0 0.25em 0;
        font-size: 1.5em;
        line-height: 1.2;
        width: 100%;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .summary.entry-summary .price {
        margin: 0 0 0.5em 0;
        font-size: 1.2em;
        font-weight: bold;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
        width: 100%;
    }

    /* Stock message moved near the add-to-cart */
    .summary.entry-summary .mk-moved-stock {
        display: block;
        clear: both;
        margin: 8px 0 10px 0;
        font-size: 0.95em;
    }
    
    /* Swatches container - CRITICAL: Must be constrained to 65% width */
    .summary.entry-summary .variations {
        margin-bottom: 1em;
        width: 100%;
        overflow: hidden; /* Clear floats */
    }
    
    /* Individual swatches - float left to wrap in 65% column */
    .summary.entry-summary .swatch-wrapper,
    .summary.entry-summary .select-option.swatch-wrapper {
        display: inline-block !important;
        float: left !important;
        width: 35px !important;
        height: 35px !important;
        margin: 0 4px 4px 0 !important;
        vertical-align: top;
    }
    
    /* Cart controls box (natural position in summary; JS repositions visually) */
    .summary.entry-summary .single_variation_wrap,
    .summary.entry-summary .woocommerce-variation-add-to-cart {
        clear: both;
        width: 100%;
        margin-top: 1em;
        background: #f8f8f8;
        padding: 15px;
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        box-sizing: border-box;
    }

    /* Remove internal max-width constraints that some Woo styles apply */
    .summary.entry-summary .single_variation_wrap,
    .summary.entry-summary .woocommerce-variation-add-to-cart,
    .summary.entry-summary .single_variation_wrap > *,
    .summary.entry-summary .woocommerce-variation-add-to-cart > * {
        max-width: 100% !important;
    }

    /* Ensure nested wrappers don't add extra padding/margins when cart is in left column (stacked or sticky) */
    /* Only apply sticky behavior to yarn products */
    body.mk-yarn-product.mk-cart-stacked-left .single_variation_wrap,
    body.mk-yarn-product.mk-cart-stacked-left .woocommerce-variation-add-to-cart,
    body.mk-yarn-product.mk-sticky-active .single_variation_wrap,
    body.mk-yarn-product.mk-sticky-active .woocommerce-variation-add-to-cart {
        margin-top: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Make quantity input full-width to align edges with button on narrow screens */
    /* Only apply sticky behavior to yarn products */
    body.mk-yarn-product.mk-cart-stacked-left .single_variation_wrap .quantity .qty,
    body.mk-yarn-product.mk-cart-stacked-left .woocommerce-variation-add-to-cart .quantity .qty,
    body.mk-yarn-product.mk-sticky-active .single_variation_wrap .quantity .qty,
    body.mk-yarn-product.mk-sticky-active .woocommerce-variation-add-to-cart .quantity .qty {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 0 5px 0 !important; /* 5px gap above button */
        box-sizing: border-box !important;
    }

    /* Mobile quantity scroll overlay select */
    .mk-qty-select-overlay {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0; /* invisible but interactive to bring native wheel/scroll */
        -webkit-appearance: menulist;
        appearance: menulist;
        z-index: 5;
        pointer-events: auto;
        background: transparent;
        border: 0;
    }

    /* Bundle page: ensure bundled item primary image stays in left column area and does not overlap text */
    /* Remove Woo gallery selector targeting from bundle items to avoid conflicts */
    
    /* Stack quantity and button vertically ONLY when cart is in left column
       Use body class toggled by JS to scope narrowly */
    /* Only apply sticky behavior to yarn products */
    body.mk-yarn-product.mk-cart-stacked-left .single_variation_wrap .quantity,
    body.mk-yarn-product.mk-cart-stacked-left .woocommerce-variation-add-to-cart .quantity,
    body.mk-yarn-product.mk-sticky-active .single_variation_wrap .quantity,
    body.mk-yarn-product.mk-sticky-active .woocommerce-variation-add-to-cart .quantity {
        float: none !important;
        width: 100% !important;
        margin: 0 0 5px 0 !important; /* exact 5px gap above the button */
        display: block !important;
    }
    body.mk-yarn-product.mk-cart-stacked-left .single_variation_wrap .single_add_to_cart_button,
    body.mk-yarn-product.mk-cart-stacked-left .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    body.mk-yarn-product.mk-sticky-active .single_variation_wrap .single_add_to_cart_button,
    body.mk-yarn-product.mk-sticky-active .woocommerce-variation-add-to-cart .single_add_to_cart_button {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        border-radius: 6px !important;
        border: none !important;
        background: #333 !important;
        color: #fff !important;
        cursor: pointer !important;
        transition: background-color 0.2s ease !important;
        min-width: 100% !important;
    }

    /* Remove outer container padding to reduce perceived inset */
    /* Only apply sticky behavior to yarn products */
    body.mk-yarn-product.mk-cart-stacked-left .mk-gallery-cart-wrapper,
    body.mk-yarn-product.mk-cart-stacked-left .mk-product-gallery {
        padding: 0 !important;
    }
    
    .summary.entry-summary .single_add_to_cart_button:hover {
        background: #555 !important;
    }
    
    .mk-product-columns::after { content: ''; display: table; clear: both; }
    
    /* Full-width summary below columns */
    .mk-full-width-summary {
        display: block;
        width: 100%;
        clear: both;
        margin: 2em 0 0 0;
        padding: 0 1em;
        position: relative;
        z-index: 1000;
        background: #fff;
    }
    
    /* Z-index management for content flow */
    .woocommerce-product-details__short-description,
    .woocommerce-tabs,
    .single-product-summary,
    .related.products {
        position: relative;
        z-index: 1000;
        background: #fff;
    }
    
    /* Header elements always visible */
    .site-header,
    .site-branding,
    .main-navigation,
    .storefront-breadcrumb,
    .woocommerce-breadcrumb {
        position: relative;
        z-index: 1000 !important;
        background: #fff;
    }
    
    /* Footer and main content above sticky elements */
    footer,
    main {
        position: relative;
        z-index: 1000 !important;
        background: #fff;
    }
}

/* ==========================================================================
   DESKTOP PRODUCT LAYOUT
   ========================================================================== */

@media screen and (min-width: 769px) {
    /* Title and price styling */
    .summary.entry-summary h1.product_title {
        margin: 0 0 0.5em 0;
        font-size: 2em;
        line-height: 1.2;
    }
    
    .summary.entry-summary .price {
        margin: 0 0 1em 0;
        font-size: 1.5em;
        font-weight: bold;
    }
    
    /* Two-column layout when no sidebar */
    body:not(.right-sidebar) .mk-product-gallery {
        float: left;
        width: 50%;
        margin-right: 20px;
    }
    
    body:not(.right-sidebar) .summary.entry-summary {
        float: left;
        width: calc(50% - 20px);
    }
    
    body:not(.right-sidebar) .woocommerce-tabs {
        clear: both;
        margin-top: 2em;
    }
    
    /* Gallery image styling */
    .mk-product-gallery img,
    .mk-product-gallery .woocommerce-product-gallery__image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        object-fit: contain;
    }
    
    /* ==========================================================================
       DESKTOP STICKY CART (v3.7.0) - Yarn Products Only
       ========================================================================== */
    
    /* Sticky gallery when mk-sticky-active class is applied */
    body.mk-yarn-product.mk-sticky-active .mk-product-gallery .woocommerce-product-gallery,
    body.mk-yarn-product.mk-sticky-active .woocommerce-product-gallery {
        position: fixed !important;
        top: 0;
        z-index: 100;
        /* Width, left calculated by JavaScript */
    }
    
    /* Sticky cart button below gallery */
    body.mk-yarn-product.mk-sticky-active .summary.entry-summary .woocommerce-variation-add-to-cart,
    body.mk-yarn-product.mk-sticky-active .woocommerce-variation-add-to-cart {
        position: fixed !important;
        z-index: 100;
        /* Top, left, width calculated by JavaScript */
    }
    
    /* Ensure site header stays above sticky elements */
    body.mk-yarn-product.mk-sticky-active .site-header,
    body.mk-yarn-product.mk-sticky-active .main-navigation {
        position: relative;
        z-index: 1000 !important;
    }
    
    /* Summary section (right sidebar) maintains natural flow */
    body.mk-yarn-product .summary.entry-summary {
        position: relative;
        /* Let Storefront handle sidebar positioning */
    }
    
    /* Frozen state (when cart hits bottom sections) */
    body.mk-yarn-product.mk-cart-frozen .mk-product-gallery .woocommerce-product-gallery,
    body.mk-yarn-product.mk-cart-frozen .woocommerce-product-gallery {
        position: absolute !important;
        z-index: 100;
        /* Position calculated by JavaScript */
    }
    
    body.mk-yarn-product.mk-cart-frozen .summary.entry-summary .woocommerce-variation-add-to-cart,
    body.mk-yarn-product.mk-cart-frozen .woocommerce-variation-add-to-cart {
        position: absolute !important;
        z-index: 100;
        /* Position calculated by JavaScript */
    }

    /* ==========================================================================
       MOBILE GALLERY THUMBNAILS - RESTORE THUMBNAIL NAVIGATION
       ========================================================================== */

    /* Position thumbnails directly below the main image on mobile */
    .mk-product-gallery .flex-control-nav.flex-control-thumbs {
        position: static !important;
        top: auto !important;
        margin-top: 5px !important;
        margin-bottom: 15px !important;
        clear: both !important;
        float: none !important;
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        background: #f8f8f8 !important;
        padding: 8px !important;
        border-radius: 6px !important;
        list-style: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 1 !important;
    }

    /* Additional selector for WooCommerce gallery thumbnails */
    .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
        position: static !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-top: 5px !important;
        margin-bottom: 15px !important;
        padding: 8px !important;
        background: #f8f8f8 !important;
        border-radius: 6px !important;
        list-style: none !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        clear: both !important;
        float: none !important;
    }

    /* Style individual thumbnail items */
    .mk-product-gallery .flex-control-nav.flex-control-thumbs li,
    .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 60px !important;
        height: 60px !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        border: 2px solid transparent !important;
        transition: border-color 0.3s ease !important;
        cursor: pointer !important;
    }

    /* Style thumbnail images */
    .mk-product-gallery .flex-control-nav.flex-control-thumbs li img,
    .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        border-radius: 2px !important;
    }

    /* ==========================================================================
       MOBILE GALLERY THUMBNAILS - STOREFRONT COMPLIANT
       ========================================================================== */

    /* Ensure gallery container allows thumbnails to flow naturally */
    .single-product div.product .mk-product-gallery .woocommerce-product-gallery {
        position: static;
        overflow: visible;
        clear: both;
    }

    /* High-specificity selector for thumbnails to override any hiding */
    .single-product div.product .mk-product-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
        display: block;
        list-style: none;
        margin: 10px 0 0 0;
        padding: 0;                    /* remove padding for full width */
        background: transparent;       /* match mobile style */
        border-radius: 0;              /* remove background styling */
        text-align: left;              /* left align thumbnails */
        clear: both;
        float: none;
        width: 100%;
        opacity: 1;
        visibility: visible;
    }

    /* Individual thumbnail styling - no flexbox, Storefront compliant */
    .single-product div.product .mk-product-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
        display: block !important;
        float: left !important;                   /* float-based layout */
        box-sizing: border-box !important;
        width: 23.5% !important;                  /* 4 per row on typical mobile */
        margin: 0 2% 10px 0 !important;           /* horizontal gutter + 10px bottom spacing */
        padding: 0 !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;           /* keep squares within percent width */
        border-radius: 4px !important;
        overflow: hidden !important;
        border: 2px solid transparent !important;
        transition: border-color 0.3s ease !important;
        cursor: pointer !important;
        vertical-align: top !important;
        background: transparent !important;
    }
    .single-product div.product .mk-product-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:nth-child(4n) { margin-right: 0 !important; }
    /* Clearfix for floated thumbnails */
    .single-product div.product .mk-product-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs::after {
        content: '';
        display: table;
        clear: both;
    }

    .single-product div.product .mk-product-gallery .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 2px;
    }

    /* Highlight active thumbnail */
    .mk-product-gallery .flex-control-nav.flex-control-thumbs li.flex-active,
    .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li.flex-active {
        border-color: #333 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }

    /* Hover effect for thumbnails */
    .mk-product-gallery .flex-control-nav.flex-control-thumbs li:hover,
    .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:hover {
        border-color: #666 !important;
    }
    
    /* ==========================================================================
       DESKTOP NON-YARN PRODUCT LAYOUT IMPROVEMENTS
       ========================================================================== */
    
    /* Simple horizontal alignment for quantity and add to cart button */
    body:not(.mk-yarn-product) .woocommerce-variation-add-to-cart .quantity,
    body:not(.mk-yarn-product) .single_variation_wrap .quantity {
        float: none;
        margin-right: 1em;
        margin-bottom: 0;
        vertical-align: middle;
        display: inline-block;
    }
    

    
    /* ==========================================================================
       DESKTOP BUNDLE PRODUCT LAYOUT - MINIMAL INTERFERENCE
       ========================================================================== */
    
    /* Only ensure bundle form doesn't interfere with default layout */
    body.single-product.product-type-bundle .cart.cart_group.bundle_form {
        clear: both;
        width: 100%;
        margin-top: 2em;
        float: none;
    }
    
    /* Let WooCommerce handle the default two-column layout naturally */
    /* Remove any conflicting rules that might interfere with Storefront's layout */
}

/* ==========================================================================
   BUNDLE PRODUCT OPTIMIZATIONS
   ========================================================================== */

/* Hide optional bundled item options until checkbox is checked (desktop + mobile) */
.woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional .details:has(> label.bundled_product_optional_checkbox > input.bundled_product_checkbox:not(:checked)) .bundled_item_cart_content {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
/* Ensure visibility when checked */
.woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional .details:has(> label.bundled_product_optional_checkbox > input.bundled_product_checkbox:checked) .bundled_item_cart_content {
    display: block !important;
}

@media screen and (max-width: 768px) {
    /* Force left-column thumbnails visible when Product Bundles hides them */
    .bundle_form div.bundled_product_summary.thumbnail_hidden .bundled_product_images,
    .bundle_form tr.bundled_product_summary.thumbnail_hidden .bundled_product_images,
    .bundle_form .bundled_product_summary.thumbnail_hidden .bundled_product_images {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 26% !important; /* keep float layout percentages */
        float: left !important;
        margin-right: 4% !important;
        height: auto !important;
        max-height: none !important;
    }
    .bundle_form div.bundled_product_summary.thumbnail_hidden .details,
    .bundle_form tr.bundled_product_summary.thumbnail_hidden .details,
    .bundle_form .bundled_product_summary.thumbnail_hidden .details {
        width: 70% !important;
        float: left !important;
        margin: 0 !important;
    }
    /* Bundle-specific mobile optimizations */
    .cart.cart_group.bundle_form.layout_default {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        /* Allow sticky descendants */
        overflow: visible !important;
    }
    
    .bundle_form {
        /* Allow sticky descendants within bundled items */
        overflow: visible !important;
        /* Ensure proper float clearing for bundle sections */
        clear: both !important;
    }
    
    /* Force each bundle section to start fresh */
    .bundle_form > div,
    .bundle_form > .bundled_product,
    .bundle_form > .bundled_item_5029,
    .bundle_form > .bundled_item_5030 {
        clear: both !important;
        display: block !important;
        float: none !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    .summary-add-to-cart-form.summary-add-to-cart-form-bundle {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .cart.bundle_form .bundled_product.bundled_product_summary {
        overflow: visible !important; /* Allow content to expand */
        max-height: none !important; /* Remove height constraint to prevent clipping */
        height: auto !important; /* Allow natural height */
    }
    
    /* Clear floats between bundled product sections */
    .bundled_product_summary::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Additional float clearing for bundle items to prevent overlap */
    .bundled_item_5029,
    .bundled_item_5030,
    .bundled_product.bundled_product_summary {
        clear: both !important; /* Force each bundle item to start on a new line */
        display: block !important; /* Ensure block-level display */
        float: none !important; /* Remove any inherited floats */
    }
    
    .cart.bundle_form .bundled_product_images,
    .cart.bundle_form .bundled_product_image {
        height: auto !important;
        max-height: none !important; /* Remove height constraint for mobile bundle layout */
        overflow: visible !important;
    }
    
    .cart.bundle_form .bundled_product_image img {
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
        max-height: none !important; /* Remove height constraint for mobile bundle layout */
    }
    
    .bundled_product_images img,
    .bundled_product_image img,
    .bundle_form .bundled_product_images img,
    .bundle_form .bundled_product_image img {
        height: auto !important;
        max-height: none !important; /* Remove height constraint for mobile bundle layout */
        min-height: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        object-fit: contain !important;
        aspect-ratio: auto !important;
    }
    
    /* Bundle items - remove ghost elements */
    .bundled_item_5029,
    .bundled_item_5030,
    .bundled_product.bundled_product_summary,
    .bundled_item_3844,
    .bundled_item_3845,
    .bundled_item_3846,
    .bundled_item_*,
    .bundled_item_3844.bundled_product.bundled_product_summary,
    .bundled_item_3845.bundled_product.bundled_product_summary,
    .bundled_item_3846.bundled_product.bundled_product_summary {
        width: 100% !important;
        margin: 0 0 30px 0 !important; /* Increased bottom margin for better separation */
        padding: 20px 15px !important; /* Increased vertical padding for better spacing */
        background: transparent !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        box-sizing: border-box;
        /* Ensure proper float clearing for entire container */
        clear: both !important;
        float: none !important;
        display: block !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* Mobile-only bundle styling fixes */
    @media screen and (max-width: 768px) {
        /* Remove drop shadows from tables */
        .data-table,
        table.data-table {
            box-shadow: none !important;
            background: transparent !important;
            border: none !important;
        }

        /* Reduce gap between bundle section and Product Details */
        .woocommerce-tabs {
            margin-top: 20px !important; /* Reduced from default 32px */
        }

        /* Remove gaps from hidden bundle elements - only target elements within bundle items */
        .bundled_item .cart.bundled_item_cart_content.variations_form,
        .bundled_item .single_variation_wrap.bundled_item_wrap,
        .bundled_item .woocommerce-variation.single_variation.bundled_item_cart_details,
        .bundled_item .woocommerce-variation-add-to-cart.variations_button.bundled_item_after_cart_details.bundled_item_button {
            margin: 0 !important;
            padding: 0 !important;
            height: 0 !important;
            overflow: hidden !important;
        }

        /* More specific override for WooCommerce bundle plugin styles */
        .woocommerce .bundled_product.bundled_product_summary,
        .woocommerce .bundled_item_3844,
        .woocommerce .bundled_item_3845,
        .woocommerce .bundled_item_3846,
        .woocommerce [class*="bundled_item_"] {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
        }

        /* Override any WooCommerce default styling */
        .woocommerce div.product .bundled_product.bundled_product_summary,
        .woocommerce div.product .bundled_item_3844,
        .woocommerce div.product .bundled_item_3845,
        .woocommerce div.product .bundled_item_3846,
        .woocommerce div.product [class*="bundled_item_"] {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
        }
    }

        /* Ultra-specific override for WooCommerce bundle plugin - MOBILE ONLY */
        .woocommerce div.product .bundled_item_3844.bundled_product.bundled_product_summary,
        .woocommerce div.product .bundled_item_3845.bundled_product.bundled_product_summary,
        .woocommerce div.product .bundled_item_3846.bundled_product.bundled_product_summary,
        .woocommerce div.product .bundled_item_3844.bundled_product.bundled_product_summary.product,
        .woocommerce div.product .bundled_item_3845.bundled_product.bundled_product_summary.product,
        .woocommerce div.product .bundled_item_3846.bundled_product.bundled_product_summary.product {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
        }

        /* Even more specific override - MOBILE ONLY */
        .woocommerce div.product .bundled_item_3844.bundled_product.bundled_product_summary.product.has_qty_input.bundled_item_optional.mobile-bundle-item.mk-bundle-processed,
        .woocommerce div.product .bundled_item_3845.bundled_product.bundled_product_summary.product.has_qty_input.bundled_item_optional.mobile-bundle-item.mk-bundle-processed,
        .woocommerce div.product .bundled_item_3846.bundled_product.bundled_product_summary.product.has_qty_input.bundled_item_optional.mobile-bundle-item.mk-bundle-processed {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            border-radius: 0 !important;
        }
    }
    
    /* Bundle item titles */
    .bundled_product_title.product_title {
        font-size: 1.1em !important;
        font-weight: 600 !important;
        margin: 0 0 8px 0 !important;
        line-height: 1.3;
        color: #333;
    }
    
    .bundled_product_title_inner {
        display: block;
        margin-bottom: 5px;
    }
    
    /* Bundle item excerpts */
    .bundled_product_excerpt.product_excerpt {
        font-size: 0.9em;
        line-height: 1.4;
        color: #666;
        margin-bottom: 15px;
        clear: both;
        /* Ensure excerpt doesn't interfere with cart below */
        float: none !important;
        display: block !important;
        width: 100% !important;
        position: relative !important;
        z-index: 0 !important;
        /* Contain any floated/inline-block content like icon rows */
        display: flow-root !important;
        /* Add visible horizontal break after excerpt */
        border-bottom: 2px solid #e9ecef !important;
        padding-bottom: 15px !important;
    }

    /* Fallback clearfix in case some browsers ignore flow-root */
    .bundled_product_excerpt.product_excerpt::after,
    .mk-bundle-excerpt::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Ensure cart content starts on a fresh line after excerpt */
    .bundled_item_cart_content,
    .cart.bundled_item_cart_content,
    .bundled_item_cart_content.variations_form {
        clear: both !important;
        display: block !important;
        float: none !important;
        width: 100% !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid #e9ecef !important;
        /* Force new line and prevent float interference */
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Force all elements within cart content to start fresh */
    .bundled_item_cart_content > *,
    .cart.bundled_item_cart_content > *,
    .bundled_item_cart_content.variations_form > * {
        clear: both !important;
        float: none !important;
        display: block !important;
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    /* Specifically target the first element in cart content */
    .bundled_item_cart_content > *:first-child,
    .cart.bundled_item_cart_content > *:first-child,
    .bundled_item_cart_content.variations_form > *:first-child {
        margin-top: 0 !important;
        clear: both !important;
    }
    
    .bundled_product_excerpt p {
        margin: 0 0 8px 0;
    }
    
    /* Ensure mk-bundle-excerpt class has same visual break */
    .mk-bundle-excerpt,
    .bundled_product_excerpt.mk-bundle-excerpt {
        border-bottom: 2px solid #e9ecef !important;
        padding-bottom: 15px !important;
        margin-bottom: 20px !important;
        clear: both !important;
        display: block !important;
        width: 100% !important;
        /* Ensure the container expands to wrap icon rows */
        display: flow-root !important;
    }
    
    /* Ensure the sticky group starts on a fresh line after excerpt */
    .mk-bundle-sticky {
        clear: both !important;
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin-top: 20px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Handle different types of images appropriately */
    
    /* Regular images (like product photos) - stack vertically */
    .bundled_product_excerpt .paragraph img:not([src*=".svg"]),
    .bundled_product_excerpt p img:not([src*=".svg"]),
    .mk-bundle-excerpt .paragraph img:not([src*=".svg"]),
    .mk-bundle-excerpt p img:not([src*=".svg"]) {
        clear: both !important;
        display: block !important;
        float: none !important;
        margin: 10px 0 !important;
        max-width: 100% !important;
        height: auto !important;
    }
    

    
    /* Ensure the last image (SVG or regular) creates a proper break */
    .bundled_product_excerpt .paragraph:last-child img,
    .bundled_product_excerpt p:last-child img,
    .mk-bundle-excerpt .paragraph:last-child img,
    .mk-bundle-excerpt p:last-child img {
        margin-bottom: 20px !important;
        border-bottom: 2px solid #e9ecef !important;
        padding-bottom: 15px !important;
    }
    
    /* Bundle swatches */
    .cart.bundled_item_cart_content.variations_form {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent;
        border: none;
        /* Ensure proper separation from excerpt above */
        clear: both !important;
        display: block !important;
    }
    
    .swatch-photobundle_attribute_alpaca-wool-colors_5029_,
    .swatch-photobundle_attribute_variant_5030_,
    .swatch-photobundle_attribute_* {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        margin: 3px !important;
        border: 2px solid transparent !important;
        cursor: pointer;
        transition: all 0.2s ease;
        display: inline-block !important;
        vertical-align: top;
    }
    
    .swatch-photobundle_attribute_*.selected,
    .swatch-photobundle_attribute_*:hover {
        border-color: #333 !important;
        transform: scale(1.1);
    }
    
    .bundled_item_cart_content .variations {
        margin-bottom: 15px;
        overflow: hidden;
        /* Ensure variations start on fresh line */
        clear: both !important;
        display: block !important;
        width: 100% !important;
    }

    .bundled_item_cart_content .variations .swatch-photobundle_attribute_* {
        float: left;
        width: 32px;
        height: 32px;
        margin: 3px 4px 3px 0;
        box-sizing: border-box;
    }
    
    /* Bundle quantity inputs */
    .bundled_item_5029 .quantity label,
    .bundled_item_5030 .quantity label {
        font-weight: 600;
        font-size: 0.9em;
        color: #333;
        margin-right: 10px;
    }
    
    /* Bundle data container */
    .cart.bundle_data.bundle_data_98368 {
        background: #f8f9fa;
        padding: 15px;
        border-radius: 6px;
        margin-top: 20px;
        border: 1px solid #e9ecef;
    }
    
    /* Bundle price - match single product price styling (desktop/mobile) */
    .bundle_price,
    .bundle_price .price,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price .price {
        font-size: 1.41575em !important; /* WooCommerce single product price size */
        font-weight: 600 !important;      /* Storefront weight */
        color: #2c2d33 !important;        /* Storefront text color */
        margin: 1.41575em 0 1em 0 !important;
        line-height: 1.618 !important;
        display: block !important;
        clear: both !important;
        background: none !important;
        border: 0 !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        text-align: left !important;
    }
    /* Match sale price styling */
    .bundle_price ins,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price ins {
        font-weight: 400 !important;
        text-decoration: none !important;
    }
    .bundle_price del,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price del {
        opacity: 0.5 !important;
        font-weight: 400 !important;
    }
    .bundle_price del + ins,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price del + ins {
        margin-left: 0.327em !important;
    }

    /* Bundle availability */
    .bundle_availability {
        font-size: 0.875em !important; /* Match original stock font size */
        color: #28a745 !important; /* Use green color as default to match single product styling */
        margin: 0 0 1em 0 !important; /* Match WooCommerce stock margins */
        line-height: 1.618 !important; /* Match Storefront line-height */
        display: block !important;
        clear: both !important;
    }
    /* Match WooCommerce stock status colors for bundle availability */
    .bundle_availability.in-stock,
    .bundle_availability .in-stock {
        color: #28a745 !important; /* Match single product green for in stock */
    }
    .bundle_availability.out-of-stock,
    .bundle_availability .out-of-stock {
        color: #e2401c !important; /* Red for out of stock */
    }
    /* Stock emoji indicators (bundle totals area) */
    .bundle_availability.in-stock::before,
    .bundle_availability .in-stock::before {
        content: "😊 " !important;
        font-size: 0.9em !important;
        margin-right: 0.2em !important;
    }
    .bundle_availability.out-of-stock::before,
    .bundle_availability .out-of-stock::before {
        content: "❌ " !important;
        font-size: 0.9em !important;
        margin-right: 0.2em !important;
    }
    /* Hide empty availability elements */
    .bundle_availability:empty::before {
        display: none !important;
    }
    
    /* Bundle error messages */
    .bundle_error {
        background: #f8d7da;
        color: #721c24;
        padding: 10px;
        border-radius: 4px;
        margin-bottom: 10px;
        font-size: 0.9em;
    }
    
    /* Bundle button container */
    .bundle_button {
        margin-top: 15px;
    }
    
    /* Main bundle add to cart button */
    .single_add_to_cart_button.bundle_add_to_cart_button {
        width: 100% !important;
        height: 50px !important;
        background: #333 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 6px !important;
        font-size: 1.1em !important;
        font-weight: 600 !important;
        text-align: center !important;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    .single_add_to_cart_button.bundle_add_to_cart_button:hover {
        background: #555 !important;
    }
    
    .single_add_to_cart_button.bundle_add_to_cart_button:disabled {
        background: #ccc !important;
        cursor: not-allowed;
    }
    
    /* Bundle quantity input for main product */
    .bundle_button .quantity {
        margin-bottom: 15px;
    }
    
    .bundle_button .quantity input {
        width: 80px !important;
        height: 40px !important;
        text-align: center !important;
        border: 1px solid #ddd !important;
        border-radius: 4px !important;
        font-size: 16px !important;
    }
    
    /* Ensure bundle items don't interfere with sticky positioning */
    .bundled_item_5029,
    .bundled_item_5030,
    .bundle_data,
    .bundle_button {
        position: relative;
        z-index: 20;
    }
    
    /* Bundle form spacing */
    .bundle_form .bundled_item_5029:last-child,
    .bundle_form .bundled_item_5030:last-child {
        margin-bottom: 0;
    }
    
    /* Very small screens */
    @media (max-width: 480px) {
        .bundled_product_title.product_title {
            font-size: 1em !important;
        }
        
        .bundled_product_excerpt.product_excerpt {
            font-size: 0.85em;
        }
        
        .swatch-photobundle_attribute_* {
            width: 27px !important;
            height: 27px !important;
        }
    }
    
    /* Extra small screens */
    @media (max-width: 375px) {
        .bundled_item_5029,
        .bundled_item_5030 {
            padding: 10px !important;
        }
        
        .swatch-photobundle_attribute_* {
            width: 25px !important;
            height: 25px !important;
            margin: 2px !important;
        }
    }

    /* Critical: Fix bundle add-to-cart button width on very small screens */
    @media (max-width: 420px) {
        .bundle_button {
            padding: 0 !important;
            margin: 0 !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Target bundle buttons specifically with higher specificity */
        .bundle_form .bundle_button button,
        .bundle_form .bundle_button .single_add_to_cart_button,
        .bundle_form .bundle_button .bundle_add_to_cart_button {
            padding: 0 !important;
            margin: 0 !important;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Override the main theme CSS rule for bundle products with maximum specificity */
        .single-product div.product .bundle_form .bundle_button .single_add_to_cart_button,
        .single-product div.product .bundle_form .bundle_button .bundle_add_to_cart_button,
        .single-product div.product .bundle_form .bundle_button button[type="submit"] {
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
            box-sizing: border-box !important;
            float: none !important;
        }
        
        /* Ensure the bundle form container doesn't add unwanted padding */
        .bundle_form .bundle_button {
            padding: 0 !important;
            margin: 15px 0 0 0 !important;
        }
        
        /* Override any WooCommerce bundle form padding on small screens */
        .bundle_form {
            padding: 0 !important;
        }
        
        /* Ensure bundle form children don't add padding on small screens */
        .bundle_form > div,
        .bundle_form > .bundled_product,
        .bundle_form > .bundled_item_5029,
        .bundle_form > .bundled_item_5030 {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
        
        /* Force the bundle button container to full width */
        .bundle_form .bundle_button {
            width: 100% !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
    }
}

/* ==========================================================================
   BUNDLE DESKTOP OPTIMIZATIONS
   ========================================================================== */

@media screen and (min-width: 769px) {
    /* Desktop: Collapse optional items until checkbox checked (no placeholder whitespace) */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed {
        padding: 0;
        background: transparent;
        border: 0;
        min-height: 0;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details {
        margin: 0;
        padding: 0;
        border: 0;
    }

    /* Hide content when collapsed */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_images,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_image,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_excerpt,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-excerpt,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .cart.bundled_item_cart_content,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .variations,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .variable-items-wrapper,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .woocommerce-variation-add-to-cart,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .single_variation_wrap {
        display: none;
    }

    /* Show thumbnail when collapsed */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_images {
        display: block;
        float: left;
        width: 80px;
        height: 80px;
        margin: 0 12px 0 0;
        overflow: hidden;
        clear: none;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_image {
        width: 80px;
        height: 80px;
        margin: 0;
        float: none;
        display: block;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_images > a,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_image > a {
        display: block;
        width: 80px;
        height: 80px;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_images img,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Bundle items on desktop */
    .bundled_item_5029,
    .bundled_item_5030 {
        margin-bottom: 30px;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
    }
    
    /* Bundle swatches on desktop */
    .swatch-photobundle_attribute_* {
        width: 36px !important;
        height: 36px !important;
        margin: 4px !important;
    }
    
    /* Bundle button on desktop */
    .single_add_to_cart_button.bundle_add_to_cart_button {
        height: 55px !important;
        font-size: 1.2em !important;
    }
    
    /* Remove sticky positioning for bundle product pages */
    body.single-product .product-type-bundle .woocommerce-product-gallery,
    body.single-product .product-type-bundle .summary.entry-summary {
        position: static !important;
        z-index: auto !important;
    }
    
    /* Ensure gallery container has relative positioning */
    body.single-product .woocommerce-before-single-product-summary {
        position: relative;
        min-height: 400px;
    }
    
    /* Gallery takes left half - EXCEPT for bundle products which have their own rules */
    body.single-product:not(.right-sidebar):not(.product-type-bundle) .woocommerce-product-gallery {
        width: 50%;
        margin-right: 20px;
    }
    
    /* Ensure bundle content doesn't overlap with short description */
    body.single-product .woocommerce-after-single-product-summary {
        clear: both;
        margin-top: 40px;
    }
}

/* ==========================================================================
   EXTRACTED TABLES SECTION - FULL WIDTH
   ========================================================================== */

/* Extracted tables section styling - neutral container, fits site cards */
.mk-extracted-tables-section {
    clear: both;
    width: 100%;
    margin: 2em 0 0 0;
    padding: 0 1em;
    background: transparent !important;
    border: 0 !important;
    min-height: 0;
    box-sizing: border-box;
}

.mk-table-section {
    margin-bottom: 2em;
    background: #f9f9f9;
    padding: 1.5em;
    border-radius: 8px;
    border: 1px solid #eee;
}

.mk-table-section:last-child {
    margin-bottom: 0;
}

/* Style H2 headers in extracted sections */
.mk-table-section h2 {
    margin: 0 0 0.5em 0;
    font-size: 1.5em;
    color: #333;
    border-bottom: 2px solid #ddd;
    padding-bottom: 0.5em;
}

/* Style paragraphs in extracted sections */
.mk-table-section p {
    margin: 0 0 1em 0;
    line-height: 1.6;
    color: #666;
}

/* Style tables in extracted sections */
.mk-table-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0 0 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mk-table-section table th,
.mk-table-section table td {
    padding: 0.75em 1em;
    text-align: left;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #e0e0e0;
    vertical-align: top;
}

/* Remove right border from last column for clean edge */
.mk-table-section table th:last-child,
.mk-table-section table td:last-child {
    border-right: none;
}

.mk-table-section table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.mk-table-section table tr:last-child td {
    border-bottom: none;
}

.mk-table-section table tr:nth-child(even) {
    background: #f9f9f9;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
    .mk-table-section {
        padding: 1em;
        margin: 0 -1em 1.5em -1em;
    }
    
    .mk-table-section table {
        font-size: 0.9em;
    }
    
    .mk-table-section table th,
    .mk-table-section table td {
        padding: 0.5em 0.75em;
    }
}

/* ==========================================================================
   PATCH: Fix Storefront sidebar layout on product pages
   ========================================================================== */

body.right-sidebar #main.site-main,
body.right-sidebar #main.site-main #main.site-main {
    float: none !important;
    width: auto !important;
}

@media (max-width: 768px) {
  /* CRITICAL: Logo visibility rules moved inside mobile media query */
  .site-header .custom-logo-link {
    position: relative !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    text-indent: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  .site-header .custom-logo {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 210px !important;
    max-height: 80px !important;
  }

  /* FIX CONTAINER HEIGHT ISSUE */
  body.single-product .site-header .col-full {
    height: auto !important;
    min-height: 80px !important;
  }

  body.single-product .site-header .site-branding {
    height: auto !important;
    min-height: 80px !important;
  }

  .site-header,
  .site-branding,
  .site-branding * {
    position: relative !important;
    z-index: 1000 !important;
    background: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Mobile product layout definitions are declared earlier in this file. */
}

@media screen and (min-width: 769px) {
	/* Restore native plugin desktop layout for bundled items */
	.bundle_form div.bundled_product_summary .bundled_product_images {
		width: 15.7894736842% !important; /* match Storefront bundles.css */
		float: left !important;
		margin-right: 5.2631578947% !important;
		height: auto !important;
		max-height: none !important;
	}
	.bundle_form div.bundled_product_summary:not(.thumbnail_hidden) .details {
		width: 78.9473684211% !important; /* match Storefront bundles.css */
		float: right !important;
		margin-right: 0 !important;
	}
	/* Ensure our earlier fixed 200px sizing does not affect desktop */
	.cart.bundle_form .bundled_product_images,
	.cart.bundle_form .bundled_product_image,
	.cart.bundle_form .bundled_product_image img {
		width: auto !important;
		height: auto !important;
		max-width: none !important;
		max-height: none !important;
	}
}

@media screen and (max-width: 768px) {
	/* Bundle mobile UX: image left, details right, swatches fully visible */
	.cart.bundle_form .bundled_product.bundled_product_summary {
		overflow: visible !important;
		max-height: none !important;
		height: auto !important;
	}
	
	.bundle_form div.bundled_product_summary .bundled_product_images {
		float: left !important;
		width: 28% !important; /* baseline for smallest devices */
		margin-right: 4% !important;
		height: auto !important;
		max-height: none !important;
		display: block !important;
		visibility: visible !important;
	}
	
	.bundle_form div.bundled_product_summary .bundled_product_images img {
		width: 100% !important;
		height: auto !important;
		object-fit: contain !important;
		display: block !important;
	}
	
	.bundle_form div.bundled_product_summary .details {
		float: left !important;
		width: 70% !important;
		margin: 0 !important;
	}
	
	/* Ensure swatch rows wrap and are not clipped */
	.bundle_form div.bundled_product_summary .variations,
	.bundle_form div.bundled_product_summary .swatches-select,
	.bundle_form div.bundled_product_summary .swatch-wrapper {
		overflow: visible !important;
	}
}

@media screen and (max-width: 768px) {
    /* Hide original description tables when extracted */
    body.mk-tables-extracted .woocommerce-product-details__short-description h2,
    body.mk-tables-extracted .woocommerce-product-details__short-description h3,
    body.mk-tables-extracted .woocommerce-product-details__short-description table,
    body.mk-tables-extracted .woocommerce-product-details__short-description h2 + p,
    body.mk-tables-extracted .woocommerce-product-details__short-description h3 + p {
        display: none !important;
    }

    /* DISABLED: Title/price 50-50 float-based layout */
    /* - This was causing inconsistent layout behavior */
    /* - Title and price now use default WooCommerce stacking */
    /* - Gallery positioning handled by Storefront's natural layout */

    /* Bundle page: ensure bundled item primary image stays in left column area and does not overlap text */
    .bundled_product .woocommerce-product-gallery,
    .bundled_product .woocommerce-product-gallery__wrapper,
    .bundled_product .woocommerce-product-gallery__image,
    .bundled_product .woocommerce-product-gallery__image a {
        max-width: 35% !important;
        float: left !important;
        clear: left !important;
        margin-right: 5% !important;
        aspect-ratio: 3 / 4 !important;
        overflow: hidden !important;
    }
    .bundled_product .summary,
    .bundled_product .bundled_product_summary {
        float: right !important;
        width: 60% !important;
    }

    /* VERTICAL STACKING: Make sticky wrapper stack image above quantity vertically */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1000 !important; /* Higher z-index for better stickiness */
        background: #fff !important;
        float: left !important;
        width: 28% !important;  /* Baseline left width for smallest devices */
        margin-right: 4% !important; /* Gap between columns */
        box-sizing: border-box !important;
        padding: 8px !important; /* Reduced padding */
        border-bottom: 1px solid #eee !important;
        margin-bottom: 10px !important;
        overflow: visible !important; /* Ensure sticky descendants work */
    }

    /* OPTIMIZED: Image takes full width of sticky column with natural height - MAXIMUM SPECIFICITY */
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images,
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important; /* CRITICAL: Constrain container width */
        margin: 0 0 8px 0 !important; /* Reduced margin */
        display: flex !important; /* Use flexbox for vertical centering */
        align-items: center !important; /* Center image vertically */
        justify-content: center !important; /* Center image horizontally */
        height: auto !important; /* Allow natural height to prevent right column push-down */
        overflow: hidden !important; /* CRITICAL: Hide any overflow */
        box-sizing: border-box !important; /* Include padding/borders in width calculation */
        /* Force container to respect parent constraints */
        min-width: 0 !important;
        min-height: 0 !important;
    }
    /* Ensure anchor wrappers and images fill the sticky column and are not floated - MAXIMUM SPECIFICITY */
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images > a,
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image > a,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images > a,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image > a {
        display: flex !important; /* Use flexbox to center image */
        align-items: center !important; /* Center image vertically */
        justify-content: center !important; /* Center image horizontally */
        width: 100% !important;
        height: auto !important; /* Allow natural height */
        max-width: 100% !important; /* CRITICAL: Constrain to container width */
        float: none !important;
        box-sizing: border-box !important; /* Include padding/borders in width calculation */
    }
    /* NUCLEAR OPTION: Maximum specificity to override WooCommerce Product Bundles plugin */
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image,
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images img,
    body.single-product .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image img,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_images img,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .bundled_product_image img {
        width: 100% !important;
        height: auto !important; /* Allow natural height */
        max-width: 100% !important; /* CRITICAL: Constrain to container width */
        max-height: none !important;
        display: block !important;
        object-fit: contain !important; /* Contain for natural aspect ratio */
        float: none !important;
        box-sizing: border-box !important; /* Include padding/borders in width calculation */
        /* NUCLEAR OPTION: Override any inline styles that might be set by plugins */
        min-width: 0 !important;
        min-height: 0 !important;
        /* Force aspect ratio preservation within container */
        object-position: center !important;
    }

    /* Quantity and controls stack below image, full width */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-cart {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Style variant price in sticky column (positioned after image, before stock) */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price .price {
        font-size: 1.41575em !important; /* Match original single product price size */
        font-weight: 600 !important; /* Match WooCommerce price weight */
        color: #2c2d33 !important; /* Match Storefront text color */
        margin: 1.41575em 0 1em 0 !important; /* Match original price margins */
        text-align: left !important;
        display: block !important;
        clear: both !important;
        line-height: 1.618 !important; /* Match Storefront line-height */
        background: none !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    /* Match sale price styling */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price ins {
        font-weight: 400 !important;
        text-decoration: none !important;
    }
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price del {
        opacity: 0.5 !important;
        font-weight: 400 !important;
    }
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price del + ins {
        margin-left: 0.327em !important;
    }

    /* Style stock information in sticky column (positioned after price, before quantity) */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock {
        font-size: 0.875em !important; /* Match original stock font size */
        color: #28a745 !important; /* Use green color as default to match single product styling */
        margin: 0 0 1em 0 !important; /* Match WooCommerce stock margins */
        text-align: left !important;
        display: block !important;
        clear: both !important;
        line-height: 1.618 !important; /* Match Storefront line-height */
    }
    /* Match WooCommerce stock status colors */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock.in-stock,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info.in-stock {
        color: #28a745 !important; /* Match single product green for in stock */
    }
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock.out-of-stock,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info.out-of-stock {
        color: #e2401c !important; /* Red for out of stock */
    }
    /* Stock emoji indicators (sticky left column) */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock.in-stock::before,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info.in-stock::before {
        content: "😊 " !important;
        font-size: 0.9em !important;
        margin-right: 0.2em !important;
    }
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock.out-of-stock::before,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info.out-of-stock::before {
        content: "❌ " !important;
        font-size: 0.9em !important;
        margin-right: 0.2em !important;
    }

    /* Match single-product UX: do not show price in sticky left column */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price {
        display: none !important;
    }

    /* Quantity input: full-width, 48px tall, round corners (match single product mobile) */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty input,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty .qty {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        height: 48px !important;
        border-radius: 6px !important;
        border: 1px solid #ddd !important;
        padding: 4px 12px !important;
        font-size: 16px !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
        margin: 6px 0 10px 0 !important;
        background: #fff !important;
    }

    /* Ensure quantity wrapper expands to column width */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty {
        float: none !important;
        width: 100% !important;
        margin: 0 0 10px 0 !important;
        display: block !important;
    }

    /* Reduce sticky variant price to match single-product mobile */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-variant-price .price {
        font-size: 1.2em !important;
    }
    /* Hide empty stock elements */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info:empty::before,
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-stock-info .stock:empty::before {
        display: none !important;
    }

    /* Style quantity wrapper in sticky column (positioned after stock info) */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty {
        margin: 0 0 1.618em 0 !important; /* Match WooCommerce quantity margins */
        text-align: center !important;
        display: block !important;
        clear: both !important;
        float: left !important; /* Match cart form quantity positioning */
        margin-right: 0.875em !important; /* Match cart form spacing */
    }
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty input {
        width: 4.235801032em !important; /* Match original quantity input width */
        height: auto !important;
        text-align: center !important; /* Match original quantity text alignment */
        padding: 0.6180469716em !important; /* Match WooCommerce padding */
        font-size: 1em !important;
        line-height: 1 !important;
        border: 1px solid rgba(0,0,0,0.1) !important;
        border-radius: 3px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        display: inline-block !important;
        vertical-align: middle !important;
        background-color: #fff !important;
        color: #43454b !important;
    }
    /* Match quantity input focus state */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty input:focus {
        outline: 2px solid #2c2d33 !important;
        outline-offset: 1px !important;
    }
    /* Ensure quantity input doesn't override original width in other contexts */
    .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky .mk-bundle-left-qty input.qty {
        width: 4.235801032em !important;
        max-width: 4.235801032em !important;
        min-width: 4.235801032em !important;
    }

    /* COMPREHENSIVE HIDING: Remove ALL original elements from right column */
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .bundled_product_excerpt.mk-excerpt-hidden,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .bundled_product_excerpt {
        display: none !important;
    }

    /* SPECIFIC HIDING: Hide only duplicate quantity/button elements, NOT the entire cart container */
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content .quantity,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content .single_add_to_cart_button,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content .woocommerce-variation-add-to-cart .quantity,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content .woocommerce-variation-add-to-cart .single_add_to_cart_button,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content input.qty,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content button[type="submit"],
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .cart.bundled_item_cart_content .button {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Hide specific variant price and stock info (cloned to left column) - be specific */
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .woocommerce-variation-price,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .woocommerce-variation-availability,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .stock,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .availability,
    .bundle_form .bundled_product.bundled_product_summary.mk-bundle-processed .details .price {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* OPTIMIZED RIGHT COLUMN: Better space utilization and padding */
    .bundle_form .bundled_product.bundled_product_summary .details {
        float: left !important;
        width: 68% !important;  /* Complement to 28% left + 4% gap */
        padding: 8px 4px !important; /* Reduced padding for more content space */
        margin: 0 !important; /* No left margin; gap handled by left column */
        box-sizing: border-box !important;
        min-height: 0 !important; /* Collapse in unchecked state via rule below */
        clear: none !important; /* Don't clear the left column */
        margin-top: 0 !important; /* Start from the top */
        vertical-align: top !important; /* Align to top */
    }

    /* CRITICAL: Very narrow screen fallback - force 2-per-row swatches and proper alignment */
    @media screen and (max-width: 359px) {
        /* HIGHEST SPECIFICITY: Override plugin CSS with multiple selectors */
        .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky,
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky,
        .cart.bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
            width: 36% !important;
            margin-right: 4% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            position: sticky !important;
            top: 0 !important;
        }

        /* HIGHEST SPECIFICITY: Force right column to float left */
        .woocommerce .bundle_form .bundled_product.bundled_product_summary .details,
        .bundle_form .bundled_product.bundled_product_summary .details,
        .cart.bundle_form .bundled_product.bundled_product_summary .details {
            width: 60% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            margin-top: 0 !important;
            vertical-align: top !important;
        }

        /* FORCE 2-PER-ROW SWATCHES on very narrow screens */
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch,
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item {
            width: 48% !important; /* 2-per-row instead of 3 */
            margin: 0 1% 6px 0 !important;
            box-sizing: border-box !important;
        }
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch:nth-child(2n),
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item:nth-child(2n) {
            margin-right: 0 !important;
        }
    }

    /* CRITICAL FIX: Force two-column layout for bundle products on screens 360-409px */
    @media screen and (min-width: 360px) and (max-width: 409px) {
        /* Ensure bundle items maintain two-column layout */
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
            width: 36% !important;
            margin-right: 4% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            position: sticky !important;
            top: 0 !important;
            background: #fff !important;
            z-index: 6 !important;
        }

        .bundle_form .bundled_product.bundled_product_summary .details {
            width: 60% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            margin-top: 0 !important;
            vertical-align: top !important;
            padding: 8px 4px !important;
            box-sizing: border-box !important;
            min-height: 0 !important;
        }

        /* Ensure swatches remain in right column with proper 3-per-row layout */
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch,
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item {
            float: left !important;
            width: 60px !important;  /* Exact pixel width for 3-per-row in 197px container */
            height: 60px !important; /* Consistent height */
            margin: 0 5px 8px 0 !important;
            box-sizing: border-box !important;
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch:nth-child(3n),
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item:nth-child(3n) {
            margin-right: 0 !important;
        }

        /* Target ALL possible swatch button locations */
        .bundle_form .bundled_product.bundled_product_summary .details .variations .value button,
        .bundle_form .bundled_product.bundled_product_summary .details .variations button,
        .bundle_form .bundled_product.bundled_product_summary .details button,
        .bundle_form .bundled_product_summary .details button,
        .bundle_form .bundled_product_summary button {
            float: left !important;
            width: 60px !important;
            height: 60px !important;
            margin: 0 5px 8px 0 !important;
            box-sizing: border-box !important;
            font-size: 11px !important;
            padding: 2px !important;
        }

        /* Reset margin for every 3rd button */
        .bundle_form .bundled_product.bundled_product_summary .details .variations .value button:nth-child(3n),
        .bundle_form .bundled_product.bundled_product_summary .details .variations button:nth-child(3n),
        .bundle_form .bundled_product.bundled_product_summary .details button:nth-child(3n),
        .bundle_form .bundled_product_summary .details button:nth-child(3n),
        .bundle_form .bundled_product_summary button:nth-child(3n),
        .bundle_form button:nth-child(3n) {
            margin-right: 0 !important;
        }
    }

    /* Responsive widening of left column while guaranteeing 3-per-row swatches */
    @media screen and (min-width: 390px) and (max-width: 409px) {
        /* HIGHEST SPECIFICITY: Override plugin CSS */
        .woocommerce .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky,
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky,
        .cart.bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
            width: 32% !important;
            margin-right: 4% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            position: sticky !important;
            top: 0 !important;
        }

        /* HIGHEST SPECIFICITY: Force right column alignment */
        .woocommerce .bundle_form .bundled_product.bundled_product_summary .details,
        .bundle_form .bundled_product.bundled_product_summary .details,
        .cart.bundle_form .bundled_product.bundled_product_summary .details {
            width: 64% !important;
            float: left !important;
            clear: none !important;
            overflow: visible !important;
            margin-top: 0 !important;
            vertical-align: top !important;
        }
    }
    @media screen and (min-width: 410px) and (max-width: 768px) {
        .bundle_form div.bundled_product_summary .bundled_product_images,
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky { width: 32% !important; }
        .bundle_form .bundled_product.bundled_product_summary .details { width: 64% !important; }
    }
    @media screen and (min-width: 430px) and (max-width: 768px) {
        .bundle_form div.bundled_product_summary .bundled_product_images,
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky { width: 36% !important; }
        .bundle_form .bundled_product.bundled_product_summary .details { width: 60% !important; }
    }
    @media screen and (min-width: 450px) and (max-width: 768px) {
        .bundle_form div.bundled_product_summary .bundled_product_images,
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky { width: 40% !important; }
        .bundle_form .bundled_product.bundled_product_summary .details { width: 56% !important; }
    }

    /* ENSURE RIGHT COLUMN ELEMENTS ARE VISIBLE - Critical overrides */
    .bundle_form .bundled_product.bundled_product_summary .details .variations,
    .bundle_form .bundled_product.bundled_product_summary .details .swatches-select,
    .bundle_form .bundled_product.bundled_product_summary .details .variations .value,
    .bundle_form .bundled_product.bundled_product_summary .details .variations button,
    .bundle_form .bundled_product.bundled_product_summary .details .variations .swatch,
    .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch,
    .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper,
    .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item,
    .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper button {
        display: block !important;
        width: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* PIXEL-PERFECT: Three swatches per row in right column - 52% container width */
    .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch,
    .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item {
        float: left !important;
        width: 60px !important;  /* Exact pixel width for 3-per-row in 197px container */
        height: 60px !important; /* Consistent height */
        margin: 0 5px 8px 0 !important;
        box-sizing: border-box !important;
        display: block !important; /* Ensure visibility */
        visibility: visible !important;
        opacity: 1 !important;
    }
    .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch:nth-child(3n),
    .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item:nth-child(3n) {
        margin-right: 0 !important;
    }
    @media (max-width: 420px) {
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch,
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item {
            width: 48% !important;
            margin-right: 4% !important;
        }
        .bundle_form .bundled_product.bundled_product_summary .details .swatches-select .swatch:nth-child(2n),
        .bundle_form .bundled_product.bundled_product_summary .details .variable-items-wrapper .variable-item:nth-child(2n) {
            margin-right: 0 !important;
        }
    }

    /* PIXEL-PERFECT: Target ALL possible swatch button locations */
    .bundle_form .bundled_product.bundled_product_summary .details .variations .value button,
    .bundle_form .bundled_product.bundled_product_summary .details .variations button,
    .bundle_form .bundled_product.bundled_product_summary .details button,
    .bundle_form .bundled_product_summary .details button,
    .bundle_form .bundled_product_summary button,
    .bundle_form button {
        float: left !important;
        width: 60px !important;  /* Exact pixel width for 3-per-row in 197px container */
        height: 60px !important; /* Consistent height */
        margin: 0 5px 8px 0 !important;
        box-sizing: border-box !important;
        font-size: 11px !important; /* Smaller font for better fit */
        padding: 2px !important;
    }

    /* Reset margin for every 3rd button to create 3-per-row layout */
    .bundle_form .bundled_product.bundled_product_summary .details .variations .value button:nth-child(3n),
    .bundle_form .bundled_product.bundled_product_summary .details .variations button:nth-child(3n),
    .bundle_form .bundled_product.bundled_product_summary .details button:nth-child(3n),
    .bundle_form .bundled_product_summary .details button:nth-child(3n),
    .bundle_form .bundled_product_summary button:nth-child(3n),
    .bundle_form button:nth-child(3n) {
        margin-right: 0 !important;
    }
    @media (max-width: 420px) {
        /* HIGH SPECIFICITY: Override existing .cart.bundle_form rules */
        .cart.bundle_form .bundled_product.bundled_product_summary .details .variations {
            padding: 0 !important;
            margin: 0 !important;
            width: 100% !important;
            max-width: none !important;
        }

        /* PIXEL-PERFECT: Target ALL possible swatch button locations for mobile */
        .cart.bundle_form .bundled_product.bundled_product_summary .details .variations button,
        .cart.bundle_form .bundled_product.bundled_product_summary .details .variations .value button,
        .cart.bundle_form .bundled_product.bundled_product_summary .details button,
        .cart.bundle_form .bundled_product.bundled_product_summary button,
        .cart.bundle_form .bundled_product_summary .details button,
        .cart.bundle_form .bundled_product_summary button,
        .cart.bundle_form button,
        .bundle_form .bundled_product.bundled_product_summary .details .variations button,
        .bundle_form .bundled_product.bundled_product_summary .details .variations .value button,
        .bundle_form .bundled_product.bundled_product_summary .details button,
        .bundle_form .bundled_product.bundled_product_summary button,
        .bundle_form .bundled_product_summary .details button,
        .bundle_form .bundled_product_summary button,
        .bundle_form button {
            width: 60px !important;  /* Consistent with desktop for 3-per-row layout */
            height: 60px !important;
            margin: 0 5px 8px 0 !important;
            padding: 2px !important;
            box-sizing: border-box !important;
            float: left !important;
            display: block !important;
            font-size: 11px !important;
            line-height: 1.2 !important;
            text-align: center !important;
            overflow: hidden !important;
        }

        /* DRY: Single selector covers all swatch button locations */
        .bundle_form button:nth-child(3n) {
            margin-right: 0 !important;
        }

        /* DRY: 2-per-row fallback for very narrow screens */
        @media (max-width: 380px) {
            .bundle_form button {
                width: 90px !important;  /* Larger touch targets */
                margin: 0 8px 8px 0 !important;
                font-size: 12px !important;
            }

            .bundle_form button:nth-child(2n) {
                margin-right: 0 !important;
            }
        }
    }

    /* YAGNI: Remove failed experimental CSS - issue marked as minor problem for now */

    /* DRY: Clean responsive columns for >=410px screens */
    @media screen and (min-width: 410px) and (max-width: 768px) {
        .bundle_form .bundled_product.bundled_product_summary .mk-bundle-sticky {
            width: 40% !important;
            margin-right: 4% !important;
            float: left !important;
            clear: none !important;
        }
        .bundle_form .bundled_product.bundled_product_summary .details {
            width: 56% !important; /* fits 3 swatches: 3×60px + 2×5px margins = 190px */
            float: right !important;
            clear: none !important;
        }
        .bundled_item_cart_content .swatch-control {
            width: 100% !important;
            max-width: none !important;
        }
    }

    /* ENSURE STICKY WORKS: Remove ancestor overflow constraints */
    body.single-product.product-type-bundle .site,
    body.single-product.product-type-bundle .site-main,
    body.single-product.product-type-bundle .content-area,
    body.single-product.product-type-bundle .product,
    body.single-product.product-type-bundle .hentry,
    body.single-product.product-type-bundle .entry-content,
    body.single-product.product-type-bundle .bundle_form {
        overflow: visible !important;
        contain: none !important;
    }
}

/* ==========================================================================
   MOBILE BUNDLE: Show only thumbnail until checkbox is checked
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* Use JavaScript class toggle instead of :has() for better browser support */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed {
        overflow: hidden;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 8px 15px;
        margin: 0 0 15px 0;
        background: #fff;
        border-radius: 6px;
        border: 1px solid #e9ecef;
    }

    /* Thumbnail positioning for collapsed state */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky {
        float: left;
        width: 80px;
        margin-right: 12px;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        margin-bottom: 0;
    }

    /* Hide cart elements when collapsed */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .mk-bundle-left-cart,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .mk-bundle-variant-price,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .mk-bundle-stock-info,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_excerpt,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-excerpt,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details .cart.bundled_item_cart_content,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details .variations,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details .variable-items-wrapper,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details .woocommerce-variation-add-to-cart,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details .single_variation_wrap {
        display: none;
    }

    /* Show thumbnail when collapsed */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_images,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_image {
        display: block;
        float: none;
        width: 80px;
        height: 80px;
        margin: 0;
        overflow: hidden;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_images > a,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_image > a {
        display: block;
        width: 80px;
        height: 80px;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_images img,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .mk-bundle-sticky .bundled_product_image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Details column layout */
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .details {
        float: left;
        width: calc(100% - 92px);
        margin: 0;
        padding: 0;
        border: 0;
        min-height: 0;
    }

    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_title,
    .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional.bundle-item-collapsed .bundled_product_title_inner {
        margin-bottom: 4px;
    }
}

/* ==========================================================================
   BUNDLE CHECKBOX ENHANCEMENTS - CLEAN & MAINTAINABLE
   ========================================================================== */



/* ==========================================================================
   BUNDLE OPTIONAL CHECKBOX VISIBILITY + HIGHLIGHT (desktop + mobile)
   ========================================================================== */
.woocommerce .bundle_form label.bundled_product_optional_checkbox {
    display: inline-block !important;
    background: #fff6bf !important;           /* subtle yellow */
    border: 1px solid #f2d024 !important;     /* accent border */
    border-radius: 4px !important;
    padding: 6px 8px !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* Force ALL price elements inside checkbox labels to be visible */
.woocommerce .bundle_form label.bundled_product_optional_checkbox .price,
.woocommerce .bundle_form label.bundled_product_optional_checkbox .woocommerce-Price-amount,
.woocommerce .bundle_form label.bundled_product_optional_checkbox .amount,
.woocommerce .bundle_form label.bundled_product_optional_checkbox .woocommerce-Price-currencySymbol,
.woocommerce .bundle_form label.bundled_product_optional_checkbox ins,
.woocommerce .bundle_form label.bundled_product_optional_checkbox del,
.woocommerce .bundle_form label.bundled_product_optional_checkbox [aria-hidden="true"] {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    z-index: auto !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-decoration: inherit !important;
}

/* Ensure nested price elements are also visible */
.woocommerce .bundle_form label.bundled_product_optional_checkbox .price .amount,
.woocommerce .bundle_form label.bundled_product_optional_checkbox .price .woocommerce-Price-currencySymbol,
.woocommerce .bundle_form label.bundled_product_optional_checkbox ins .amount,
.woocommerce .bundle_form label.bundled_product_optional_checkbox del .amount {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure the right column allows the label to expand on mobile */
@media screen and (max-width: 768px) {
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details {
        overflow: visible !important;
    }
}

/* Progressive enhancement: CSS :has() support for modern browsers */
@media screen and (max-width: 768px) {
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) {
        overflow: hidden !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 8px 15px !important;
        margin: 0 0 15px 0 !important;
        background: #fff !important;
        border-radius: 6px !important;
        border: 1px solid #e9ecef !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky {
        float: left !important;
        width: 80px !important;
        margin-right: 12px !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .mk-bundle-left-cart,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .mk-bundle-variant-price,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .mk-bundle-stock-info {
        display: none !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_images,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_image {
        display: block !important;
        float: none !important;
        width: 80px !important;
        height: 80px !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_images > a,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_image > a {
        display: block !important;
        width: 80px !important;
        height: 80px !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_images img,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-sticky .bundled_product_image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .details {
        float: left !important;
        width: calc(100% - 92px) !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        min-height: 0 !important;
    }
}

@media screen and (min-width: 769px) {
    /* Progressive enhancement: Desktop CSS :has() support for modern browsers */
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) {
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        min-height: 0 !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .details {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_images,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_image,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_excerpt,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .mk-bundle-excerpt,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .cart.bundled_item_cart_content,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .variations,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .variable-items-wrapper,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .woocommerce-variation-add-to-cart,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .single_variation_wrap {
        display: none !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_images {
        display: block !important;
        float: left !important;
        width: 80px !important;
        height: 80px !important;
        margin: 0 12px 0 0 !important;
        overflow: hidden !important;
        clear: none !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_image {
        width: 80px !important;
        height: 80px !important;
        margin: 0 !important;
        float: none !important;
        display: block !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_images > a,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_image > a {
        display: block !important;
        width: 80px !important;
        height: 80px !important;
    }
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_images img,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary.bundled_item_optional:has(.bundled_product_checkbox:not(:checked)) .bundled_product_image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* ==========================================================================
   MOBILE-ONLY: UNHIDE PRICE FRAGMENTS IN CHECKBOX LABELS
   ========================================================================== */
@media screen and (max-width: 768px) {
    /* MOBILE-ONLY: Unhide price fragments inside the optional checkbox label */
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox {
        display: inline-block !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow: visible !important;
    }
    
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox ins,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox ins,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox del,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox del,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .woocommerce-Price-amount,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .woocommerce-Price-amount,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .amount,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .amount,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .woocommerce-Price-currencySymbol,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .woocommerce-Price-currencySymbol {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        z-index: auto !important;
        color: inherit !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        text-decoration: inherit !important;
    }
    
    /* Ensure nested price elements are also visible */
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price .amount,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price .amount,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price .woocommerce-Price-currencySymbol,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox .price .woocommerce-Price-currencySymbol,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox ins .amount,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox ins .amount,
    .woocommerce .bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox del .amount,
    .cart.bundle_form .bundled_product.bundled_product_summary .details > label.bundled_product_optional_checkbox del .amount {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ==========================================================================
   CRITICAL: OVERRIDE MAIN THEME CSS FOR BUNDLE BUTTONS
   ========================================================================== */
/* Force bundle add-to-cart buttons to full width regardless of main theme CSS */
.single-product div.product .bundle_form .bundle_button .single_add_to_cart_button,
.single-product div.product .bundle_form .bundle_button .bundle_add_to_cart_button,
.single-product div.product .bundle_form .bundle_button button[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
}

/* ==========================================================================
   BUNDLE QUANTITY + ADD TO CART HORIZONTAL LAYOUT
   ========================================================================== */
/* Make quantity and add-to-cart button display horizontally on all screen sizes */
/* Target the actual container that holds both elements based on HTML structure */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form {
    width: 100% !important;
}

/* Clearfix to contain floated children */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form::after {
    content: "";
    display: table;
    clear: both;
}

/* Quantity field styling for horizontal layout (float-based) */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .quantity {
    float: left !important;
    width: 28% !important;
    margin: 0 2% 0 0 !important;
    box-sizing: border-box !important;
}

/* Bundle button container styling for horizontal layout (float-based) */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_button {
    float: right !important;
    width: 70% !important;
    margin: 0 !important;
    clear: none !important;
    box-sizing: border-box !important;
}

/* Align heights and spacing to avoid stacking */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .quantity {
    margin-top: 0 !important;
}
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_button {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .quantity input.qty {
    height: 44px !important;
    line-height: 44px !important;
    display: block !important;
}

/* Ensure the button inside bundle_button takes full width of its container */
.single-product div.product .bundle_form .bundle_button .single_add_to_cart_button,
.single-product div.product .bundle_form .bundle_button .bundle_add_to_cart_button,
.single-product div.product .bundle_form .bundle_button button[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
}

/* ==========================================================================
   RESPONSIVE BEHAVIOR FOR BUNDLE HORIZONTAL LAYOUT
   ========================================================================== */
/* Keep horizontal layout on small screens as requested */
@media (max-width: 480px) {
    .single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .quantity {
        width: 30% !important;
        margin-right: 2% !important;
    }
    .single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_button {
        width: 68% !important;
    }
}

/* Ensure the wrap container doesn't add horizontal padding that forces wrapping */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}

/* Quantity field styling for horizontal layout (float-based) */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .quantity {
    float: left !important;
    width: 24% !important;
    margin: 0 2% 0 0 !important;
    box-sizing: border-box !important;
}

/* Bundle button container styling for horizontal layout (float-based) */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_button {
    float: right !important;
    width: 74% !important;
    margin: 0 !important;
    clear: none !important;
    box-sizing: border-box !important;
}

/* ==========================================================================
   BUNDLE: INTERNAL LAYOUT (.bundle_button) — QUANTITY LEFT, BUTTON RIGHT
   Overrides earlier container-level floats; uses Storefront float pattern.
   ========================================================================== */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap .bundle_button {
	float: none !important;
	width: 100% !important;
	clear: none !important;
	overflow: hidden !important; /* clearfix for floated children */
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

/* Quantity column */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap .bundle_button .quantity {
	float: left !important;
	width: 140px !important;
	margin: 0 12px 0 0 !important;
	clear: none !important;
}

/* Button column fills remaining space */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap .bundle_button .single_add_to_cart_button {
	float: right !important;
	display: block !important;
	width: calc(100% - 152px) !important; /* 140 + 12 gap */
	max-width: 100% !important;
	margin: 0 !important;
	box-sizing: border-box !important;
}

/* Match add-to-cart button height to quantity input (consistent baseline) */
.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap .bundle_button .single_add_to_cart_button {
	height: 44px !important;
	line-height: 44px !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Mobile: add horizontal padding to the bundle card container */
@media (max-width: 768px) {
	.single-product div.product .summary-add-to-cart-form.summary-add-to-cart-form-bundle .bundle_form .bundle_wrap {
		padding-left: 15px !important;
		padding-right: 15px !important;
	}
}

