/* Nuni WooCommerce toast system.
 *
 * JavaScript moves transient WooCommerce notices into one fixed region so
 * checkout validation, add-to-cart feedback, and AJAX notices share the same
 * responsive layout. Durable WooCommerce banners remain in their page flow.
 */

.nuni-wc-toast-region {
  --nuni-toast-surface: #fffdf8;
  --nuni-toast-ink: var(--nuni-ink, #2a1f14);
  --nuni-toast-muted: var(--nuni-muted, #6b5b47);
  --nuni-toast-border: rgba(42, 31, 20, 0.16);
  --nuni-toast-success: #2a1f14;
  --nuni-toast-success-soft: rgba(42, 31, 20, 0.07);
  --nuni-toast-error: #b43f35;
  --nuni-toast-error-soft: #faece9;
  --nuni-toast-info: #4b6877;
  --nuni-toast-info-soft: #eaf0f3;
  --nuni-toast-ease: var(--nuni-ease, cubic-bezier(.6, .05, .2, 1));
  --nuni-toast-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 2px 5px rgba(42, 31, 20, 0.12),
    0 14px 32px -14px rgba(42, 31, 20, 0.32);

  position: fixed !important;
  top: calc(var(--nuni-nav-h, 72px) + 16px);
  right: 20px;
  left: auto;
  z-index: 100020;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - var(--nuni-nav-h, 72px) - 32px);
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: none;
  overscroll-behavior: contain;
}

.nuni-wc-toast-region > .nuni-wc-notice {
  box-sizing: border-box !important;
  position: relative !important;
  display: block !important;
  width: 100% !important;
  min-height: 64px;
  margin: 0 !important;
  padding: 15px 52px 15px 58px !important;
  overflow: hidden;
  color: var(--nuni-toast-ink) !important;
  background: var(--nuni-toast-surface) !important;
  border: 1px solid var(--nuni-toast-border) !important;
  border-radius: 8px !important;
  box-shadow: var(--nuni-toast-shadow) !important;
  font-family: var(--nuni-font-sans, 'Inter'), system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: 0 !important;
  list-style: none !important;
  text-align: left !important;
  pointer-events: auto;
  transform-origin: top right;
  animation: nuniWcNoticeIn 280ms var(--nuni-toast-ease) both;
}

.nuni-wc-toast-region > .nuni-wc-notice::before {
  box-sizing: border-box;
  content: "i" !important;
  position: absolute !important;
  top: 50% !important;
  left: 16px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  color: var(--nuni-toast-info) !important;
  background: var(--nuni-toast-info-soft) !important;
  border: 0 !important;
  border-radius: 50% !important;
  font-family: Georgia, serif !important;
  font-size: 16px !important;
  font-style: normal !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  transform: translateY(-50%) !important;
  pointer-events: none;
}

.nuni-wc-toast-region > .woocommerce-message::before {
  content: "\2713" !important;
  color: var(--nuni-toast-success) !important;
  background: var(--nuni-toast-success-soft) !important;
  font-family: Arial, sans-serif !important;
  font-size: 15px !important;
}

.nuni-wc-toast-region > .woocommerce-error::before {
  content: "!" !important;
  color: var(--nuni-toast-error) !important;
  background: var(--nuni-toast-error-soft) !important;
  font-family: Arial, sans-serif !important;
}

.nuni-wc-toast-region > .nuni-wc-notice > li {
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  list-style: none !important;
}

.nuni-wc-toast-region > .nuni-wc-notice > li + li {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(42, 31, 20, 0.1);
}

.nuni-wc-toast-region > .nuni-wc-notice p {
  margin: 0 !important;
}

.nuni-wc-toast-region > .nuni-wc-notice a {
  color: inherit !important;
  text-decoration-color: currentColor !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Add-to-cart layout with product thumbnail and cart action. */
.nuni-wc-toast-region > .nuni-wc-notice--product {
  padding: 12px 52px 12px 12px !important;
}

.nuni-wc-toast-region > .nuni-wc-notice--product::before {
  display: none !important;
}

.nuni-wc-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nuni-wc-toast__thumb {
  flex: 0 0 56px;
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: var(--nuni-page, #fbf7ee);
  border: 1px solid rgba(42, 31, 20, 0.12);
  border-radius: 6px;
}

.nuni-wc-toast__thumb-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
  object-position: center;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.nuni-wc-toast__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.nuni-wc-toast__title {
  display: block;
  color: var(--nuni-toast-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.nuni-wc-toast__message {
  display: block;
  color: var(--nuni-toast-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.nuni-wc-toast-region .wc-forward,
.nuni-wc-toast-region a.button {
  align-self: flex-start;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 0 2px !important;
  color: var(--nuni-toast-ink) !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid currentColor !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-transform: none !important;
}

.nuni-wc-toast-region .wc-forward:hover,
.nuni-wc-toast-region a.button:hover {
  color: var(--nuni-toast-ink) !important;
}

/* Universal dismiss control, added to every transient notice by JS. */
.nuni-wc-toast-region button.nuni-wc-toast__close {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: absolute !important;
  top: 50% !important;
  right: 8px !important;
  z-index: 2 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--nuni-toast-muted) !important;
  -webkit-text-fill-color: var(--nuni-toast-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  font-family: Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  transform: translateY(-50%) !important;
  cursor: pointer !important;
  transition: color 160ms ease, background-color 160ms ease !important;
  -webkit-tap-highlight-color: transparent;
}

.nuni-wc-toast-region button.nuni-wc-toast__close:hover {
  color: var(--nuni-toast-ink) !important;
  -webkit-text-fill-color: var(--nuni-toast-ink) !important;
  background: rgba(42, 31, 20, 0.07) !important;
}

.nuni-wc-toast-region button.nuni-wc-toast__close:focus-visible {
  color: var(--nuni-toast-ink) !important;
  -webkit-text-fill-color: var(--nuni-toast-ink) !important;
  background: rgba(42, 31, 20, 0.07) !important;
  outline: 2px solid var(--nuni-toast-ink) !important;
  outline-offset: -3px;
}

.nuni-wc-toast-region button.nuni-wc-toast__close span {
  display: block;
  transform: translateY(-1px);
}

.nuni-wc-toast-region > .nuni-wc-notice.is-dismissing {
  pointer-events: none;
  animation: nuniWcNoticeOut 220ms var(--nuni-toast-ease) both !important;
}

@keyframes nuniWcNoticeIn {
  from {
    opacity: 0;
    transform: translate3d(18px, -3px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes nuniWcNoticeOut {
  to {
    opacity: 0;
    transform: translate3d(12px, -4px, 0) scale(0.985);
  }
}

/* Keep only one feedback system when product-bundle plugins add their own. */
.woosb-popup,
.woosb-cart-popup,
.woosb-notice,
.woosb-added-popup,
.woosb-message,
.woosb-content > .woosb-message {
  display: none !important;
}

@media (max-width: 720px) {
  .nuni-wc-toast-region {
    top: calc(var(--nuni-nav-h, 64px) + 10px);
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100dvh - var(--nuni-nav-h, 64px) - 24px);
    gap: 8px;
  }

  .nuni-wc-toast-region > .nuni-wc-notice {
    min-height: 60px;
    padding: 14px 50px 14px 54px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
  }

  .nuni-wc-toast-region > .nuni-wc-notice::before {
    left: 13px !important;
    width: 28px !important;
    height: 28px !important;
  }

  .nuni-wc-toast-region > .nuni-wc-notice--product {
    padding: 10px 50px 10px 10px !important;
  }

  .nuni-wc-toast {
    gap: 10px;
  }

  .nuni-wc-toast__thumb {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
  }

  .nuni-wc-toast-region button.nuni-wc-toast__close {
    right: 4px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
}

@media (max-width: 360px) {
  .nuni-wc-toast-region > .nuni-wc-notice--product {
    padding: 14px 50px 14px 54px !important;
  }

  .nuni-wc-toast-region > .nuni-wc-notice--product::before {
    display: flex !important;
  }

  .nuni-wc-toast__thumb {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nuni-wc-toast-region > .nuni-wc-notice {
    animation-duration: 1ms !important;
  }
}
