/* ===========================================================================
   SchoolNotes v36 - bottom bars, compact cart bar, cart badges
   =========================================================================== */

/* ---------------------------------------------- every bottom bar, pinned ---
   These bars were drifting upward because a parent transform / margin pushed
   them off the viewport edge. Locking position+inset overrides whatever the
   theme CSS computes, so they always sit flat on the very bottom.            */
#cart-mini-bar,
#pv7-sticky,
.pv7-sticky-fixed,
.sticky-buy-bar,
.sn24-checkout-bar {
  position: fixed !important;
  left: 0 !important; right: 0 !important;
  bottom: 0 !important; top: auto !important;
  transform: none !important; margin: 0 !important;
}
.mobile-app-nav {
  position: fixed !important; left: 0; right: 0;
  bottom: 0 !important; top: auto !important; z-index: 12010;
}
@media (min-width: 901px) {
  /* checkout's bar is a centred card on desktop, so keep its centring */
  .sn24-checkout-bar { left: 50% !important; transform: translateX(-50%) !important; }
}

/* ---------------------------------------------------- compact "Cart" bar --- */
#cart-mini-bar {
  z-index: 12005 !important; display: none;
  align-items: center; gap: 12px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(120deg, #14335c, #1e4a82);
  color: #fff; border-top: 0;
  box-shadow: 0 -8px 24px rgba(20, 51, 92, .3);
}
#cart-mini-bar.is-visible { display: flex !important; }
#cart-mini-bar .cmb-info { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
#cart-mini-bar .cmb-label {
  display: block; font-size: .6rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; opacity: .74;
}
#cart-mini-bar .cmb-total { font-size: 1.04rem; font-weight: 900; color: #fff; }
#cart-mini-bar .cmb-items {
  font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .16); white-space: nowrap;
}
#cart-mini-bar .cmb-items.is-zero { display: none; }
#cart-mini-bar .cmb-cta {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: #E8A93A; color: #14335c !important; font-weight: 900;
  font-size: .82rem; padding: 8px 14px; border-radius: 10px; white-space: nowrap;
}
#cart-mini-bar .cmb-close {
  background: none; border: 0; color: #c7d3e6; font-size: .9rem;
  cursor: pointer; padding: 4px 2px;
}
/* the homepage keeps the app-nav, so the cart bar stacks just above it */
body.home-page #cart-mini-bar { bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important; }

/* leave room so a pinned bar never covers the footer / last product row */
body.has-sticky-bar, body.checkout-body { padding-bottom: 96px; }
.product-page { padding-bottom: 96px; }

/* ------------------------------------------------------------ cart badges --- */
.cart-link span, .mobile-cart span, .app-nav-badge {
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: .66rem; font-weight: 800;
  text-align: center; display: inline-block;
}
.cart-link span.is-zero,
.mobile-cart span.is-zero,
.app-nav-badge.is-zero { display: none !important; }
.cart-link { position: relative; }
.mobile-cart { position: relative; }
.mobile-cart span { position: absolute; top: -4px; right: -8px; margin: 0; }
.mobile-app-nav-cart { position: relative; }
.mobile-app-nav-cart .app-nav-badge { position: absolute; top: 5px; left: 50%; margin-left: 4px; }

@media (max-width: 900px) {
  #cart-mini-bar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  #cart-mini-bar .cmb-total { font-size: .98rem; }
}
