/**
 * Product Page Layout Fixes
 * 
 * Ensures single product page layout matches static/product.html exactly.
 * CSS Grid layout: gallery left (50%), info/sidebar right (50%).
 * 
 * NOTE: static/css/style.css already defines the layout CSS for .product__content.
 * This file contains minimal fixes only if WooCommerce or other styles override it.
 * Only enqueued on is_product() pages.
 */

/* Ensure product__content uses CSS Grid layout from static template */
body.single-product .product.product--layout--standard .product__content {
    display: grid;
    grid-template-columns: [gallery] calc(50% - 20px) [info] calc(50% - 20px);
    grid-template-rows: auto auto auto auto auto;
    grid-column-gap: 40px;
}

/* Gallery - left column, spans rows 1-6 */
body.single-product .product.product--layout--standard .product__gallery {
    grid-row-start: 1;
    grid-row-end: 6;
    grid-column: gallery;
    min-height: 0;
}

/* Info and Sidebar unified - right column, row 1 */
body.single-product .product.product--layout--standard .product__info-sidebar {
    grid-row: 1;
    grid-column: info;
    position: relative;
    min-height: 0;
}

/* Info - inside unified wrapper */
body.single-product .product.product--layout--standard .product__info {
    position: relative;
    min-height: 0;
}

/* Sidebar - inside unified wrapper */
body.single-product .product.product--layout--standard .product__sidebar {
    margin-top: 0;
}

/* Footer - right column, row 3 */
body.single-product .product.product--layout--standard .product__footer {
    grid-row: 3;
    grid-column: info;
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    body.single-product .product.product--layout--standard .product__content {
        grid-template-columns: [gallery] calc(44% - 15px) [info] calc(56% - 15px);
        grid-column-gap: 30px;
    }
}

/* Mobile (< 768px) - stack vertically */
@media (max-width: 767px) {
    body.single-product .product.product--layout--standard .product__content {
        display: block;
    }
    
    body.single-product .product.product--layout--standard .product__gallery {
        margin-bottom: 24px;
    }
}

/* Ensure no conflicts with WooCommerce or theme overrides */
body.single-product .product.product--layout--standard {
    /* Reset any theme overrides */
}

/* Ensure tabs and related sections are outside product__content grid */
body.single-product .product-tabs {
    margin-top: 60px;
    clear: both;
}

body.single-product .block-products-carousel {
    margin-top: 60px;
    clear: both;
}
