.awp-notice-ajax {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100005;
  width: min(31rem, calc(100vw - 2rem));
  color: var(--color-text);
}

.awp-notice-ajax > * + * {
  margin-top: .75rem !important;
}

.awp-notice-ajax .woocommerce-message,
.woocommerce-message:has(.asanwp-cart-success),
.awp-notice-ajax .asanwp-cart-notice {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-green600) 24%, var(--color-gray100));
  border-radius: .85rem;
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: 0 .8rem 2.5rem rgba(27, 31, 34, .14);
}

.awp-notice-ajax .asanwp-cart-notice--error {
  border-color: color-mix(in srgb, var(--color-red600) 24%, var(--color-gray100));
}

.asanwp-cart-success {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  min-height: 5rem;
  padding: .85rem 1rem;
  border-inline-start: 4px solid var(--color-green600);
}

.asanwp-cart-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-green600) 12%, transparent);
  color: var(--color-green700);
  font-size: 1.25rem;
}

.asanwp-cart-notice__body--error {
  border-inline-start-color: var(--color-red600);
}

.asanwp-cart-notice__body--error .asanwp-cart-success__icon {
  background: color-mix(in srgb, var(--color-red600) 12%, transparent);
  color: var(--color-red600);
}

.asanwp-cart-notice__body--notice {
  border-inline-start-color: var(--theme-primary-color);
}

.asanwp-cart-notice__body--notice .asanwp-cart-success__icon {
  background: color-mix(in srgb, var(--theme-primary-color) 12%, transparent);
  color: var(--theme-primary-color);
}

.asanwp-cart-success__copy {
  display: grid;
  min-width: 0;
  line-height: 1.75;
}

.asanwp-cart-success__copy strong {
  color: var(--color-text);
  font-size: .86rem;
  font-weight: 800;
}

.asanwp-cart-success__copy > span {
  color: var(--color-gray600);
  font-size: .72rem;
}

.awp-notice-ajax .asanwp-cart-success__link,
.asanwp-cart-success__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin: 0 !important;
  padding: .45rem .8rem !important;
  border: 1px solid var(--theme-primary-color) !important;
  border-radius: .55rem;
  background: transparent !important;
  color: var(--theme-primary-color) !important;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.5 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.asanwp-cart-success__link:hover,
.asanwp-cart-success__link:focus {
  border-color: var(--theme-primary-hover-color) !important;
  color: var(--theme-primary-hover-color) !important;
}

.awp-notice-ajax ul.woocommerce-error,
body.single-product .woocommerce-notices-wrapper ul.woocommerce-error {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-red600) 24%, var(--color-gray100));
  border-radius: .85rem;
  background: var(--color-background);
  color: var(--color-text);
  box-shadow: 0 .8rem 2.5rem rgba(27, 31, 34, .14);
  list-style: none;
}

.awp-notice-ajax .woocommerce-error li,
body.single-product .woocommerce-notices-wrapper .woocommerce-error li {
  position: relative;
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  min-height: 5rem;
  margin: 0;
  padding: .85rem 3.25rem .85rem 1rem;
  border-inline-start: 4px solid var(--color-red600);
  color: var(--color-text);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.8;
}

.awp-notice-ajax .woocommerce-error li::before,
body.single-product .woocommerce-notices-wrapper .woocommerce-error li::before {
  position: static;
  display: inline-grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  margin: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-red600) 12%, transparent);
  color: var(--color-red600);
  content: "!";
  font-size: 1.15rem;
  font-weight: 900;
}

.awp-notice-ajax .woocommerce-error a,
body.single-product .woocommerce-notices-wrapper .woocommerce-error a {
  color: var(--color-red600);
  text-decoration: underline;
}

.awp-notice-close {
  position: absolute;
  top: .65rem;
  inset-inline-end: .65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  color: currentColor;
  cursor: pointer;
}

.woocommerce-message:has(.asanwp-cart-success) > .awp-notice-close {
  display: none;
}

body[data-theme=dark] .awp-notice-ajax .woocommerce-message,
body[data-theme=dark] .woocommerce-message:has(.asanwp-cart-success),
body[data-theme=dark] .awp-notice-ajax .asanwp-cart-notice,
body[data-theme=dark] .awp-notice-ajax ul.woocommerce-error,
body[data-theme=dark].single-product .woocommerce-notices-wrapper ul.woocommerce-error {
  border-color: rgba(74, 222, 128, .22);
  background: #202329;
}

body[data-theme=dark] .awp-notice-ajax ul.woocommerce-error,
body[data-theme=dark] .awp-notice-ajax .asanwp-cart-notice--error,
body[data-theme=dark].single-product .woocommerce-notices-wrapper ul.woocommerce-error {
  border-color: rgba(248, 113, 113, .24);
}

@media screen and (max-width: 600px) {
  .awp-notice-ajax {
    right: .75rem;
    bottom: 5.5rem;
    left: .75rem;
    width: auto;
  }

  .asanwp-cart-success {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    gap: .6rem;
    min-height: 0;
    padding: .75rem;
  }

  .asanwp-cart-success__icon {
    width: 2.35rem;
    height: 2.35rem;
  }

  .awp-notice-ajax .woocommerce-error li,
  body.single-product .woocommerce-notices-wrapper .woocommerce-error li {
    grid-template-columns: 2.35rem minmax(0, 1fr);
    gap: .6rem;
    min-height: 0;
    padding: .75rem 2.75rem .75rem .75rem;
  }

  .awp-notice-ajax .woocommerce-error li::before,
  body.single-product .woocommerce-notices-wrapper .woocommerce-error li::before {
    width: 2.35rem;
    height: 2.35rem;
  }

  .asanwp-cart-success__link {
    grid-column: 1 / -1;
    width: 100%;
  }
}


/* Server-rendered add-to-cart success messages use the same toast position as
   AJAX notices. JavaScript migrates them into .awp-notice-ajax on ready; this
   fallback prevents an inline full-width flash before that happens. */
.woocommerce-notices-wrapper > .woocommerce-message:has(.asanwp-cart-success) {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 100005;
  width: min(31rem, calc(100vw - 2rem));
  margin: 0 !important;
}

@media (max-width: 575.98px) {
  .woocommerce-notices-wrapper > .woocommerce-message:has(.asanwp-cart-success) {
    right: .75rem;
    bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 1.5rem);
  }
}
