/* PIYAMO v2.0.5 — mobile persistent "View Treasure" dock.
   Visible throughout scrolling, including the mobile footer on every public page.
   Only the established text-entry/keyboard safeguard may pause it. */
@media (max-width: 767px) {
  /* Undo v2.0.4 footer IntersectionObserver styling even with an older cache. */
  body:not(.piyamo-mobile-typing):not(.piyamo-keyboard-open) .piyamo-mobile-cart-dock,
  body.piyamo-footer-in-view:not(.piyamo-mobile-typing):not(.piyamo-keyboard-open) .piyamo-mobile-cart-dock,
  body.woocommerce-cart:not(.piyamo-mobile-typing) .piyamo-mobile-cart-dock,
  body.woocommerce-checkout:not(.piyamo-mobile-typing):not(.piyamo-keyboard-open) .piyamo-mobile-cart-dock {
    display: block !important;
    position: fixed !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    right: 10px !important;
    left: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
    z-index: 980 !important;
  }
  /* Add *only* the necessary scroll clearance after the footer copyright.
     The cart remains fixed but the footer's last tappable link can rise
     fully above it, even on 320px Android WebViews. */
  body footer.piyamo-mobile-footer,
  body.piyamo-mobile-store-chrome footer.piyamo-mobile-footer,
  body.piyamo-mobile-shop-ui-active footer.piyamo-mobile-footer,
  body.single-product footer.piyamo-mobile-footer,
  body.woocommerce-account footer.piyamo-mobile-footer,
  body.woocommerce-shop footer.piyamo-mobile-footer {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    margin-bottom: 0 !important;
  }
  body footer.piyamo-mobile-footer .piyamo-mobile-footer-bottom,
  body.piyamo-mobile-store-chrome footer.piyamo-mobile-footer .piyamo-mobile-footer-bottom {
    padding: 12px 14px 13px !important;
    margin: 0 !important;
    min-height: 0 !important;
  }
  /* Cart, checkout, product, shop, and account share the same bottom dock.
     Lift back-to-top above it to prevent two overlapping tap targets. */
  body .piyamo-global-scroll-top,
  body.woocommerce-cart .piyamo-global-scroll-top,
  body.woocommerce-checkout .piyamo-global-scroll-top,
  body.single-product .piyamo-scroll-top,
  body.single-product .piyamo-global-scroll-top {
    bottom: calc(91px + env(safe-area-inset-bottom)) !important;
  }
  /* Make the bar readable and tappable without horizontal overflow. */
  .piyamo-mobile-cart-dock { box-sizing: border-box !important; }
  .piyamo-mobile-cart-dock-inner { min-width: 0 !important; }
  .piyamo-mobile-cart-copy { min-width: 0 !important; }
  .piyamo-mobile-cart-button { white-space: nowrap !important; }
}
