.richards-cart-toast[hidden] {
  display: none;
}

.richards-cart-toast {
  position: fixed;
  z-index: 25;
  right: max(clamp(12px, 3vw, 36px), env(safe-area-inset-right));
  bottom: max(clamp(12px, 3vw, 36px), env(safe-area-inset-bottom));
  left: max(clamp(12px, 3vw, 36px), env(safe-area-inset-left));
  width: auto;
  max-width: 460px;
  margin-left: auto;
}

.woocommerce-message:has(.richards-cart-confirmation) {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.woocommerce-message:has(.richards-cart-confirmation)::before,
.woocommerce-message:has(.richards-cart-confirmation)::after {
  content: none;
}

.richards-cart-confirmation,
.single-product .richards-woo-content .woocommerce-notices-wrapper > .woocommerce-error {
  --richards-cart-mark-size: clamp(32px, 6vw, 42px);
  position: relative;
  border: 1px solid #3c3c3c;
  border-bottom: 2px solid var(--red-surface);
  background: #161616;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
}

.richards-cart-confirmation {
  display: flex;
  align-items: center;
  gap: clamp(9px, 2vw, 16px);
  padding: 12px clamp(10px, 2.5vw, 18px);
}

.woocommerce-message .richards-cart-confirmation {
  max-width: 36rem;
}

.single-product .richards-woo-content .woocommerce-message .richards-cart-confirmation {
  max-width: none;
}

.single-product .richards-woo-content .woocommerce-notices-wrapper > :is(.woocommerce-message:has(.richards-cart-confirmation), .woocommerce-error):focus {
  outline: 2px solid var(--red-surface);
  outline-offset: 3px;
}

.single-product .richards-woo-content .woocommerce-notices-wrapper > .woocommerce-error {
  --notice-inline-padding: clamp(10px, 2.5vw, 18px);
  --notice-gap: clamp(9px, 2vw, 16px);
  padding: 12px var(--notice-inline-padding);
  padding-inline-start: calc(var(--notice-inline-padding) + var(--richards-cart-mark-size) + var(--notice-gap));
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.single-product .richards-woo-content .woocommerce-error::before {
  content: '';
  top: 12px;
  left: auto;
  inset-inline-start: var(--notice-inline-padding);
  width: var(--richards-cart-mark-size);
  aspect-ratio: 1;
  background:
    linear-gradient(#fff, #fff) center calc(50% - 3px) / 3px 12px no-repeat,
    radial-gradient(circle, #fff 1.6px, transparent 2px) center calc(50% + 7px) / 4px 4px no-repeat,
    var(--red-surface);
}

.single-product .richards-woo-content .woocommerce-error > li {
  min-height: var(--richards-cart-mark-size);
  align-content: center;
}

.single-product .richards-woo-content .woocommerce-error > li:has(> .button.wc-forward:only-child) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--notice-gap);
}

.richards-cart-toast .richards-cart-confirmation {
  box-shadow: 0 10px 30px #0004;
}

.richards-cart-confirmation__mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: var(--richards-cart-mark-size);
  aspect-ratio: 1;
  background: var(--red-surface);
}

.richards-cart-confirmation__mark::before {
  content: '';
  width: 15px;
  height: 22px;
  background: #fff;
  clip-path: polygon(57% 0, 100% 0, 69% 39%, 94% 39%, 25% 100%, 43% 54%, 3% 54%);
}

.richards-cart-confirmation__copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.richards-cart-confirmation__title {
  display: block;
  font: 500 clamp(23px, 4vw, 29px)/1 Teko, sans-serif;
}

.richards-cart-confirmation__detail {
  display: block;
  margin-top: 2px;
  color: #d7d7d7;
  font: 400 12px/1.4 'DM Sans', sans-serif;
}

.richards-cart-confirmation__detail:empty {
  display: none;
}

.richards-cart-confirmation .richards-cart-confirmation__link,
.single-product .richards-woo-content .woocommerce-error .button.wc-forward {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: #fff;
  font: 600 12px/1.2 'DM Sans', sans-serif;
  text-decoration: underline;
  text-decoration-color: #ffffff7a;
  text-underline-offset: 4px;
}

.richards-cart-confirmation .richards-cart-confirmation__link:hover,
.single-product .richards-woo-content .woocommerce-error .button.wc-forward:hover {
  text-decoration-color: currentColor;
}

.single-product .richards-woo-content .woocommerce-error .button.wc-forward {
  float: none;
  padding: 0;
  background: transparent;
}

.richards-cart-confirmation .richards-cart-confirmation__close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #dedede;
  font: 400 22px/1 'DM Sans', sans-serif;
  cursor: pointer;
}

.richards-cart-confirmation .richards-cart-confirmation__close:hover {
  color: #fff;
  background: #ffffff12;
}

.richards-cart-confirmation :is(.richards-cart-confirmation__link, .richards-cart-confirmation__close):focus-visible,
.single-product .richards-woo-content .woocommerce-error .button.wc-forward:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .richards-cart-toast .richards-cart-confirmation--animate {
    animation: richards-cart-confirmation-in .22s ease-out both;
  }

  .richards-cart-confirmation--animate::after {
    content: '';
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: -2px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff8585 35%, #fff 50%, #ff8585 65%, transparent) no-repeat;
    background-position: -90% 0;
    background-size: 40% 100%;
    pointer-events: none;
    animation: richards-cart-confirmation-charge .62s ease-out both;
  }

  @keyframes richards-cart-confirmation-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes richards-cart-confirmation-charge {
    to { background-position: 166% 0; }
  }
}
