/* Back-to-top — UI/UX specs (Order UI 1.0.6) */
#ast-scroll-top,
.ast-scroll-to-top-right,
#page #ast-scroll-top,
a#ast-scroll-top {
  left: auto !important;
  right: max(16px, env(safe-area-inset-right, 0px)) !important;
  bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  line-height: 44px !important;
  font-size: 22px !important;
  border-radius: 10px !important;
  z-index: 90 !important; /* above content, below cart sheet/modals (200+) */
  box-shadow: 0 4px 14px rgba(0,0,0,.18) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

#ast-scroll-top .ast-icon,
#ast-scroll-top svg,
#ast-scroll-top .ahfb-svg-iconset {
  width: 22px !important;
  height: 22px !important;
  font-size: 22px !important;
}

/* Order page: clear floating cart bar (~56–64px) */
body.page #ast-scroll-top.mg-clear-cart,
body.woocommerce #ast-scroll-top.mg-clear-cart,
.mg-fab-visible #ast-scroll-top,
body.mg-cart-bar-on #ast-scroll-top {
  bottom: calc(64px + 12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Checkout: hide BTT — overlaps pickup card on mobile */
body.woocommerce-checkout #ast-scroll-top,
body.woocommerce-checkout a#ast-scroll-top {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Hide / tuck when cart sheet open */
body.mg-cart-open #ast-scroll-top,
body.mg-cart-open a#ast-scroll-top {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Sitewide floating cart bar (only when ≥1 item; never on checkout) */
.mg-global-cart-bar{
  position:fixed;left:50%;bottom:max(16px, env(safe-area-inset-bottom, 0px));
  transform:translateX(-50%);
  z-index:120;display:none;align-items:center;justify-content:space-between;gap:14px;
  width:min(520px, calc(100% - 24px));
  background:#1c1917;color:#fff;border:0;border-radius:14px;padding:12px 14px 12px 16px;
  box-shadow:0 12px 32px rgba(0,0,0,.28);font-weight:700;cursor:pointer;
  font-family:"Source Sans Pro","Albert Sans",ui-sans-serif,system-ui,sans-serif;
}
.mg-global-cart-bar.show{display:flex}
.mg-global-cart-bar .mg-gcb-left{display:flex;align-items:center;gap:10px}
.mg-global-cart-bar .mg-gcb-count{
  display:inline-flex;min-width:24px;height:24px;align-items:center;justify-content:center;
  border-radius:8px;background:#c2410c;font-size:.8rem;padding:0 6px;color:#fff;
}
.mg-global-cart-bar .mg-gcb-sub{font-weight:650;font-size:.95rem;color:#fff}
.mg-global-cart-bar .mg-gcb-cta{
  background:#dd183b;color:#fff;border-radius:10px;padding:8px 14px;font-size:.82rem;font-weight:800;
  pointer-events:none;
}
body.woocommerce-checkout .mg-global-cart-bar,
body.woocommerce-order-received .mg-global-cart-bar{display:none!important}

/* #11 mobile footer heading scale */
@media (max-width:782px){
  .site-footer h2,
  .site-footer .widget-title,
  footer h2,
  .footer-widget-area h2,
  .ast-footer-widget-area h2,
  .site-footer .wp-block-heading {
    font-size: clamp(1.15rem, 4.6vw, 1.45rem) !important;
    line-height: 1.25 !important;
    letter-spacing: -0.01em;
  }
}

/* Sitewide: keep last content clear of float cart bar */
body.mg-cart-bar-on #content,
body.mg-cart-bar-on .site-content,
body.mg-cart-bar-on .ast-container {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* 1.1.11: Astra header clone must not add layout height */
#ast-fixed-header {
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
/* Order page: hide the clone entirely so it cannot pin over the chips */
body.mg-order-page #ast-fixed-header {
  display: none !important;
  visibility: hidden !important;
}
@media (min-width: 922px) {
  #masthead {
    max-height: 72px !important;
    height: auto !important;
    overflow: hidden !important;
  }
  /* Above row has logo+nav; primary often empty spacer — kill spacer row */
  #masthead .ast-main-header-wrap,
  #masthead .ast-primary-header-bar,
  #masthead .site-primary-header-wrap {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
  }
  #masthead .ast-below-header,
  #masthead .ast-below-header-bar,
  #masthead .ast-below-header-wrap {
    display: none !important;
  }
  #masthead .ast-above-header,
  #masthead .ast-above-header-wrap,
  #masthead .ast-above-header-bar {
    display: block !important;
    min-height: 0 !important;
    max-height: 72px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
  #masthead .ast-above-header-bar .ast-builder-grid-row {
    min-height: 0 !important;
    align-items: center !important;
  }
  #masthead .custom-logo,
  #masthead .custom-logo-link img,
  #masthead .site-logo-img img {
    max-height: 44px !important;
    height: auto !important;
    width: auto !important;
  }
  #masthead .ast-builder-menu .main-header-menu > .menu-item > .menu-link {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    line-height: 1.2 !important;
  }
  #masthead .ast-header-button-1 .ast-custom-button,
  #masthead .ast-button {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    line-height: 1.2 !important;
  }
}

/* Order page: Astra content wrappers must not clip the pinned category chips */
body.mg-order-page #page,
body.mg-order-page #content,
body.mg-order-page #primary,
body.mg-order-page .site-content,
body.mg-order-page .ast-container,
body.mg-order-page .entry-content,
body.mg-order-page .ast-article-single {
  overflow: visible !important;
}
