/* =========================================================
   Tick Away v1.6.5 mobile cart bottom fix
   The mobile cart bar must stay at the bottom, outside the fixed header.
   ========================================================= */

@media (max-width: 760px) {
  /* Keep the fixed header from becoming the containing block for fixed children. */
  body .site-header,
  body.single-product .site-header,
  body.woocommerce-page .site-header {
    transform: none !important;
    will-change: auto !important;
    contain: none !important;
  }

  /* Hide the mobile cart completely when empty. */
  body .ta-mobile-cart-top:not(.has-items) {
    display: none !important;
  }

  /* Force the mobile cart to the bottom of the viewport. */
  body .ta-mobile-cart-top.has-items {
    display: block !important;
    position: fixed !important;
    top: auto !important;
    right: 10px !important;
    bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    z-index: 10090 !important;
    pointer-events: none !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mobile-cart-button {
    pointer-events: auto !important;
    width: 100% !important;
    min-height: 62px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    background: rgba(242, 250, 245, .98) !important;
    border: 1px solid #cfe8d8 !important;
    border-radius: 18px !important;
    box-shadow: 0 -10px 32px rgba(6, 43, 73, .14) !important;
    color: #062b49 !important;
    text-align: left !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mobile-cart-icon {
    width: 42px !important;
    height: 42px !important;
    display: grid !important;
    place-items: center !important;
    background: #ffffff !important;
    border-radius: 999px !important;
    color: #062b49 !important;
    font-size: 21px !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mobile-cart-text strong {
    display: block !important;
    color: #062b49 !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mobile-cart-text small {
    display: block !important;
    color: #334e63 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mobile-cart-total {
    color: #008c45 !important;
    font-size: 17px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
  }

  /* Mini cart panel opens upward from the bottom bar. */
  body .ta-mobile-cart-top.has-items .ta-mini-cart-panel,
  body .ta-mobile-cart-top.has-items .ta-mobile-mini-cart-panel {
    position: fixed !important;
    top: auto !important;
    right: 10px !important;
    bottom: calc(86px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    z-index: 10100 !important;
    pointer-events: auto !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mini-cart-panel[hidden],
  body .ta-mobile-cart-top.has-items .ta-mobile-mini-cart-panel[hidden] {
    display: none !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mini-cart-panel-inner {
    max-height: calc(100dvh - 150px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    border: 1px solid #e3edf2 !important;
    box-shadow: 0 22px 60px rgba(6, 43, 73, .24) !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mini-cart-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: none !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mini-cart-actions {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 14px !important;
    background: #f8fafb !important;
    border-top: 1px solid #e3edf2 !important;
  }

  body .ta-mobile-cart-top.has-items .ta-mini-cart-link,
  body .ta-mobile-cart-top.has-items .ta-mini-cart-checkout {
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
    text-align: center !important;
  }

  /* Reserve space so the bottom bar does not cover page content. */
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
  }
}

@media (min-width: 761px) {
  .ta-mobile-cart-top {
    display: none !important;
  }
}

/* v1.6.6: never show the mobile sticky cart on cart and checkout pages. */
@media (max-width: 760px) {
  body.woocommerce-cart .ta-mobile-cart-top,
  body.woocommerce-checkout .ta-mobile-cart-top {
    display: none !important;
  }

  body.woocommerce-cart,
  body.woocommerce-checkout {
    padding-bottom: 0 !important;
  }
}
