/*
 Theme Name: Divi Child
 Theme URI: https://www.elegantthemes.com/gallery/divi/
 Description: Divi Child Theme
 Author: Elegant Themes
 Author URI: https://www.elegantthemes.com
 Template: Divi
 Version: 1.0.0
*/

/* =Theme customization starts here
------------------------------------------------------- */
@import url("../Divi/style.css");

/* WooCommerce: ensure catalog/related product images fit inside their boxes */
/* Applies to Shop, Category archives, Related/Upsells/Cross-sells grids */
.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img,
.woocommerce .related ul.products li.product a img,
.woocommerce .upsells ul.products li.product a img,
.woocommerce .cross-sells ul.products li.product a img,
/* Divi module wrapper for related/upsell blocks */
.et_shop_image img,
/* Single product gallery image */
.woocommerce div.product div.images img {
  width: 100%;
  height: auto;            /* keep intrinsic height unless aspect-ratio kicks in */
  aspect-ratio: 1 / 1;     /* make the image box square like Woo product cards */
  object-fit: contain !important; /* prevent cropping; letterbox inside the square */
  background-color: #fff;  /* white backdrop behind transparent PNGs */
  display: block;
}

/* Fallback for older browsers without aspect-ratio support */
@supports not (aspect-ratio: 1 / 1) {
  .woocommerce ul.products li.product a img,
  .woocommerce-page ul.products li.product a img,
  .woocommerce .related ul.products li.product a img,
  .woocommerce .upsells ul.products li.product a img,
  .woocommerce .cross-sells ul.products li.product a img,
  .et_shop_image img {
    height: 260px;         /* fixed, reasonable thumb height */
  }
}

/* Optional: keep image from touching card edges when contained */
.woocommerce ul.products li.product a img { padding: 6px; box-sizing: border-box; }

/* Disable sticky header on pages containing the Wax Selector */
/* Prefer a JS-applied body class for broad browser support */
body.waxapp-active #main-header,
body.waxapp-active #top-header {
  position: static !important;
  transform: none !important;
  top: 0 !important;
  box-shadow: none !important;
}
/* Divi often adds padding to #page-container when header is fixed; remove it on this page */
body.waxapp-active #page-container,
body.waxapp-active.et_fixed_nav #page-container,
body.waxapp-active.et_fixed_nav.et_show_nav #page-container {
  padding-top: 0 !important;
}
/* If Divi toggles the fixed class on the header, neutralize it */
body.waxapp-active #main-header.et-fixed-header,
body.waxapp-active #top-header.et-fixed-header {
  position: static !important;
}
/* Progressive enhancement: if :has() is supported, also match by container presence */
body:has(#wax-app) #main-header,
body:has(#waxapp) #main-header {
  position: static !important;
  transform: none !important;
  top: 0 !important;
}
body:has(#wax-app) #page-container,
body:has(#waxapp) #page-container {
  padding-top: 0 !important;
}


