Fix single product layout conflicts with WooCommerce CSS

WooCommerce's layout CSS fought Bootstrap's grid in three ways:

1. Float-based two-column layout (width: 48% + float) on div.images
   and div.summary squeezed content inside our col-lg-6 columns.
   Reset with float: none; width: 100%.

2. Nested content wrapper (.container + #primary + <main>) from
   woocommerce_output_content_wrapper doubled up on the parent
   theme's existing .container. Remove the hooks entirely.

3. Sale badge (position: absolute; top: -.5em; z-index: 9) escaped
   the image column and blocked breadcrumb clicks. Override to
   top: 0.5em; z-index: 1 and use gx-* (horizontal-only gutters)
   to avoid negative margin-top on the .row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 18:25:01 +01:00
parent 7fda8e1962
commit c5f8e88ee4
3 changed files with 35 additions and 4 deletions

View File

@@ -209,10 +209,13 @@
/* ==========================================================================
Sale Badge
Positioning for the sale overlay badge on product cards.
Position inside gallery area, not overlapping breadcrumb.
WooCommerce sets top: -.5em which bleeds above the containing block.
========================================================================== */
.onsale {
.woocommerce span.onsale {
top: 0.5em;
left: 0.5em;
z-index: 1;
}
@@ -263,6 +266,18 @@
border-radius: var(--bs-border-radius);
}
/* ==========================================================================
Single Product Layout
Reset WooCommerce's float-based two-column layout for single product pages.
Bootstrap's row/col-lg-6 grid handles the layout instead.
========================================================================== */
.woocommerce div.product div.images,
.woocommerce div.product div.summary {
float: none;
width: 100%;
}
/* ==========================================================================
Variation Selectors
Spacing for variable product attribute dropdowns.