/* ODO Commerce OS v2.3.0 — runtime stability & product experience lock.
 * Loads after all legacy storefront layers so recovery rules win without
 * rewriting the historical stylesheets. */

/* Root/front-page recovery must occupy the same full-width canvas as the
 * normal Elementor/shortcode home. */
body.odo-commerce-ui .odo-root-runtime-body{
  width:100%;max-width:none!important;margin:0!important;padding:0!important;
  background:var(--odo-paper,#f6f3ed);overflow:clip;
}
body.odo-commerce-ui .odo-root-runtime-body>.odo-storefront-home,
body.odo-commerce-ui .odo-root-runtime-body>.elementor{
  width:100%!important;max-width:none!important;margin:0!important;
}

/* Woo's classic gallery starts at opacity:0 until JS initialisation. Theme
 * Builder/FSE combinations can legitimately skip that transition. Never leave
 * the purchasable product image invisible. */
body.odo-commerce-ui.single-product .woocommerce-product-gallery,
body.odo-commerce-ui.single-product .woocommerce-product-gallery.woocommerce-product-gallery--with-images{
  opacity:1!important;visibility:visible!important;min-height:0!important;
}
body.odo-commerce-ui.single-product .woocommerce-product-gallery__wrapper{
  min-height:0!important;height:auto!important;
}
body.odo-commerce-ui.single-product .woocommerce-product-gallery__image,
body.odo-commerce-ui.single-product .woocommerce-product-gallery__image a,
body.odo-commerce-ui.single-product .woocommerce-product-gallery__image img{
  visibility:visible!important;opacity:1!important;
}
body.odo-commerce-ui .odo-tb-product{
  width:min(var(--odo-max-width,1480px),calc(100% - 40px))!important;
  margin:0 auto!important;padding:34px 0 80px!important;
}
body.odo-commerce-ui .odo-premium-product{
  grid-template-columns:minmax(0,1.08fr) minmax(360px,.92fr)!important;
  gap:clamp(28px,4vw,72px)!important;align-items:start!important;
  min-height:0!important;margin:0 0 72px!important;
}
body.odo-commerce-ui .odo-premium-product__gallery{
  min-width:0!important;min-height:0!important;align-self:start!important;
}
body.odo-commerce-ui .odo-premium-product__summary{
  min-width:0!important;align-self:start!important;
}

/* Deterministic no-JS fallback gallery. It is only emitted if the native Woo
 * gallery produced no image HTML. */
.odo-native-gallery{display:grid;gap:12px;width:100%}
.odo-native-gallery__stage{position:relative;width:100%;background:#eceae5;border-radius:24px;overflow:hidden}
.odo-native-gallery__slide{display:none;margin:0!important;width:100%}
.odo-native-gallery__slide.is-active{display:block}
.odo-native-gallery__slide a{display:block;width:100%}
.odo-native-gallery__image,.odo-native-gallery__placeholder{display:block;width:100%!important;height:auto!important;aspect-ratio:4/5;object-fit:cover}
.odo-native-gallery__thumbs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.odo-native-gallery__thumb{appearance:none;border:1px solid transparent;border-radius:12px;background:#eceae5;padding:0;overflow:hidden;cursor:pointer;opacity:.68}
.odo-native-gallery__thumb.is-active{border-color:#111;opacity:1}
.odo-native-gallery__thumb img{display:block;width:100%!important;height:auto!important;aspect-ratio:1/1;object-fit:cover}

/* Product tabs/related should follow the product immediately instead of being
 * pushed down by a phantom gallery row. */
body.odo-commerce-ui .odo-tb-product .woocommerce-tabs,
body.odo-commerce-ui .odo-tb-product .related,
body.odo-commerce-ui .odo-tb-product .upsells{
  clear:both!important;position:relative!important;margin-top:56px!important;
}

/* Related product cards: predictable premium grid, no legacy Woo floats. */
body.odo-commerce-ui .odo-tb-product .related ul.products,
body.odo-commerce-ui .odo-tb-product .upsells ul.products{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:var(--odo-grid-gap,14px)!important;width:100%!important;margin:22px 0 0!important;
}
body.odo-commerce-ui .odo-tb-product .related ul.products li.product,
body.odo-commerce-ui .odo-tb-product .upsells ul.products li.product{
  float:none!important;width:auto!important;margin:0!important;min-width:0!important;
}

@media(max-width:1024px){
  body.odo-commerce-ui .odo-premium-product{grid-template-columns:minmax(0,1fr) minmax(320px,.85fr)!important;gap:28px!important}
  body.odo-commerce-ui .odo-tb-product .related ul.products,
  body.odo-commerce-ui .odo-tb-product .upsells ul.products{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:780px){
  body.odo-commerce-ui .odo-tb-product{width:calc(100% - 16px)!important;padding-top:18px!important}
  body.odo-commerce-ui .odo-premium-product{grid-template-columns:1fr!important;gap:22px!important}
  body.odo-commerce-ui .odo-premium-product__summary{position:static!important}
  .odo-native-gallery__stage{border-radius:16px}.odo-native-gallery__thumbs{grid-template-columns:repeat(5,minmax(0,1fr))}
  body.odo-commerce-ui .odo-tb-product .related ul.products,
  body.odo-commerce-ui .odo-tb-product .upsells ul.products{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
