/* v2.0.98.409 — Cart + Checkout document shell.
 * Mirrors the Order Received / Quote Received presentation without changing
 * WooCommerce structure, fields, totals, payment logic or responsive flow. */

body.woocommerce-cart,
body.woocommerce-checkout:not(.woocommerce-order-received) {
  --clx-commerce-doc-font: 'Figtree', Arial, Helvetica, sans-serif;
  --clx-commerce-doc-canvas: #eeedf3;
  --clx-commerce-doc-text: #223a50;
  --clx-commerce-doc-muted: #506576;
  --clx-commerce-doc-border: #d8e1e9;
  --clx-commerce-doc-shadow-left: -20px 18px 28px rgba(18,22,30,.30);
  --clx-commerce-doc-shadow-right: 19px 18px 29px rgba(18,22,30,.21);
}

body.woocommerce-cart main.clx-page,
body.woocommerce-checkout:not(.woocommerce-order-received) main.clx-page {
  position: relative;
  isolation: isolate;
  min-height: 66vh;
  padding-bottom: 44px;
  background: var(--clx-commerce-doc-canvas) !important;
}

body.woocommerce-cart .clx-page-content,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content,
body.woocommerce-cart .clx-page-content--direct-commerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce {
  box-sizing: border-box;
  width: min(1120px, calc(100% - 40px)) !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* The main WooCommerce area becomes the same white document panel used on
 * Order Received, with the same pronounced left/right soft edge shadows. */
body.woocommerce-cart .clx-page-content > .woocommerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content > .woocommerce,
body.woocommerce-cart .clx-page-content--direct-commerce > .woocommerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce > .woocommerce {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-height: 520px;
  margin: 0 auto !important;
  padding: 34px 38px 42px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: var(--clx-commerce-doc-shadow-left), var(--clx-commerce-doc-shadow-right) !important;
  color: var(--clx-commerce-doc-text);
  font-family: var(--clx-commerce-doc-font) !important;
}

body.woocommerce-cart .woocommerce :is(
  h1,h2,h3,h4,h5,h6,p,a,span,strong,b,em,small,label,legend,
  button,input,select,option,textarea,li,dt,dd,th,td,caption,blockquote
),
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce :is(
  h1,h2,h3,h4,h5,h6,p,a,span,strong,b,em,small,label,legend,
  button,input,select,option,textarea,li,dt,dd,th,td,caption,blockquote
) {
  font-family: var(--clx-commerce-doc-font) !important;
}

/* Preserve dedicated icon/glyph fonts. */
body.woocommerce-cart .woocommerce :is(.dashicons,.dashicons-before,.fa,.fas,.far,.fab,.eicon,.elementor-icon,.star-rating,.star-rating *,.stars,.stars *),
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce :is(.dashicons,.dashicons-before,.fa,.fas,.far,.fab,.eicon,.elementor-icon,.star-rating,.star-rating *,.stars,.stars *) {
  font-family: revert !important;
}

/* Elevate the functional blocks while keeping the restrained receipt style. */
body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout #customer_details,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce-checkout-review-order,
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart_totals {
  border: 1px solid var(--clx-commerce-doc-border) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 9px 24px rgba(18,22,30,.065) !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout #customer_details {
  padding: 26px !important;
  margin-bottom: 28px !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce-checkout-review-order {
  padding: 24px !important;
}

body.woocommerce-cart .woocommerce-cart-form {
  padding: 18px !important;
  margin-bottom: 28px !important;
  overflow: hidden;
}

body.woocommerce-cart .cart_totals {
  padding: 24px !important;
}

body.woocommerce-cart .woocommerce h1,
body.woocommerce-cart .woocommerce h2,
body.woocommerce-cart .woocommerce h3,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce h1,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce h2,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce h3 {
  color: var(--clx-commerce-doc-text) !important;
  font-weight: 600 !important;
  letter-spacing: -.015em;
}

body.woocommerce-cart .woocommerce p,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce p,
body.woocommerce-cart .woocommerce label,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce label {
  color: var(--clx-commerce-doc-muted);
}

body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row label {
  color: #223a50 !important;
  font-weight: 650 !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row input.input-text,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row textarea,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row select,
body.woocommerce-checkout:not(.woocommerce-order-received) .select2-container .select2-selection {
  border-color: #d8e1e9 !important;
  background: #fbfcfd !important;
  box-shadow: inset 0 1px 2px rgba(18,22,30,.025) !important;
}

body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row input.input-text:focus,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row textarea:focus,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce form .form-row select:focus,
body.woocommerce-checkout:not(.woocommerce-order-received) .select2-container--focus .select2-selection {
  border-color: #8fa6ba !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(41,67,92,.08) !important;
  outline: none !important;
}

/* Notices sit inside the document rather than looking detached from it. */
body.woocommerce-cart .woocommerce-notices-wrapper,
body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce-notices-wrapper {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  body.woocommerce-cart .clx-page-content,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content,
  body.woocommerce-cart .clx-page-content--direct-commerce,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce {
    width: calc(100% - 20px) !important;
    margin: 12px auto 0 !important;
  }

  body.woocommerce-cart .clx-page-content > .woocommerce,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content > .woocommerce,
  body.woocommerce-cart .clx-page-content--direct-commerce > .woocommerce,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce > .woocommerce {
    min-height: 0;
    padding: 22px 18px 28px !important;
    box-shadow: -9px 12px 18px rgba(18,22,30,.19),
                 9px 12px 18px rgba(18,22,30,.15) !important;
  }

  body.woocommerce-checkout:not(.woocommerce-order-received) form.checkout #customer_details,
  body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce-checkout-review-order,
  body.woocommerce-cart .woocommerce-cart-form,
  body.woocommerce-cart .cart_totals {
    padding: 16px !important;
    border-radius: 10px !important;
  }
}

/* v2.0.98.410 — Mobile overflow + floating control protection.
 * Keep the commerce shell visually identical while preventing the shell from
 * widening the mobile layout viewport and pushing fixed WhatsApp/chat controls
 * partially off-screen. This remains scoped to Cart/Checkout only. */
body.woocommerce-cart,
body.woocommerce-checkout:not(.woocommerce-order-received) {
  max-width: 100%;
}

/* Keep overflow management on the commerce page itself, never on <body>.
 * A body-level clip can cut off viewport-fixed floating controls on mobile. */
body.woocommerce-cart main.clx-page,
body.woocommerce-checkout:not(.woocommerce-order-received) main.clx-page {
  overflow-x: clip;
}

body.woocommerce-cart main.clx-page,
body.woocommerce-checkout:not(.woocommerce-order-received) main.clx-page,
body.woocommerce-cart .clx-page-content,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content,
body.woocommerce-cart .clx-page-content--direct-commerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce,
body.woocommerce-cart .clx-page-content > .woocommerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content > .woocommerce,
body.woocommerce-cart .clx-page-content--direct-commerce > .woocommerce,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce > .woocommerce {
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Never let the document shell capture or obscure fixed site controls. */
body.woocommerce-cart .clx-floating,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-floating {
  position: fixed !important;
  z-index: 999999 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.woocommerce-cart .clx-floating--side-right,
body.woocommerce-cart .clx-floating--whatsapp:not(.clx-floating--side-left),
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-floating--side-right,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-floating--whatsapp:not(.clx-floating--side-left) {
  right: max(12px, env(safe-area-inset-right)) !important;
  left: auto !important;
}

body.woocommerce-cart .clx-floating--side-left,
body.woocommerce-checkout:not(.woocommerce-order-received) .clx-floating--side-left {
  left: max(12px, env(safe-area-inset-left)) !important;
  right: auto !important;
}

@media (max-width: 760px) {
  body.woocommerce-cart .clx-page-content,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content,
  body.woocommerce-cart .clx-page-content--direct-commerce,
  body.woocommerce-checkout:not(.woocommerce-order-received) .clx-page-content--direct-commerce {
    width: calc(100% - 28px) !important;
  }

  body.woocommerce-cart .woocommerce table.shop_table,
  body.woocommerce-checkout:not(.woocommerce-order-received) .woocommerce table.shop_table {
    max-width: 100% !important;
  }
}


/* v2.0.98.411 — dedicated commerce floating-control portal.
 * The JS moves WhatsApp into this viewport-fixed top layer on Cart/Checkout,
 * fully outside the document/card stacking and clipping contexts. */
#clx-commerce-floating-layer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 2147483646 !important;
  transform: none !important;
  filter: none !important;
  contain: none !important;
  isolation: isolate !important;
}
#clx-commerce-floating-layer > .clx-floating--whatsapp {
  position: fixed !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
}
@media (max-width: 767px) {
  #clx-commerce-floating-layer > .clx-floating--whatsapp:not(.clx-floating--side-left) {
    right: max(16px, env(safe-area-inset-right)) !important;
    left: auto !important;
  }
  #clx-commerce-floating-layer > .clx-floating--whatsapp.clx-floating--side-left {
    left: max(16px, env(safe-area-inset-left)) !important;
    right: auto !important;
  }
  #clx-commerce-floating-layer > .clx-floating--whatsapp {
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
  }
}
