/* Al Margen Studio 4.21.1: corrections based on actual single-product and checkout screenshots.
   Only layout and presentation. WooCommerce retains all price/payment/order logic. */

/* 1. SINGLE PRODUCT: a simple-product form must NOT turn every child into a flex column.
   In 4.21 the payment note had become an ultra-narrow flex item next to a huge button. */
body.am-commerce-product .am-single-config form.cart:not(.variations_form){
  display:flow-root!important; width:100%!important; min-width:0!important;
  margin:14px 0 0!important;
}
body.am-commerce-product .am-single-config form.cart:not(.variations_form)>:is(.am-print-artwork,.am-print-final-label,.am-print-designer-link,.am-print-artwork-hint,.payment-note,.am-production){
  display:block!important;float:none!important;clear:both!important;width:100%!important;
  max-width:100%!important;min-width:0!important;flex:none!important;
}
body.am-commerce-product .am-single-config form.cart:not(.variations_form)>.quantity{
  float:left!important;display:block!important;margin:0 12px 0 0!important;
  width:82px!important;max-width:82px!important;min-width:0!important;flex:none!important;
}
body.am-commerce-product .am-single-config form.cart:not(.variations_form)>button.single_add_to_cart_button{
  display:inline-flex!important;float:none!important;vertical-align:top!important;
  width:calc(100% - 94px)!important;max-width:100%!important;min-width:0!important;
  flex:none!important;white-space:normal!important;margin:0!important;
  font:750 16px/1.3 var(--font)!important;
}
body.am-commerce-product .am-single-config form.cart:not(.variations_form)>.payment-note{
  margin:15px 0 0!important;padding:12px 14px!important;
  background:#f4f8ef;border:1px solid #dce7d4;border-radius:12px;
}
/* Variable-product purchase: layout grid controls only the purchase row, not the entire form. */
body.am-commerce-product .am-single-config form.cart.variations_form{display:block!important;width:100%!important;min-width:0!important}
body.am-commerce-product .am-single-config .single_variation_wrap,
body.am-commerce-product .am-single-config .woocommerce-variation,
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart{width:100%!important;max-width:100%!important;min-width:0!important}
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart{
  display:grid!important;grid-template-columns:82px minmax(0,1fr);gap:12px;
  align-items:center!important;
}
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>.quantity{
  grid-column:1;margin:0!important;width:82px!important;min-width:0!important;
}
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>button.single_add_to_cart_button{
  grid-column:2;width:100%!important;min-width:0!important;margin:0!important;flex:none!important;
  font:750 16px/1.3 var(--font)!important;
}
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>.payment-note,
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>.am-print-artwork,
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>.am-print-final-label,
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>div:not(.quantity),
body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>p{
  grid-column:1/-1!important;min-width:0!important;width:100%!important;max-width:100%!important;
}
/* Artwork step is part of the variable form but should never share a line with totals or button. */
body.am-commerce-product .am-single-config form.cart .am-print-artwork,
body.am-commerce-product .am-single-config form.cart .am-print-final-label{
  display:block!important;float:none!important;clear:both!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
}
body.am-commerce-product .am-single-config .payment-note{
  display:flex!important;align-items:flex-start!important;gap:9px!important;
  flex:0 0 100%!important;float:none!important;clear:both!important;
  width:100%!important;max-width:100%!important;min-width:0!important;
  font:500 13px/1.55 var(--font)!important;color:#415342!important;
  margin:15px 0 0!important;padding:12px 14px!important;
  background:#f4f8ef;border:1px solid #dce7d4;border-radius:12px;
  overflow-wrap:break-word!important;white-space:normal!important;
}
body.am-commerce-product .am-single-config .payment-note span{flex:0 0 auto;line-height:1.5}
/* Short description should be a restrained explanation near the price, not a giant paragraph beneath checkout. */
body.am-commerce-product .am-single-config .woocommerce-product-details__short-description{
  display:block!important;clear:both!important;min-width:0!important;width:100%!important;max-width:100%!important;
  font:400 15px/1.65 var(--font)!important;color:#455548!important;
  margin:4px 0 20px!important;padding:0!important;border:0!important;
}
body.am-commerce-product .am-single-config .woocommerce-product-details__short-description :is(p,li){
  font:inherit!important;color:inherit!important;margin:0 0 8px!important;overflow-wrap:break-word!important;
}
body.am-commerce-product .am-single-config .product_meta{
  font:450 13px/1.7 var(--font)!important;margin:24px 0 0!important;
  padding:18px 0 0!important;max-width:100%!important;min-width:0!important;
  color:#576758!important;border-top:1px solid #e3e8df!important;
}
body.am-commerce-product .am-single-config .product_meta>span{display:block!important;margin:2px 0!important}
body.am-commerce-product .am-single-config .product_meta a{font:inherit!important;color:#344936!important}
body.am-commerce-product .am-single-config .am-print-final-label{font:650 14px/1.6 var(--font)!important;margin:20px 0 13px!important;padding:17px 0 0!important;border-top:1px solid #e4e9e0}

/* 2. CHECKOUT BLOCK: current order-review card overflows from a 23-36px product title,
   duplicated unit price and a full commercial product description. Provide a compact grid.
   Do not hide custom order options or quantities. */
body.am-commerce-checkout .wc-block-checkout,
body.am-commerce-checkout .wc-block-checkout__main,
body.am-commerce-checkout .wc-block-components-sidebar,
body.am-commerce-checkout .wc-block-components-order-summary,
body.am-commerce-checkout .wc-block-components-order-summary__content,
body.am-commerce-checkout .wc-block-components-order-summary-item,
body.am-commerce-checkout .wc-block-components-order-summary-item__description{min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
body.am-commerce-checkout .wc-block-components-order-summary-item{
  display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;
  align-items:start!important;column-gap:13px!important;row-gap:8px!important;
  width:100%!important;min-width:0!important;margin:0!important;
  padding:16px 0!important;border-bottom:1px solid #e1e7dc!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__image{
  position:relative!important;grid-column:1!important;grid-row:1!important;
  display:block!important;float:none!important;width:58px!important;max-width:58px!important;
  min-width:0!important;margin:0!important;padding:0!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__image img{
  display:block!important;width:58px!important;height:58px!important;max-width:58px!important;
  object-fit:contain!important;border-radius:9px!important;border:1px solid #e1e6dc!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__description{
  grid-column:2!important;grid-row:1!important;display:block!important;
  float:none!important;width:100%!important;min-width:0!important;
  padding:0!important;margin:0!important;overflow-wrap:break-word!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name,
body.am-commerce-checkout .wc-block-components-order-summary-item__description a.wc-block-components-product-name{
  display:-webkit-box!important;-webkit-line-clamp:3;-webkit-box-orient:vertical;
  overflow:hidden!important;max-width:100%!important;width:100%!important;
  font:700 15px/1.36 var(--font)!important;letter-spacing:-.012em!important;
  color:#1e291f!important;text-decoration:none!important;word-break:normal!important;
  overflow-wrap:break-word!important;margin:0 0 6px!important;padding:0!important;
}
/* Long editorial descriptions don't belong in the transaction summary: full text stays on product page. */
body.am-commerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-metadata__description,
body.am-commerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-description,
body.am-commerce-checkout .wc-block-components-order-summary-item__description>.wc-block-components-product-price,
body.am-commerce-checkout .wc-block-components-order-summary-item__description>.wc-block-components-product-price__value{
  display:none!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-metadata{
  width:100%!important;min-width:0!important;max-width:100%!important;
  margin:4px 0 0!important;font:450 12px/1.45 var(--font)!important;color:#536153!important;
  overflow-wrap:anywhere!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-details{
  display:block!important;width:100%!important;min-width:0!important;
  font:450 12px/1.45 var(--font)!important;padding:0!important;margin:6px 0 0!important;
  list-style:none!important;overflow-wrap:anywhere!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item .wc-block-components-product-details li{
  margin:3px 0!important;padding:0!important;line-height:1.45!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__total-price{
  grid-column:2!important;grid-row:2!important;display:block!important;
  justify-self:end!important;align-self:end!important;float:none!important;
  width:auto!important;max-width:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;text-align:right!important;
  font:750 17px/1.35 var(--font)!important;white-space:normal!important;
  color:#1c281c!important;overflow-wrap:normal!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__total-price :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount,.amount,bdi,ins){
  font:750 17px/1.35 var(--font)!important;letter-spacing:0!important;color:#172118!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__total-price del,
body.am-commerce-checkout .wc-block-components-order-summary-item__total-price del :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount,.amount,bdi){
  font:500 12px/1.35 var(--font)!important;color:#747e71!important;
}
body.am-commerce-checkout .wc-block-components-order-summary-item__quantity{
  top:-6px!important;right:-6px!important;left:auto!important;
  min-width:20px!important;height:20px!important;font-size:11px!important;line-height:20px!important;
}
body.am-commerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
body.am-commerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary__content{width:100%!important;padding:0!important;margin:0!important;border:0!important}
body.am-commerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){
  font:750 15px/1.35 var(--font)!important;color:#243224!important;
}
body.am-commerce-checkout .wc-block-components-sidebar .wc-block-components-totals-footer-item :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){
  font:800 23px/1.3 var(--font)!important;color:#152015!important;
}
body.am-commerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item__label{
  font:600 13px/1.45 var(--font)!important;color:#3f4f40!important;
}

/* 3. CLASSIC CHECKOUT: fixed two-column table, consistent small item title and line total. */
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table{
  width:100%!important;min-width:0!important;max-width:100%!important;
  table-layout:fixed!important;border:0!important;border-collapse:collapse!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table :is(th.product-name,td.product-name){
  width:67%!important;max-width:67%!important;font:600 14px/1.45 var(--font)!important;
  color:#233024!important;text-align:left!important;word-break:normal!important;overflow-wrap:break-word!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table :is(th.product-total,td.product-total){
  width:33%!important;max-width:33%!important;text-align:right!important;
  font:750 16px/1.35 var(--font)!important;vertical-align:top!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table td.product-name a{
  font:inherit!important;color:inherit!important;letter-spacing:0!important;text-decoration:none!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table td.product-total :is(.amount,bdi){
  font:750 16px/1.35 var(--font)!important;color:#172118!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table .order-total :is(.amount,bdi){
  font:800 23px/1.35 var(--font)!important;color:#101a11!important;
}
body.am-commerce-checkout #order_review table.woocommerce-checkout-review-order-table :is(dl.variation,.wc-item-meta){
  font:450 12px/1.45 var(--font)!important;color:#516251!important;
  margin-top:6px!important;overflow-wrap:anywhere!important;
}

/* 4. CART: keep product names, ordinary line price and overall total proportional. */
body.am-commerce-cart .woocommerce-cart-form table.cart td.product-name>a{
  font:700 16px/1.4 var(--font)!important;letter-spacing:-.012em!important;
  overflow-wrap:break-word!important;word-break:normal!important;
}
body.am-commerce-cart .woocommerce-cart-form table.cart td.product-price :is(.amount,bdi){
  font:650 14px/1.4 var(--font)!important;color:#3f5040!important;
}
body.am-commerce-cart .woocommerce-cart-form table.cart td.product-subtotal :is(.amount,bdi){
  font:750 18px/1.35 var(--font)!important;color:#172118!important;
}
body.am-commerce-cart .woocommerce .cart_totals table.shop_table tr:not(.order-total) :is(.amount,bdi){
  font:700 16px/1.35 var(--font)!important;color:#243324!important;
}
body.am-commerce-cart .woocommerce .cart_totals table.shop_table .order-total :is(.amount,bdi){
  font:800 23px/1.35 var(--font)!important;color:#101a11!important;
}
body.am-commerce-cart .wc-block-cart-item__product .wc-block-components-product-name{
  font:700 15px/1.45 var(--font)!important;overflow-wrap:break-word!important;
}
body.am-commerce-cart .wc-block-cart-item__product .wc-block-components-product-metadata__description{display:none!important}
body.am-commerce-cart .wc-block-cart-item__prices :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){font:650 14px/1.4 var(--font)!important}
body.am-commerce-cart .wc-block-cart-item__total :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){font:750 18px/1.3 var(--font)!important}
body.am-commerce-cart .wc-block-components-sidebar .wc-block-components-totals-footer-item :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){font:800 23px/1.3 var(--font)!important}

@media(max-width:900px){
  body.am-commerce-checkout .wc-block-components-order-summary-item{grid-template-columns:50px minmax(0,1fr)!important;column-gap:10px!important}
  body.am-commerce-checkout .wc-block-components-order-summary-item__image,
  body.am-commerce-checkout .wc-block-components-order-summary-item__image img{width:50px!important;max-width:50px!important;height:50px!important}
}
@media(max-width:560px){
  body.am-commerce-product .am-single-config form.cart:not(.variations_form)>button.single_add_to_cart_button{
    width:calc(100% - 94px)!important;font-size:14px!important;padding-inline:10px!important;
  }
  body.am-commerce-product .am-single-config .woocommerce-variation-add-to-cart>button.single_add_to_cart_button{font-size:14px!important;padding-inline:10px!important}
  body.am-commerce-checkout .wc-block-components-order-summary-item__description .wc-block-components-product-name{font-size:14px!important;line-height:1.4!important}
  body.am-commerce-checkout .wc-block-components-order-summary-item__total-price,
  body.am-commerce-checkout .wc-block-components-order-summary-item__total-price :is(.wc-block-formatted-money-amount,.wc-block-components-formatted-money-amount){font-size:16px!important}
  body.am-commerce-product .am-single-config .woocommerce-product-details__short-description{font-size:14px!important}
}
