/**
 * Cart document layout ONLY. The actual rows, quantity control, shipping ring,
 * subtotal and checkout button are the same DOM nodes, JS controller and
 * overlay.css rules used by the live Codela popup. No separate cart skin.
 *
 * Native Woo post-content stays in the document until the Store API succeeds,
 * and remains the functional fallback when scripts or network calls fail.
 */
body.woocommerce-cart { background:var(--sf-ui-page);color:var(--sf-ui-ink) }
body.woocommerce-cart .sf-cart-page {
  width:100%;max-width:none!important;min-height:55vh;
  box-sizing:border-box;margin:0 auto!important;
  padding:16px 20px calc(94px + env(safe-area-inset-bottom,0px));
}
body.woocommerce-cart .sf-cart-page > .wp-block-post-title { display:none }
body.woocommerce-cart .sf-cart-page > .wp-block-post-content,
body.woocommerce-cart .sf-cart-page > .sf-cart-page-panel {
  max-width:900px!important;width:100%;margin-inline:auto;
}
body.woocommerce-cart .sf-cart-page-native[hidden] {display:none!important}
body.woocommerce-cart .sf-cart-page-panel {
  --sf-overlay-gutter:0px;
  --sf-state-mark-size:52px;
  --sf-state-glyph-size:23px;
  --sf-state-mark-gap:12px;
  --sf-state-heading-size:19px;
  --sf-state-heading-weight:500;
  --sf-state-heading-tracking:-.02em;
  --sf-state-heading-leading:1.3;
  --sf-state-copy-size:13px;
  --sf-state-copy-leading:1.5;
  --sf-state-copy-gap:7px;
  display:flex;flex-direction:column;min-width:0;
  min-height:calc(100svh - 240px);
  width:min(900px,100%);margin:0 auto;
  color:var(--sf-ui-ink);background:var(--sf-ui-page);
}
body.woocommerce-cart .sf-cart-page-panel #sf-cart {
  flex:1;min-height:0;overflow:visible;box-sizing:border-box;
}
body.woocommerce-cart .sf-cart-page-panel #sf-cart-items,
body.woocommerce-cart .sf-cart-page-panel .sf-cart-count {
  max-width:780px;margin-inline:auto;
}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-count {
  margin-bottom:12px;
}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-bottom {
  box-sizing:border-box;
  position:static;z-index:10;width:100%;margin-top:auto;
  background:var(--sf-ui-page);
  padding:18px 0 12px!important;
  border-top:1px solid color-mix(in srgb,var(--sf-ui-border) 55%,transparent);
}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-bottom[hidden] {display:none!important}
body.woocommerce-cart .sf-cart-page-panel #sf-cart-progress {
  max-width:780px;margin-inline:auto;
}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-checkout-command {
  max-width:780px;
}
body.woocommerce-cart .sf-cart-page-panel .sf-status {padding:4px 0;margin:0;min-height:0}
body.woocommerce-cart .sf-cart-page-panel .sf-status:empty {display:none}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-empty {min-height:35vh}
body.woocommerce-cart .sf-cart-page-panel .sf-cart-row {box-sizing:border-box}
/* The page and popup already use the same quantity markup. Prevent generic
 * native Woo button styles from making the page's capsule look like 3 squares.
 * These are surface fixes only; quantity logic remains the shared controller. */
body.woocommerce-cart .sf-cart-page-panel .sf-stepper.sf-ui-surface {
  border-radius:var(--sf-ui-pill)!important;
  background:var(--sf-ui-glass-surface)!important;
  box-shadow:var(--sf-ui-glass-thumb-shadow)!important;
  overflow:visible!important;
}
body.woocommerce-cart .sf-cart-page-panel .sf-stepper.sf-ui-surface > button {
  background:transparent!important;
  border:0!important;box-shadow:none!important;
  border-radius:var(--sf-ui-pill)!important;
}
@media (max-width:900px){
  /* Sticky only sticks once its block reaches the viewport edge and thus
   * parked our CTA midway down short carts. This bar is viewport-fixed. */
  body.woocommerce-cart .sf-cart-page-panel .sf-cart-bottom {
    position:fixed;
    left:0;right:0;width:100%;max-width:none;
    bottom:calc(12px + env(safe-area-inset-bottom,0px));
    margin:0;
    padding:12px 20px 10px!important;
    z-index:990;
    background:var(--sf-ui-page);
  }
  body.woocommerce-cart:has(.sf-mobile-dock:not([hidden])) .sf-cart-page-panel .sf-cart-bottom {
    bottom:calc(var(--sf-ui-bottom-bar-height,58px) + var(--sf-ui-bottom-bar-gap,4px) + 8px + env(safe-area-inset-bottom,0px));
  }
  /* Keep the last product fully scrollable above the fixed purchase surface. */
  body.woocommerce-cart .sf-cart-page-panel #sf-cart {
    padding-bottom:230px;
  }
}
@media (max-width:700px){
  body.woocommerce-cart .sf-cart-page {
    padding:10px 20px calc(105px + env(safe-area-inset-bottom,0px));
  }
  body.woocommerce-cart .sf-cart-page-panel {min-height:calc(100svh - 220px)}
  body.woocommerce-cart .sf-cart-page-panel .sf-cart-count {margin-bottom:8px}
}
@media (min-width:901px){
  body.woocommerce-cart .sf-cart-page-panel {
    min-height:60vh;
    width:min(780px,100%);
  }
  body.woocommerce-cart .sf-cart-page-panel .sf-cart-bottom {
    position:static;bottom:auto;margin-top:auto;
  }
}
