/* WooCommerce retains the alert semantics and keyboard-accessible cart action. */
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  color: var(--ui-text); background: var(--ui-surface); border: 1px solid var(--ui-border);
  border-radius: 16px; padding: 20px 22px 20px 66px; margin: 0 0 28px;
  font-family: inherit; font-size: 14px; line-height: 1.6; box-shadow: 0 8px 28px #00000009;
}
body .woocommerce-message { border-color: color-mix(in srgb, var(--ui-accent-solid) 32%, var(--ui-border)); }
body .woocommerce-message::before {
  content: "✓"; display: grid; place-items: center; position: absolute; inset: 21px auto auto 20px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--ui-accent-soft); color: var(--ui-accent-text);
  font-family: inherit; font-size: 19px; font-weight: 600; line-height: 1;
}
body :is(.woocommerce-info, .woocommerce-error)::before { top: 23px; left: 22px; color: var(--ui-accent-text); }
body .woocommerce-error { border-color: #d96e6266; }
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::after { content: none; }
.mobiat-cart-notice { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0; }
.mobiat-notice-copy { min-width: 0; }
.mobiat-notice-label { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 3px; }
.mobiat-notice-text { color: var(--ui-muted); font-size: 13px; overflow-wrap: anywhere; }
.mobiat-notice-actions { flex-shrink: 0; }
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button {
  float: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 12px 19px; margin: 0; border: 1px solid transparent; border-radius: 100px;
  background: var(--ui-accent-solid); color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4;
  text-decoration: none; white-space: nowrap; box-shadow: none;
}
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a.button:hover { background: color-mix(in srgb, var(--ui-accent-solid) 90%, #000); color: #fff; }
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error):focus { outline: none; }
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error):focus-visible,
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :focus-visible { outline: 2px solid var(--ui-accent-text); outline-offset: 4px; }
@media (max-width: 600px) {
  body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) { padding: 17px 16px 17px 56px; border-radius: 14px; margin-bottom: 22px; }
  body .woocommerce-message::before { inset: 19px auto auto 16px; width: 26px; height: 26px; font-size: 17px; }
  body :is(.woocommerce-info, .woocommerce-error)::before { left: 18px; top: 20px; }
  .mobiat-cart-notice { align-items: flex-start; flex-direction: column; gap: 13px; }
  .mobiat-notice-label { font-size: 14px; }
  .mobiat-notice-text { font-size: 12px; }
  .mobiat-notice-actions { width: 100%; }
  body .mobiat-notice-actions a.button { width: 100%; min-height: 44px; white-space: normal; text-align: center; }
}

/* Match the content frame and gutters, including on wide and notched screens. */
body .woocommerce-message:has(.mobiat-cart-notice) {
  --mobiat-toast-gutter: var(--mobiat-content-gutter, max(clamp(18px, 4vw, 64px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
  position: fixed; z-index: 34;
  top: calc(max(var(--native-header-bottom, 80px), var(--mobiat-admin-height, 0px)) + 16px);
  right: max(var(--mobiat-toast-gutter), calc((100% - var(--frame, 1380px)) / 2 + var(--mobiat-toast-gutter))); left: auto;
  width: min(400px, calc(100% - var(--mobiat-toast-gutter) - var(--mobiat-toast-gutter))); max-width: none; box-sizing: border-box;
  margin: 0; padding: 20px 48px 20px 60px; border: 1px solid var(--ui-border); border-radius: 16px; text-align: left;
  max-height: calc(100dvh - max(var(--native-header-bottom, 80px), var(--mobiat-admin-height, 0px)) - 32px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 16px 50px #0003;
}
body .woocommerce-message:has(.mobiat-cart-notice):focus { outline: none; }
body .woocommerce-message:has(.mobiat-cart-notice)::before { inset: 20px auto auto 18px; }
body .woocommerce-message .mobiat-cart-notice {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; justify-content: stretch;
  gap: 14px; min-width: 0; text-align: left;
}
body .woocommerce-message .mobiat-notice-copy,
body .woocommerce-message .mobiat-notice-actions { min-width: 0; width: 100%; }
body .woocommerce-message .mobiat-notice-text { white-space: normal; overflow-wrap: anywhere; }
/* Beat WooCommerce's floating button rule without affecting other alerts. */
body .woocommerce-message .mobiat-notice-actions a.button {
  float: none; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 11px 16px; margin: 0;
  border-radius: 10px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; text-align: center;
}
body .woocommerce-message .mobiat-notice-close {
  display: grid; place-items: center; position: absolute; top: 6px; right: 4px; float: none;
  width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--ui-muted); font: inherit; font-size: 24px; line-height: 1;
  cursor: pointer; box-shadow: none;
}
body .woocommerce-message .mobiat-notice-close:hover { background: var(--ui-surface-2); color: var(--ui-text); }
body .woocommerce-message .mobiat-notice-close[hidden] { display: none; }
body.single-product .woocommerce-notices-wrapper:has(> .woocommerce-error, > .woocommerce-info, > .woocommerce-message:not(:has(.mobiat-cart-notice))) { padding-top: 24px; }
@media (max-width: 600px) {
  body .woocommerce-message:has(.mobiat-cart-notice) {
    top: calc(max(var(--native-header-bottom, 80px), var(--mobiat-admin-height, 0px)) + 12px);
    padding: 18px 48px 18px 52px;
    max-height: calc(100dvh - max(var(--native-header-bottom, 80px), var(--mobiat-admin-height, 0px)) - 92px - env(safe-area-inset-bottom, 0px));
  }
  body .woocommerce-message:has(.mobiat-cart-notice)::before { inset: 18px auto auto 14px; }
  body .woocommerce-message .mobiat-cart-notice { gap: 12px; }
  body .woocommerce-message .mobiat-notice-text { font-size: 13px; }
  body.single-product .woocommerce-notices-wrapper:has(> .woocommerce-error, > .woocommerce-info, > .woocommerce-message:not(:has(.mobiat-cart-notice))) { padding-top: 18px; }
}
