/* Mobile confirmation from the existing blockcart success callback. */
#mobile-cart-notice {
  display: none;
}

#mobile-cart-notice-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 767px) {
  #mobile-cart-notice {
    display: block;
    position: fixed;
    /* The fixed mobile B2B badge uses z-index: 9999. */
    z-index: 10010;
    left: 50%;
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 460px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    box-sizing: border-box;
    padding: 18px 14px 12px;
    border: 1px solid #dedede;
    border-top: 3px solid #4aacab;
    border-radius: 12px;
    background: #fff;
    color: #222;
    box-shadow: 0 6px 32px rgba(0, 0, 0, .24);
    animation: mobile-cart-notice-in .18s ease-out;
  }

  #mobile-cart-notice[hidden] {
    display: none;
  }

  #mobile-cart-notice .mobile-cart-notice-close {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #555;
    font-size: 28px;
    line-height: 36px;
    cursor: pointer;
  }

  #mobile-cart-notice .mobile-cart-notice-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-right: 22px;
  }

  #mobile-cart-notice .mobile-cart-notice-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    height: 30px;
    border-radius: 50%;
    background: #eaf6f5;
    color: #277f7e;
    font-size: 20px;
    font-weight: 700;
  }

  #mobile-cart-notice .mobile-cart-notice-text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #mobile-cart-notice-title {
    display: block;
    font-size: 16px;
    line-height: 22px;
  }

  #mobile-cart-notice .mobile-cart-notice-product {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 18px;
    color: #555;
  }

  #mobile-cart-notice .mobile-cart-notice-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
  }

  #mobile-cart-notice .mobile-cart-notice-cart,
  #mobile-cart-notice .mobile-cart-notice-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 42px;
    padding: 10px 8px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }

  #mobile-cart-notice .mobile-cart-notice-cart {
    background: #3a3a3a;
    color: #fff;
  }

  #mobile-cart-notice .mobile-cart-notice-continue {
    background: #f2f2f2;
    color: #333;
  }

  #mobile-cart-notice a:focus-visible,
  #mobile-cart-notice button:focus-visible {
    outline: 2px solid #277f7e;
    outline-offset: 2px;
  }

}

@keyframes mobile-cart-notice-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #mobile-cart-notice { animation: none; }
}
