/* Frero Market v1.10.15 — responsive cart + checkout hardening.
   This file intentionally loads after every older cart/checkout layer. */

/* Always allow grid/flex children to shrink instead of forcing horizontal overflow. */
body.woocommerce-cart :where(.site-content,.ast-container,.entry-content,.woocommerce,.woocommerce-cart-form,.cart-collaterals,.cart_totals,.cross-sells),
body.woocommerce-checkout :where(.site-content,.ast-container,.entry-content,.woocommerce,form.checkout,#customer_details,#order_review,.frero-checkout-summary-visual){
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
body.woocommerce-cart,
body.woocommerce-checkout{overflow-x:hidden!important}

/* ---------- CART: tablets + phones ----------
   1024px is deliberate. It also protects iOS/Safari pages that temporarily
   report a wider layout viewport while browser chrome is changing size. */
@media (max-width:1024px){
  body.woocommerce-cart .site-content>.ast-container{
    width:100%!important;
    max-width:760px!important;
    padding:24px 16px 44px!important;
  }
  body.woocommerce-cart .entry-content>.woocommerce{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
  }
  body.woocommerce-cart .entry-content>.woocommerce>.woocommerce-cart-form{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0 0 16px!important;
  }
  body.woocommerce-cart .entry-content>.woocommerce>.cart-collaterals{
    display:flex!important;
    flex-direction:column!important;
    gap:28px!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
  }
  body.woocommerce-cart .cart-collaterals>.cart_totals,
  body.woocommerce-cart .cart-collaterals>.cross-sells{
    position:relative!important;
    inset:auto!important;
    float:none!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
  body.woocommerce-cart .cart-collaterals>.cart_totals{order:1!important}
  body.woocommerce-cart .cart-collaterals>.cross-sells{order:2!important}

  body.woocommerce-cart form.woocommerce-cart-form table.shop_table.cart,
  body.woocommerce-cart form.woocommerce-cart-form table.shop_table.cart tbody{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
  }
  body.woocommerce-cart form.woocommerce-cart-form tr.woocommerce-cart-form__cart-item,
  body.woocommerce-cart form.woocommerce-cart-form tr.cart_item{
    display:grid!important;
    grid-template-columns:76px minmax(0,1fr)!important;
    grid-template-rows:auto auto auto auto!important;
    grid-template-areas:
      "thumb name"
      "thumb price"
      "thumb qty"
      "remove remove"!important;
    column-gap:12px!important;
    row-gap:7px!important;
    width:100%!important;
    min-width:0!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    padding:12px!important;
    overflow:hidden!important;
  }
  body.woocommerce-cart tr.cart_item td.product-thumbnail{grid-area:thumb!important;align-self:start!important}
  body.woocommerce-cart td.product-thumbnail a,
  body.woocommerce-cart td.product-thumbnail img{
    width:76px!important;
    height:76px!important;
    min-width:76px!important;
    max-width:76px!important;
    min-height:76px!important;
    max-height:76px!important;
  }
  body.woocommerce-cart tr.cart_item td.product-name{
    grid-area:name!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:0!important;
    white-space:normal!important;
    overflow:visible!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  body.woocommerce-cart td.product-name .frero-cart-product-main,
  body.woocommerce-cart td.product-name .frero-cart-product-main a,
  body.woocommerce-cart td.product-name .frero-cart-product-variant{
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  body.woocommerce-cart tr.cart_item td.product-price{
    grid-area:price!important;
    justify-self:start!important;
    white-space:normal!important;
  }
  body.woocommerce-cart tr.cart_item td.product-quantity{
    grid-area:qty!important;
    justify-self:start!important;
    height:auto!important;
  }
  body.woocommerce-cart tr.cart_item td.product-remove{
    grid-area:remove!important;
    justify-self:start!important;
    align-self:start!important;
    margin:2px 0 0 88px!important;
  }

  body.woocommerce-cart .cart_totals{
    padding:18px!important;
  }
  body.woocommerce-cart .cart_totals table.shop_table,
  body.woocommerce-cart .cart_totals table.shop_table tbody{
    width:100%!important;
    max-width:100%!important;
  }
  body.woocommerce-cart .cart_totals table.shop_table tr{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:12px!important;
    width:100%!important;
  }
  body.woocommerce-cart .cart_totals table.shop_table th,
  body.woocommerce-cart .cart_totals table.shop_table td{
    min-width:0!important;
    width:auto!important;
  }
  body.woocommerce-cart .cart_totals table.shop_table td{
    text-align:right!important;
    white-space:nowrap!important;
  }

  /* Recommendation cards: never inherit the shop's 4-column mobile grid. */
  html body.woocommerce-cart .cross-sells ul.products,
  html body.woocommerce-cart .cross-sells ul.products[class*="columns-"]{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
  }
  html body.woocommerce-cart .cross-sells ul.products li.product,
  html body.woocommerce-cart .cross-sells ul.products[class*="columns-"] li.product{
    float:none!important;
    clear:none!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:10px!important;
    box-sizing:border-box!important;
  }
  body.woocommerce-cart .cross-sells li.product :where(a,span,strong,div,h2,.woocommerce-loop-product__title,.price){
    min-width:0!important;
    max-width:100%!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }
  body.woocommerce-cart .cross-sells .woocommerce-loop-product__title{
    min-height:0!important;
    font-size:12px!important;
    line-height:1.3!important;
  }
  body.woocommerce-cart .cross-sells button.frero-rec-pill{
    max-width:100%!important;
  }
}

@media (max-width:600px){
  body.woocommerce-cart .site-content>.ast-container{padding:20px 14px 40px!important}
  body.woocommerce-cart .entry-title{font-size:27px!important;line-height:1.08!important;margin-bottom:18px!important}
  body.woocommerce-cart form.woocommerce-cart-form tr.woocommerce-cart-form__cart-item,
  body.woocommerce-cart form.woocommerce-cart-form tr.cart_item{
    grid-template-columns:68px minmax(0,1fr)!important;
    column-gap:11px!important;
    padding:11px!important;
  }
  body.woocommerce-cart td.product-thumbnail a,
  body.woocommerce-cart td.product-thumbnail img{
    width:68px!important;height:68px!important;min-width:68px!important;max-width:68px!important;min-height:68px!important;max-height:68px!important;
  }
  body.woocommerce-cart tr.cart_item td.product-remove{margin-left:79px!important}
  body.woocommerce-cart .cart_totals{padding:16px!important}
  body.woocommerce-cart .cart_totals h2{font-size:19px!important}
  body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{min-height:48px!important;height:auto!important;padding:12px 14px!important;font-size:13px!important;text-align:center!important}
  body.woocommerce-cart .frero-cart-continue{min-height:44px!important;height:auto!important;padding:10px 12px!important;text-align:center!important}
  body.woocommerce-cart .cross-sells>h2:before{font-size:18px!important;line-height:1.2!important}
}

@media (max-width:360px){
  html body.woocommerce-cart .cross-sells ul.products,
  html body.woocommerce-cart .cross-sells ul.products[class*="columns-"]{grid-template-columns:1fr!important}
}

/* ---------- CHECKOUT: tablets + phones ---------- */
@media (max-width:1024px){
  body.woocommerce-checkout .site-content>.ast-container{
    width:100%!important;
    max-width:760px!important;
    padding:20px 16px 42px!important;
  }
  body.woocommerce-checkout form.checkout.woocommerce-checkout{
    display:flex!important;
    flex-direction:column!important;
    gap:20px!important;
    width:100%!important;
    max-width:100%!important;
  }
  body.woocommerce-checkout form.checkout.woocommerce-checkout>.frero-checkout-summary-visual,
  body.woocommerce-checkout form.checkout.woocommerce-checkout>#customer_details,
  body.woocommerce-checkout form.checkout.woocommerce-checkout>#order_review{
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin:0!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
  body.woocommerce-checkout #customer_details,
  body.woocommerce-checkout #customer_details .col-1,
  body.woocommerce-checkout #customer_details .col-2,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout #payment{
    float:none!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.woocommerce-checkout #order_review :where(.wc-stripe-cart-checkout-container,.wc-stripe-express-checkout-element,.wc-stripe-express-checkout-wrapper,#wc-stripe-express-checkout-element,.wcpay-express-checkout-wrapper,.wc-block-components-express-payment,.express-payment-methods,iframe){
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
}

@media (max-width:600px){
  body.woocommerce-checkout .frero-checkout-min-header__inner{
    width:100%!important;
    max-width:100%!important;
    height:54px!important;
    padding:0 14px!important;
  }
  body.woocommerce-checkout .frero-checkout-min-brand strong{font-size:14px!important}
  body.woocommerce-checkout .frero-checkout-back{font-size:11px!important}
  body.woocommerce-checkout .site-content>.ast-container{padding:16px 14px 36px!important}
  body.woocommerce-checkout form.checkout.woocommerce-checkout{gap:18px!important}
  body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper{grid-template-columns:1fr!important}
  body.woocommerce-checkout .woocommerce-billing-fields__field-wrapper>.form-row,
  body.woocommerce-checkout #billing_first_name_field,
  body.woocommerce-checkout #billing_last_name_field,
  body.woocommerce-checkout #billing_email_field{grid-column:1!important}
  body.woocommerce-checkout #customer_details :where(input.input-text,select,.select2-selection){font-size:16px!important} /* prevents iOS input zoom */
  body.woocommerce-checkout #payment li.wc_payment_method>label{
    min-width:0!important;
    padding-right:9px!important;
    overflow-wrap:anywhere!important;
  }
  body.woocommerce-checkout #payment li.wc_payment_method>label img{
    flex:0 1 auto!important;
    max-width:42%!important;
    height:auto!important;
    object-fit:contain!important;
  }
  body.woocommerce-checkout #place_order{min-height:48px!important;height:auto!important;padding:12px 14px!important}
}
