/* Azara B2B — Cart Block + classic Checkout presentation repair | 0.3.7.12.
 * Strictly page-scoped. No WooCommerce business logic, blocks, notices or order mutations.
 * The header is replaced only when the expected FSE template part is present.
 */
body.azch-commerce-cart,body.azch-commerce-checkout {
  --azcc-navy:#102A43;--azcc-teal:#0D9488;--azcc-muted:#526C7B;--azcc-border:#D9E7E9;
  background:#F6FAF9;color:var(--azcc-navy);font-family:Inter,system-ui,-apple-system,'Segoe UI',Arial,sans-serif;
}
body.azch-commerce-cart .wp-site-blocks,body.azch-commerce-checkout .wp-site-blocks {min-width:0;max-width:100%;}
/* Block themes frequently constrain the Group around Post Content to 620–650px.
 * Widen only main-content ancestors on Cart/Checkout; never change theme headers/footers. */
body.azch-commerce-cart .wp-site-blocks main:has(.wp-block-post-content),
body.azch-commerce-checkout .wp-site-blocks main:has(.wp-block-post-content),
body.azch-commerce-cart .wp-site-blocks main .wp-block-group:has(.wp-block-post-content),
body.azch-commerce-checkout .wp-site-blocks main .wp-block-group:has(.wp-block-post-content) {
  box-sizing:border-box;width:100%!important;max-width:100%!important;min-width:0;margin-inline:auto!important;
}
/* The theme's constrained post-content and shortcode wrappers must not squeeze Commerce UI.
 * No 100vw, negative margins or global theme/header rules. */
body.azch-commerce-cart .wp-block-post-content,
body.azch-commerce-cart .entry-content,
body.azch-commerce-checkout .wp-block-post-content,
body.azch-commerce-checkout .entry-content {
  box-sizing:border-box;min-width:0;width:min(100% - 32px,1220px)!important;
  max-width:1220px!important;margin-inline:auto!important;
}
body.azch-commerce-cart .wp-block-post-content > .wp-block-woocommerce-cart,
body.azch-commerce-cart .entry-content > .wp-block-woocommerce-cart,
body.azch-commerce-cart .wp-block-woocommerce-cart,
body.azch-commerce-checkout .wp-block-post-content .wp-block-shortcode,
body.azch-commerce-checkout .entry-content .wp-block-shortcode {
  box-sizing:border-box;min-width:0;max-width:100%!important;width:100%!important;margin-inline:auto!important;
}
body.azch-commerce-cart .wp-block-woocommerce-cart *,
body.azch-commerce-cart .wp-block-woocommerce-cart *::before,
body.azch-commerce-cart .wp-block-woocommerce-cart *::after,
body.azch-commerce-checkout .woocommerce *,
body.azch-commerce-checkout .woocommerce *::before,
body.azch-commerce-checkout .woocommerce *::after {box-sizing:border-box;}

/* CART: keep the existing WooCommerce Cart Block and its quantity/discount/shipping controls. */
body.azch-commerce-cart .wc-block-cart,
body.azch-commerce-cart .wc-block-components-sidebar-layout,
body.azch-commerce-cart .wc-block-cart__main,
body.azch-commerce-cart .wc-block-cart__sidebar,
body.azch-commerce-cart .wc-block-components-main,
body.azch-commerce-cart .wc-block-components-sidebar {box-sizing:border-box;min-width:0;max-width:100%;}
body.azch-commerce-cart .wc-block-cart {width:100%;padding:clamp(16px,2.4vw,28px) 0 65px;}
body.azch-commerce-cart .wc-block-components-sidebar-layout {
  width:100%!important;max-width:100%!important;margin:0 auto!important;
  display:grid!important;grid-template-columns:minmax(0,1.7fr) minmax(300px,.85fr);
  align-items:start;gap:clamp(18px,2.5vw,30px);
}
body.azch-commerce-cart .wc-block-components-main,
body.azch-commerce-cart .wc-block-cart__main,
body.azch-commerce-cart .wc-block-components-sidebar,
body.azch-commerce-cart .wc-block-cart__sidebar {width:100%!important;max-width:100%!important;float:none!important;padding:0!important;}
body.azch-commerce-cart .wc-block-cart__main,
body.azch-commerce-cart .wc-block-components-main {grid-column:1;}
body.azch-commerce-cart .wc-block-cart__sidebar,
body.azch-commerce-cart .wc-block-components-sidebar {grid-column:2;}
body.azch-commerce-cart .wc-block-cart-items,
body.azch-commerce-cart .wc-block-cart__totals-title,
body.azch-commerce-cart .wc-block-components-totals-wrapper {min-width:0;max-width:100%;}
body.azch-commerce-cart .wc-block-cart-items,
body.azch-commerce-cart .wc-block-components-sidebar {background:#fff;border:1px solid var(--azcc-border);border-radius:15px;padding:clamp(14px,2vw,24px)!important;box-shadow:0 7px 25px rgba(16,42,67,.035);}
body.azch-commerce-cart .wc-block-cart-items__row {min-width:0;}
body.azch-commerce-cart .wc-block-cart-items__row .wc-block-cart-item__product {min-width:0;overflow-wrap:anywhere;}
body.azch-commerce-cart .wc-block-components-product-name {color:var(--azcc-navy);font-weight:750;overflow-wrap:anywhere;}
body.azch-commerce-cart .wc-block-components-button.wc-block-cart__submit-button {border-radius:10px;background:var(--azcc-teal);color:#fff;min-height:50px;font-weight:750;}
body.azch-commerce-cart .wc-block-components-button.wc-block-cart__submit-button:hover {background:#087e74;}
/* CART: preserve warnings, cart validation and coupon totals. */
body.azch-commerce-cart .wc-block-components-notices,
body.azch-commerce-cart .wc-block-components-notice-banner {max-width:100%;}

/* CHECKOUT: classic [woocommerce_checkout] stays fully native. */
body.azch-commerce-checkout .wp-block-shortcode .woocommerce,
body.azch-commerce-checkout .woocommerce form.checkout {box-sizing:border-box;width:100%!important;max-width:100%!important;min-width:0;}
body.azch-commerce-checkout .wp-block-post-content {padding-top:clamp(20px,3vw,42px);padding-bottom:68px;}
body.azch-commerce-checkout .woocommerce {color:var(--azcc-navy);font-size:15px;line-height:1.55;}
body.azch-commerce-checkout .woocommerce :is(.woocommerce-notices-wrapper,.woocommerce-error,.woocommerce-info,.woocommerce-message) {max-width:100%;}
body.azch-commerce-checkout .woocommerce :is(h2,h3,#order_review_heading) {
  color:var(--azcc-navy);font-family:'Plus Jakarta Sans',Inter,system-ui,sans-serif;
  letter-spacing:-.025em;font-weight:800;
}
body.azch-commerce-checkout .woocommerce #customer_details,
body.azch-commerce-checkout .woocommerce #order_review {min-width:0;max-width:100%;}
body.azch-commerce-checkout .woocommerce #customer_details > .col-1,
body.azch-commerce-checkout .woocommerce #customer_details > .col-2 {
  width:100%!important;float:none!important;max-width:100%!important;min-width:0;
  background:#fff;border:1px solid var(--azcc-border);border-radius:15px;
  padding:clamp(18px,2.5vw,30px);margin:0 0 18px;
  box-shadow:0 7px 25px rgba(16,42,67,.035);
}
body.azch-commerce-checkout .woocommerce #order_review,
body.azch-commerce-checkout .woocommerce #order_review_heading {
  background:#fff;max-width:100%!important;width:100%!important;float:none!important;
  border-left:1px solid var(--azcc-border);border-right:1px solid var(--azcc-border);
}
body.azch-commerce-checkout .woocommerce #order_review_heading {
  border-top:1px solid var(--azcc-border);border-radius:15px 15px 0 0;
  padding:22px 24px 10px;margin:0;
}
body.azch-commerce-checkout .woocommerce #order_review {
  border-bottom:1px solid var(--azcc-border);border-radius:0 0 15px 15px;
  padding:0 clamp(18px,2vw,24px) 24px;
}
body.azch-commerce-checkout .woocommerce .form-row {min-width:0;}
body.azch-commerce-checkout .woocommerce .form-row :is(input.input-text,select,textarea),
body.azch-commerce-checkout .woocommerce .select2-container {box-sizing:border-box;min-height:43px;max-width:100%;width:100%;border-radius:8px;}
body.azch-commerce-checkout .woocommerce .form-row :is(input.input-text,select,textarea) {
  padding:10px 12px;border:1px solid #C8D9DE;background:#fff;color:var(--azcc-navy);
}
body.azch-commerce-checkout .woocommerce .form-row :is(input,select,textarea):focus {border-color:var(--azcc-teal);outline:2px solid #85D4C8;outline-offset:1px;}
body.azch-commerce-checkout .woocommerce #payment,
body.azch-commerce-checkout .woocommerce #payment .place-order {background:transparent;}
body.azch-commerce-checkout .woocommerce #place_order {width:100%;min-height:50px;background:var(--azcc-teal);color:#fff;border:0;border-radius:10px;font-weight:750;}
body.azch-commerce-checkout .woocommerce #place_order:hover {background:#087e74;}
body.azch-commerce-checkout .woocommerce table.shop_table {width:100%;max-width:100%;border-collapse:collapse;}
body.azch-commerce-checkout .woocommerce table.shop_table td,
body.azch-commerce-checkout .woocommerce table.shop_table th {overflow-wrap:anywhere;}

@media (min-width:960px) {
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout:has(> #customer_details):has(> #order_review) {
    display:grid!important;grid-template-columns:minmax(0,1.6fr) minmax(320px,.94fr);
    grid-template-rows:min-content min-content 1fr;align-items:start;gap:0 26px;
  }
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout > #customer_details {
    grid-column:1;grid-row:1/span 3;width:100%!important;float:none!important;
  }
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout > #order_review_heading {
    grid-column:2;grid-row:1;margin:0;
  }
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout > #order_review {
    grid-column:2;grid-row:2;
  }
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout > :not(#customer_details):not(#order_review_heading):not(#order_review) {grid-column:1/-1;}
}
@media (max-width:959px) {
  body.azch-commerce-cart .wc-block-components-sidebar-layout {
    grid-template-columns:minmax(0,1fr)!important;
  }
  body.azch-commerce-cart .wc-block-cart__main,
  body.azch-commerce-cart .wc-block-components-main,
  body.azch-commerce-cart .wc-block-cart__sidebar,
  body.azch-commerce-cart .wc-block-components-sidebar {grid-column:1;}
  body.azch-commerce-checkout .woocommerce form.checkout.woocommerce-checkout {display:block;}
}
@media (max-width:600px) {
  body.azch-commerce-cart .wp-block-post-content,
  body.azch-commerce-cart .entry-content,
  body.azch-commerce-checkout .wp-block-post-content,
  body.azch-commerce-checkout .entry-content {width:calc(100% - 24px)!important;max-width:100%!important;}
  body.azch-commerce-cart .wc-block-cart-items,
  body.azch-commerce-cart .wc-block-components-sidebar {padding:13px!important;}
  body.azch-commerce-checkout .woocommerce #order_review,
  body.azch-commerce-checkout .woocommerce #order_review_heading {padding-inline:15px;}
}
