/* Match the site's warm surfaces, sharp edges and restrained green accents. */
body .woocommerce-message[class],
body .woocommerce-info[class],
body .woocommerce-error[class],
body .wc-block-components-notice-banner[class] {
  --notice-accent: var(--accent);
  position: relative;
  display: flow-root;
  box-sizing: border-box;
  margin: 0 0 24px;
  padding: 20px 24px 20px 58px;
  border: 1px solid var(--divider);
  border-inline-start: 3px solid var(--notice-accent);
  border-radius: 0;
  background: var(--warm);
  color: var(--text);
  box-shadow: none;
  font-family: "Space Grotesk", sans-serif;
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.7;
  list-style: none;
  overflow-wrap: anywhere;
}

body .woocommerce-error[class],
body .wc-block-components-notice-banner[class].is-error {
  --notice-accent: #9b382e;
}

body .wc-block-components-notice-banner[class].is-warning {
  --notice-accent: #80601e;
}

/* Replace WooCommerce's icon font with an outlined icon in the theme's style. */
body .woocommerce-message[class]::before,
body .woocommerce-info[class]::before,
body .woocommerce-error[class]::before {
  content: "";
  position: absolute;
  inset: 22px auto auto 22px;
  width: 20px;
  height: 20px;
  background: var(--notice-accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

body .woocommerce-info[class]::before,
body .woocommerce-error[class]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v6m0 4h.01'/%3E%3C/svg%3E");
}

body .woocommerce-error[class] li,
body .wc-block-components-notice-banner[class] li {
  padding: 0;
  margin: 0;
  list-style: none;
}

body .woocommerce-error[class] li + li,
body .wc-block-components-notice-banner[class] li + li {
  margin-top: 8px;
}

body .woocommerce-message[class] a:not(.button),
body .woocommerce-info[class] a:not(.button),
body .woocommerce-error[class] a:not(.button),
body .wc-block-components-notice-banner[class] a:not(.button) {
  color: var(--notice-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body .woocommerce-message[class] .button,
body .woocommerce-info[class] .button,
body .woocommerce-error[class] .button,
body .wc-block-components-notice-banner[class] .button {
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0 0 0 24px;
  padding: 10px 20px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--text);
  color: #fff;
  box-shadow: none;
  font: inherit;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background .18s, border-color .18s;
}

body .woocommerce-message[class] .button:hover,
body .woocommerce-info[class] .button:hover,
body .woocommerce-error[class] .button:hover,
body .wc-block-components-notice-banner[class] .button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body .woocommerce-message[class] a:focus-visible,
body .woocommerce-info[class] a:focus-visible,
body .woocommerce-error[class] a:focus-visible,
body .wc-block-components-notice-banner[class] a:focus-visible,
body .wc-block-components-notice-banner[class] button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

body .wc-block-components-notice-banner[class] {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 24px !important;
}

body .wc-block-components-notice-banner[class] > svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  fill: var(--notice-accent);
  color: var(--notice-accent);
}

body .wc-block-components-notice-banner__content {
  flex: 1;
  min-width: 0;
}

body .wc-block-components-notice-banner[class] .wc-block-components-notice-banner__content > ul {
  margin: 0;
  padding: 0;
}

@media (max-width: 600px) {
  body .woocommerce-message[class],
  body .woocommerce-info[class],
  body .woocommerce-error[class] {
    padding: 18px 18px 18px 48px;
  }

  body .woocommerce-message[class]::before,
  body .woocommerce-info[class]::before,
  body .woocommerce-error[class]::before {
    top: 20px;
    left: 16px;
  }

  body .woocommerce-message[class] .button,
  body .woocommerce-info[class] .button,
  body .woocommerce-error[class] .button,
  body .wc-block-components-notice-banner[class] .button {
    float: none;
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 12px;
  }

  body .wc-block-components-notice-banner[class] {
    padding: 18px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .woocommerce-message[class] .button,
  body .woocommerce-info[class] .button,
  body .woocommerce-error[class] .button,
  body .wc-block-components-notice-banner[class] .button {
    transition: none;
  }
}

/* Recent WooCommerce versions put coupon failures beside the coupon field. */
body .woocommerce form.checkout_coupon .coupon-error-notice,
body.woocommerce-cart table.cart td.actions .coupon .coupon-error-notice,
body.woocommerce-checkout table.cart td.actions .coupon .coupon-error-notice {
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--divider);
  border-inline-start: 3px solid #9b382e;
  border-radius: 0;
  background: var(--warm);
  color: #9b382e;
  font: inherit;
  font-size: .8125rem;
  line-height: 1.6;
}

/* WooCommerce marks the dismiss button's outline !important. */
body .wc-block-components-notice-banner[class] button:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 4px !important;
}
