/* 4.7 Safe emergency reset: no hidden footer, no DOM-loop dependent styling. */
html body.usg-theme,
html body.usg-theme *{box-sizing:border-box;}
html body.usg-theme{overflow-x:hidden;}
html body.usg-theme img{max-width:100%;height:auto;}

/* Product page: stable two-column desktop, one-column mobile. */
html body.usg-theme.single-product div.product.usg-single-product-layout,
html body.usg-theme.single-product div.product.product{max-width:1240px!important;width:min(100%,1240px)!important;margin-inline:auto!important;padding-inline:clamp(12px,3vw,24px)!important;overflow:visible!important;}
html body.usg-theme.single-product .usg-single-product-hero{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:clamp(22px,4vw,52px)!important;align-items:start!important;position:relative!important;overflow:visible!important;width:100%!important;max-width:100%!important;}
html body.usg-theme.single-product .usg-single-product-gallery,
html body.usg-theme.single-product .usg-single-product-summary,
html body.usg-theme.single-product .summary,
html body.usg-theme.single-product .entry-summary{min-width:0!important;max-width:100%!important;width:100%!important;position:static!important;top:auto!important;bottom:auto!important;inset:auto!important;transform:none!important;z-index:auto!important;height:auto!important;max-height:none!important;overflow:visible!important;}
html body.usg-theme.single-product .usg-single-product-summary > *,
html body.usg-theme.single-product .summary > *,
html body.usg-theme.single-product .entry-summary > *{max-width:100%!important;min-width:0!important;}
html body.usg-theme.single-product .usg-single-product-content,
html body.usg-theme.single-product .woocommerce-tabs,
html body.usg-theme.single-product .related.products,
html body.usg-theme.single-product .upsells.products{grid-column:1/-1!important;display:block!important;width:100%!important;max-width:100%!important;clear:both!important;position:relative!important;z-index:1!important;}

/* Gallery: do not generate blank blocks, keep WooCommerce structure visible. */
html body.usg-theme.single-product .woocommerce-product-gallery{display:block!important;width:100%!important;max-width:100%!important;opacity:1!important;position:relative!important;overflow:hidden!important;border-radius:22px!important;background:#fff!important;}
html body.usg-theme.single-product .woocommerce-product-gallery__wrapper{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;}
html body.usg-theme.single-product .woocommerce-product-gallery__image{display:none!important;width:100%!important;max-width:100%!important;margin:0!important;text-align:center!important;background:#fff!important;}
html body.usg-theme.single-product .woocommerce-product-gallery__image:first-child,
html body.usg-theme.single-product .woocommerce-product-gallery__image.usg-47-active-main{display:flex!important;align-items:center!important;justify-content:center!important;}
html body.usg-theme.single-product .woocommerce-product-gallery__image a{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;max-width:100%!important;}
html body.usg-theme.single-product .woocommerce-product-gallery__image img{display:block!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:520px!important;margin-inline:auto!important;object-fit:contain!important;opacity:1!important;visibility:visible!important;}
html body.usg-theme.single-product .flex-control-thumbs{display:flex!important;gap:10px!important;overflow-x:auto!important;overflow-y:hidden!important;list-style:none!important;padding:10px 2px 2px!important;margin:12px 0 0!important;scrollbar-width:thin!important;}
html body.usg-theme.single-product .flex-control-thumbs li{flex:0 0 74px!important;width:74px!important;min-width:74px!important;margin:0!important;padding:0!important;display:block!important;}
html body.usg-theme.single-product .flex-control-thumbs img{display:block!important;width:74px!important;height:74px!important;object-fit:contain!important;border:1px solid rgba(15,23,42,.12)!important;border-radius:14px!important;background:#fff!important;padding:4px!important;cursor:pointer!important;opacity:.78!important;transition:opacity .15s ease,border-color .15s ease,transform .15s ease!important;}
html body.usg-theme.single-product .flex-control-thumbs img.flex-active,
html body.usg-theme.single-product .flex-control-thumbs img.is-active{opacity:1!important;border-color:#2563eb!important;transform:translateY(-1px)!important;}

/* Product options/PCB component: full-width blocks before price/action. */
html body.usg-theme.single-product form.cart,
html body.usg-theme.single-product form.variations_form.cart{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:14px!important;width:100%!important;max-width:100%!important;overflow:visible!important;clear:both!important;}
html body.usg-theme.single-product .pcb-master-box{display:flex!important;flex-direction:column!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:16px 0!important;padding:clamp(14px,2vw,20px)!important;clear:both!important;position:relative!important;inset:auto!important;transform:none!important;overflow:visible!important;order:20!important;direction:rtl!important;writing-mode:horizontal-tb!important;background:#fff!important;border-radius:18px!important;}
html body.usg-theme.single-product .pcb-master-box *,
html body.usg-theme.single-product .pcb-card,
html body.usg-theme.single-product .pcb-addon-item,
html body.usg-theme.single-product .pcb-addon-info,
html body.usg-theme.single-product .pcb-addon-text,
html body.usg-theme.single-product .pcb-addon-title,
html body.usg-theme.single-product .pcb-card-label,
html body.usg-theme.single-product .pcb-card-price{max-width:100%!important;min-width:0!important;writing-mode:horizontal-tb!important;text-orientation:mixed!important;white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important;line-height:1.7!important;}
html body.usg-theme.single-product .pcb-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;width:100%!important;}
html body.usg-theme.single-product .pcb-card{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-height:118px!important;text-align:center!important;}
html body.usg-theme.single-product .pcb-addon-list{display:flex!important;flex-direction:column!important;gap:10px!important;width:100%!important;}
html body.usg-theme.single-product .pcb-addon-item{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:12px!important;width:100%!important;}
html body.usg-theme.single-product .pcb-addon-info{display:flex!important;align-items:center!important;gap:12px!important;min-width:0!important;}
html body.usg-theme.single-product .pcb-total-bar{display:none!important;}

/* Price below options, action row after price. */
html body.usg-theme.single-product form.cart .price,
html body.usg-theme.single-product form.cart p.price,
html body.usg-theme.single-product form.cart .woocommerce-variation-price,
html body.usg-theme.single-product form.cart .usg-47-price-slot{order:80!important;width:100%!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;flex-wrap:wrap!important;margin:0!important;clear:both!important;}
html body.usg-theme.single-product form.cart .usg-47-actions-row,
html body.usg-theme.single-product form.cart .woocommerce-variation-add-to-cart{order:90!important;display:flex!important;align-items:stretch!important;gap:12px!important;width:100%!important;clear:both!important;float:none!important;}
html body.usg-theme.single-product form.cart .quantity{flex:0 0 132px!important;width:132px!important;min-width:132px!important;max-width:132px!important;height:58px!important;margin:0!important;float:none!important;}
html body.usg-theme.single-product form.cart .single_add_to_cart_button{flex:1 1 auto!important;width:auto!important;min-width:0!important;min-height:58px!important;height:58px!important;margin:0!important;border-radius:16px!important;font-weight:800!important;}

/* Checkout: stable layout without floating odd boxes. */
html body.usg-theme.woocommerce-checkout .usg-checkout-grid{display:grid!important;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr)!important;gap:24px!important;align-items:start!important;width:100%!important;max-width:1180px!important;margin-inline:auto!important;padding-inline:16px!important;}
html body.usg-theme.woocommerce-checkout .usg-checkout-customer,
html body.usg-theme.woocommerce-checkout .usg-checkout-review{min-width:0!important;width:100%!important;max-width:100%!important;position:relative!important;float:none!important;clear:none!important;}
html body.usg-theme.woocommerce-checkout .usg-checkout-review{position:sticky!important;top:96px!important;align-self:start!important;}
html body.usg-theme.woocommerce-checkout form.checkout .form-row{width:100%!important;float:none!important;margin:0 0 14px!important;}
html body.usg-theme.woocommerce-checkout #order_review,
html body.usg-theme.woocommerce-checkout .woocommerce-checkout-review-order{width:100%!important;max-width:100%!important;overflow:hidden!important;}
html body.usg-theme.woocommerce-checkout table.shop_table{width:100%!important;max-width:100%!important;table-layout:auto!important;}

/* Hide only the theme-generated custom footer, not user's GeneratePress/Elementor footer. */
html body.usg-theme .usg-footer[data-usg-generated="1"]{display:none!important;}

@media(max-width:900px){
  html body.usg-theme.single-product div.product.usg-single-product-layout,
  html body.usg-theme.single-product div.product.product{padding-inline:12px!important;}
  html body.usg-theme.single-product .usg-single-product-hero{display:block!important;}
  html body.usg-theme.single-product .usg-single-product-gallery,
  html body.usg-theme.single-product .usg-single-product-summary{width:100%!important;max-width:100%!important;margin:0 0 18px!important;}
  html body.usg-theme.single-product .woocommerce-product-gallery__image img{max-height:380px!important;}
  html body.usg-theme.single-product .pcb-grid{grid-template-columns:1fr 1fr!important;}
  html body.usg-theme.woocommerce-checkout .usg-checkout-grid{display:block!important;padding-inline:12px!important;}
  html body.usg-theme.woocommerce-checkout .usg-checkout-review{position:relative!important;top:auto!important;margin-top:18px!important;}
}
@media(max-width:560px){
  html body.usg-theme.single-product .woocommerce-product-gallery__image img{max-height:320px!important;}
  html body.usg-theme.single-product .pcb-grid{grid-template-columns:1fr!important;}
  html body.usg-theme.single-product .pcb-addon-item{grid-template-columns:1fr!important;}
  html body.usg-theme.single-product form.cart .quantity{flex-basis:106px!important;width:106px!important;min-width:106px!important;max-width:106px!important;height:54px!important;}
  html body.usg-theme.single-product form.cart .single_add_to_cart_button{height:54px!important;min-height:54px!important;}
}
