/* v5.3.2 — scoped cart/checkout spacing repair. Keep site-wide header untouched. */
body.woocommerce-cart, body.woocommerce-checkout { --rch-commerce-header-clearance: 168px; }
/* Neve and common block themes: remove inherited vertical centering / hero spacing. */
body.woocommerce-cart main, body.woocommerce-cart main#content, body.woocommerce-cart .site-main, body.woocommerce-cart .neve-main,
body.woocommerce-checkout main, body.woocommerce-checkout main#content, body.woocommerce-checkout .site-main, body.woocommerce-checkout .neve-main {
  display:block!important; min-height:0!important; height:auto!important;
  align-content:start!important; align-items:stretch!important; justify-content:flex-start!important;
  padding-top:0!important; margin-top:0!important;
}
body.woocommerce-cart .nv-single-page-wrap,body.woocommerce-checkout .nv-single-page-wrap,
body.woocommerce-cart .nv-content-wrap,body.woocommerce-checkout .nv-content-wrap,
body.woocommerce-cart .entry-content,body.woocommerce-checkout .entry-content,
body.woocommerce-cart .wp-block-post-content,body.woocommerce-checkout .wp-block-post-content {
  min-height:0!important; height:auto!important; align-content:start!important;
  justify-content:flex-start!important;
}
body.woocommerce-cart .wp-block-woocommerce-cart,body.woocommerce-cart .wc-block-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout,body.woocommerce-checkout .wc-block-checkout {
  position:relative!important; top:auto!important; transform:none!important;
  min-height:0!important; height:auto!important;
  margin-top:0!important; padding-top:0!important;
}
/* Reserve a header-safe top area for both views without changing header itself. */
body.woocommerce-cart #content.neve-main,body.woocommerce-checkout #content.neve-main,
body.woocommerce-cart .site-main,body.woocommerce-checkout .site-main,
body.woocommerce-cart main#main,body.woocommerce-checkout main#main {
  padding-top:var(--rch-commerce-header-clearance)!important;
}
/* Single final content position: no page-level double margins. */
body.woocommerce-cart .wc-block-cart,body.woocommerce-checkout .wc-block-checkout {
  margin-bottom:42px!important;
}
body.woocommerce-cart .wc-block-components-sidebar-layout,
body.woocommerce-checkout .wc-block-components-sidebar-layout {align-items:flex-start!important; align-content:start!important;}
body.woocommerce-cart .wc-block-components-main,body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-main,body.woocommerce-checkout .wc-block-components-sidebar {
  margin-top:0!important; align-self:flex-start!important;
}
@media(max-width:782px){
  body.woocommerce-cart,body.woocommerce-checkout{--rch-commerce-header-clearance:126px;}
}
@media(max-width:600px){
  body.woocommerce-cart,body.woocommerce-checkout{--rch-commerce-header-clearance:114px;}
  body.woocommerce-cart .wc-block-cart,body.woocommerce-checkout .wc-block-checkout{margin-bottom:24px!important;}
}
/* Theme selectors can differ: fall back to normal document flow when Neve wrapper is absent. */
body.woocommerce-cart:not(:has(#content.neve-main)) .wp-block-post-content,
body.woocommerce-checkout:not(:has(#content.neve-main)) .wp-block-post-content {
  padding-top:var(--rch-commerce-header-clearance)!important;
}

/* v5.3.3: cart-only compact clearance; checkout retains its independent clearance. */
body.woocommerce-cart { --rch-commerce-header-clearance: 105px; }
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-cart .wc-block-cart { margin-top:0!important; }
@media(max-width:782px){ body.woocommerce-cart { --rch-commerce-header-clearance: 90px; } }
@media(max-width:600px){ body.woocommerce-cart { --rch-commerce-header-clearance: 80px; } }


/* v5.3.4 — tighter mobile spacing for cart and checkout. */
body.woocommerce-cart main,
body.woocommerce-cart .site-main,
body.woocommerce-cart #content.neve-main,
body.woocommerce-checkout main,
body.woocommerce-checkout .site-main,
body.woocommerce-checkout #content.neve-main{margin-top:14px!important}
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-cart .wc-block-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
body.woocommerce-checkout .wc-block-checkout{margin-top:0!important}
body.woocommerce-cart .wc-block-components-sidebar-layout,
body.woocommerce-checkout .wc-block-components-sidebar-layout{padding-top:0!important;margin-top:0!important}
body.woocommerce-cart .wc-block-components-main,
body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-main,
body.woocommerce-checkout .wc-block-components-sidebar{padding-top:0!important}

@media(max-width:782px){
  body.woocommerce-cart{--rch-commerce-header-clearance:72px}
  body.woocommerce-checkout{--rch-commerce-header-clearance:88px}
  body.woocommerce-cart main,
  body.woocommerce-cart .site-main,
  body.woocommerce-cart #content.neve-main,
  body.woocommerce-checkout main,
  body.woocommerce-checkout .site-main,
  body.woocommerce-checkout #content.neve-main{margin-top:10px!important;margin-bottom:32px!important}
}
@media(max-width:600px){
  body.woocommerce-cart{--rch-commerce-header-clearance:56px}
  body.woocommerce-checkout{--rch-commerce-header-clearance:72px}
  body.woocommerce-cart main,
  body.woocommerce-cart .site-main,
  body.woocommerce-cart #content.neve-main,
  body.woocommerce-checkout main,
  body.woocommerce-checkout .site-main,
  body.woocommerce-checkout #content.neve-main{width:min(100%,calc(100% - 14px))!important;margin:8px auto 24px!important}
  body.woocommerce-cart .wc-block-cart,
  body.woocommerce-checkout .wc-block-checkout{margin-bottom:18px!important}
}

/* v5.3.6: remove duplicate mobile clearance on nested checkout wrappers */
@media(max-width:600px){
 body.woocommerce-checkout .nv-content-wrap,body.woocommerce-checkout .entry-content,body.woocommerce-checkout .wp-block-post-content{padding-top:0!important;margin-top:0!important}
 body.woocommerce-checkout:not(:has(#content.neve-main)) .wp-block-post-content{padding-top:0!important}
 body.woocommerce-checkout{--rch-commerce-header-clearance:56px}
}
