/* SOLEIL WooCommerce notices: understated SneakLab-inspired status cards.
 * Covers the classic .woocommerce-{message,info,error} output and the
 * contemporary WooCommerce block notice banners without replacing templates.
 */

body .woocommerce-notices-wrapper:empty,
body .woocommerce-NoticeGroup:empty { display: none; }

:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  --soleil-notice-bg: #f8f8f7;
  --soleil-notice-border: #e9e9e6;
  --soleil-notice-text: #292929;
  --soleil-notice-icon-bg: #eeeeeb;
  --soleil-notice-icon-color: #555;
  position: relative;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 55px;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 14px;
  padding: 10px 14px 10px 48px;
  border: 1px solid var(--soleil-notice-border);
  border-radius: 12px;
  background: var(--soleil-notice-bg);
  box-shadow: none;
  color: var(--soleil-notice-text);
  font-family: var(--soleil-font-family, 'DM Sans', sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  list-style: none;
  overflow-wrap: anywhere;
}

/* Keep multiple validation errors stacked, not side by side. */
:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-error {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
}

:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-message {
  --soleil-notice-bg: #f5faf6;
  --soleil-notice-border: #dfece1;
  --soleil-notice-text: #26583b;
  --soleil-notice-icon-bg: #e7f3e9;
  --soleil-notice-icon-color: #37764c;
}

:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-error {
  --soleil-notice-bg: #fff7f7;
  --soleil-notice-border: #f0dfdf;
  --soleil-notice-text: #8b4040;
  --soleil-notice-icon-bg: #fbeaea;
  --soleil-notice-icon-color: #a25050;
}

/* Replace WooCommerce's icon font and 3px status line with a small circle. */
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
  position: absolute;
  top: 50%;
  left: 12px;
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--soleil-notice-icon-bg);
  color: var(--soleil-notice-icon-color);
  font-family: inherit;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
}

/* Keep specificity above the WooCommerce icon-font rule so the supplied
 * SVG shows instead of the native tick glyph. */
:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-message::before {
  content: '';
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 12.6111L8.92308 17.5L20 6.5' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 15px;
}
:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-info::before { content: 'i'; }
:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-error::before { content: '!'; }

:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-error > li {
  padding: 0;
  margin: 0;
  border: 0;
  list-style: none;
}
:is(body, body.woocommerce, body.woocommerce-page) .woocommerce-error > li + li { margin-top: 6px; }
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:not(.button) {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* WooCommerce sometimes prints a View cart action before the message text. */
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(a.button, a.wc-forward, button.button) {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  margin: 0 0 0 16px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  box-shadow: none;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  float: none;
  transition: background-color .18s ease, border-color .18s ease;
}

/* Native WooCommerce renders the action before the message; keep it on the
 * right while the notice text stays beside its icon on the left. */
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info) > :is(a.button, a.wc-forward, button.button) {
  order: 1;
  margin-left: auto;
}
:is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(a.button, a.wc-forward, button.button):is(:hover, :focus-visible) {
  border-color: var(--soleil-color-accent);
  background: var(--soleil-color-accent);
  box-shadow: none;
  color: #fff;
  outline: 0;
}

/* Modern WooCommerce status banners and Store API/cart/checkout notifications. */
body .wc-block-components-notice-banner {
  --soleil-notice-bg: #f8f8f7;
  --soleil-notice-border: #e9e9e6;
  --soleil-notice-text: #292929;
  --soleil-notice-icon-bg: #eeeeeb;
  --soleil-notice-icon-color: #555;
  display: flex;
  box-sizing: border-box;
  width: 100%;
  min-height: 55px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--soleil-notice-border);
  border-radius: 12px;
  background: var(--soleil-notice-bg);
  box-shadow: none;
  color: var(--soleil-notice-text);
  font-family: var(--soleil-font-family, 'DM Sans', sans-serif);
  font-size: 13px;
  line-height: 1.5;
}
body .wc-block-components-notice-banner.is-success {
  --soleil-notice-bg: #f5faf6;
  --soleil-notice-border: #dfece1;
  --soleil-notice-text: #26583b;
  --soleil-notice-icon-bg: #e7f3e9;
  --soleil-notice-icon-color: #37764c;
}
body .wc-block-components-notice-banner.is-error {
  --soleil-notice-bg: #fff7f7;
  --soleil-notice-border: #f0dfdf;
  --soleil-notice-text: #8b4040;
  --soleil-notice-icon-bg: #fbeaea;
  --soleil-notice-icon-color: #a25050;
}
body .wc-block-components-notice-banner > svg {
  display: block;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  min-width: 24px;
  padding: 4px;
  margin: 0;
  border-radius: 999px;
  background: var(--soleil-notice-icon-bg);
  fill: var(--soleil-notice-icon-color);
  color: var(--soleil-notice-icon-color);
  flex: 0 0 24px;
}
body .wc-block-components-notice-banner.is-success > svg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 12.6111L8.92308 17.5L20 6.5' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 15px 15px;
}
body .wc-block-components-notice-banner.is-success > svg :is(path, circle, polygon) { display: none; }
body .wc-block-components-notice-banner > .wc-block-components-notice-banner__content {
  min-width: 0;
  padding: 0;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.55;
  flex: 1 1 auto;
}
body .wc-block-components-notice-banner .wc-block-components-notice-banner__content > :first-child { margin-top: 0; }
body .wc-block-components-notice-banner .wc-block-components-notice-banner__content > :last-child { margin-bottom: 0; }
body .wc-block-components-notice-banner .wc-block-components-notice-banner__content a:not(.wc-block-components-notice-banner__button) {
  color: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body .wc-block-components-notice-banner .wc-block-components-notice-banner__button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  box-shadow: none;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}
body .wc-block-components-notice-banner .wc-block-components-notice-banner__button:is(:hover, :focus-visible) {
  border-color: var(--soleil-color-accent);
  background: var(--soleil-color-accent);
  box-shadow: none;
  color: #fff;
  outline: 0;
}

/* Native order-received notices use the singular class name. */
body .woocommerce-notice.woocommerce-thankyou-order-received,
body .woocommerce-notice.woocommerce-thankyou-order-failed {
  padding: 14px 16px;
  margin: 0 0 18px;
  border: 1px solid #dfece1;
  border-radius: 12px;
  background: #f5faf6;
  box-shadow: none;
  color: #26583b;
  font-family: var(--soleil-font-family, 'DM Sans', sans-serif);
  font-size: 13px;
  line-height: 1.6;
}
body .woocommerce-notice.woocommerce-thankyou-order-failed {
  border-color: #f0dfdf;
  background: #fff7f7;
  color: #8b4040;
}

@media (max-width: 640px) {
  :is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
    min-height: 55px;
    padding: 10px 12px 10px 48px;
    margin-bottom: 12px;
    font-size: 12px;
  }
  :is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
    left: 12px;
    width: 24px;
    height: 24px;
  }
  :is(body, body.woocommerce, body.woocommerce-page) :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) :is(a.button, a.wc-forward, button.button) {
    min-height: 36px;
  }
  body .wc-block-components-notice-banner {
    min-height: 55px;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
  }
}
