/* peptidea-checkout-mobile-fix v1.0.0 (DRAFT, not deployed)
   1) Mini-cart drawer: make the whole gray button the link, 48px+ tall, full-width grid,
      lifted off the bottom edge, and hide the PWA bell while the drawer is open.
   2) Cart totals > Shipment: stop the floated "Shipment" label from squeezing the first
      shipping method into a 0px column (which pushed it off-screen to the right). */

@media (max-width: 849px) {
  /* --- Bug 1: mini-cart buttons (Elementor Pro mini-cart template inside Flatsome off-canvas) --- */
  .off-canvas-cart .elementor-menu-cart__footer-buttons,
  #cart-popup .elementor-menu-cart__footer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .off-canvas-cart .elementor-menu-cart__footer-buttons .elementor-button,
  #cart-popup .elementor-menu-cart__footer-buttons .elementor-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    margin: 0;
    padding: 12px 8px;
    text-align: center;
    position: relative;
    z-index: 2;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, .12);
  }
  /* the inner text span must never be the tap target */
  .off-canvas-cart .elementor-menu-cart__footer-buttons .elementor-button *,
  #cart-popup .elementor-menu-cart__footer-buttons .elementor-button * {
    pointer-events: none;
  }
  /* peptidea-push bell (z-index 99980) sits over the drawer's bottom-left corner; hide it while any off-canvas is open */
  html.has-off-canvas #pp-push-bell {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  /* --- Bug 2: Cart totals > Shipment (Elementor Pro Cart widget + Flatsome cart-shipping.php) --- */
  .elementor-widget-woocommerce-cart .woocommerce .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals td.shipping__inner::before {
    content: none;
    display: none;
  }
  .elementor-widget-woocommerce-cart .woocommerce .cart_totals table.shop_table_responsive tr.woocommerce-shipping-totals td::before {
    float: none;
    display: block;
    width: auto;
  }
  .elementor-widget-woocommerce-cart .cart_totals tr.woocommerce-shipping-totals td,
  .elementor-widget-woocommerce-cart .cart_totals .shipping__table {
    max-width: 100%;
  }
  .elementor-widget-woocommerce-cart #shipping_method {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .elementor-widget-woocommerce-cart #shipping_method li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: start;
  }
  .elementor-widget-woocommerce-cart #shipping_method li input {
    flex: 0 0 auto;
    margin: 0;
  }
  .elementor-widget-woocommerce-cart #shipping_method li label {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
