/* MEHFARO customer chat restoration: safe first-visit state only. */
body > #mehfaroOrderChatRoot .mf-order-chat-before-order {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: clamp(20px, 5vw, 48px);
  text-align: center;
  background: #f4f9f7;
  color: #163c33;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
}
body > #mehfaroOrderChatRoot .mf-order-chat-before-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: #176f60;
  color: #fff;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 900;
}
body > #mehfaroOrderChatRoot .mf-order-chat-before-order h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.2;
}
body > #mehfaroOrderChatRoot .mf-order-chat-before-order p {
  max-width: 440px;
  margin: 0;
  color: #526760;
  font-size: 14px;
  line-height: 1.6;
}
body > #mehfaroOrderChatRoot .mf-order-chat-before-order button {
  border: 0;
  border-radius: 12px;
  padding: 13px 22px;
  margin-top: 8px;
  color: #fff;
  background: #176f60;
  cursor: pointer;
  font-weight: 800;
}
body > #mehfaroOrderChatRoot .mf-order-chat-before-order button:hover {
  background: #11594d;
}

/* The old purchase flow hid ALL receipts even on network errors.
   Let the confirmed-order receipt remain available until Chat really loads. */
#orderSuccessModal.open {
  display: grid !important;
}


/* MEHFARO CHAT UI TUNE 2026-10-28
   Standalone chat only; no global portal, cart or checkout layout changes.
   Keep X clear of the viewport scrollbar at narrow browser widths.
*/
html body > #mehfaroOrderChatRoot .mf-order-chat-single-head {
  box-sizing: border-box !important;
  padding-right: max(32px, calc(24px + env(safe-area-inset-right))) !important;
}
html body > #mehfaroOrderChatRoot .mf-order-chat-single-head .mf-order-chat-close {
  position: relative !important;
  z-index: 2 !important;
  flex: 0 0 40px !important;
  margin-right: 0 !important;
}

/* The Added to Cart toast should sit ABOVE (not behind) the mobile nav.
   The five nav buttons and their placement are left untouched. */
@media (max-width: 780px) {
  html body #toast.toast {
    bottom: calc(78px + env(safe-area-inset-bottom)) !important;
    z-index: 9001 !important;
    box-sizing: border-box !important;
    width: max-content !important;
    max-width: calc(100vw - 32px) !important;
    min-width: 0 !important;
    padding: 11px 16px !important;
    border-radius: 16px !important;
    text-align: center !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.4 !important;
    font-size: 12px !important;
  }
}
