/*
 * Native Woo notices: Demo20 0.3.91 soft panels and action-link treatment.
 * Presentation only. Woo still owns notice data, roles, links and validation.
 * The accepted transaction bundle and its hosted payment surfaces stay scoped
 * to their own lane; only its existing after-form coupon prompt is refined.
 */
.demo33-demo20-commerce {
  --d33-notice-surface: rgb(136 135 137 / 8%);
  --d33-notice-text: #161518;
  --d33-notice-line: rgb(136 135 137 / 16%);
  --d33-notice-success: #168447;
  --d33-notice-accent: #d90a2c;
}

html[data-theme="dark"] .demo33-demo20-commerce {
  --d33-notice-surface: #242326;
  --d33-notice-text: #f4f3f5;
  --d33-notice-line: #444248;
  --d33-notice-success: #7ee2a8;
  --d33-notice-accent: #ff8298;
}

/* Core notices outside the accepted Cart/Checkout transaction surface. */
body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  margin: 0 0 22px;
  padding: 16px 20px 16px 48px;
  border: 1px solid var(--d33-notice-line);
  border-radius: 10px;
  background: var(--d33-notice-surface);
  color: var(--d33-notice-text);
  font: 400 .94rem/1.55 var(--font-body, sans-serif);
  overflow-wrap: anywhere;
  box-shadow: none;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-message {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
  position: absolute;
  top: 16px;
  left: 18px;
  margin: 0;
  color: var(--d33-notice-text);
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-message::before {
  color: var(--d33-notice-success);
}

/* The core note glyph is an outlined square. Use a clear information mark
 * for this notice alone, without depending on a private-use font glyph. */
body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-info::before {
  content: "i";
  content: "i" / "";
  box-sizing: border-box;
  display: inline-grid;
  place-items: center;
  top: 19px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
  font: 700 12px/1 Arial, sans-serif;
  text-align: center;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-message::after {
  display: none;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-error {
  list-style: none;
  border-left: 3px solid var(--d33-notice-accent);
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-error::before {
  color: var(--d33-notice-accent);
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-error li {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-error li + li {
  margin-top: 8px;
}

/* The native View Cart link follows the Demo20 toast's compact text action. */
body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-message > a.button.wc-forward {
  order: 1;
  flex: 0 0 auto;
  float: none;
  min-height: 36px;
  margin: 0 0 0 auto;
  padding: 6px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: 600 .94rem/1.55 var(--font-body, sans-serif);
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  box-shadow: none;
  transition: color .2s ease;
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > .woocommerce-message > a.button.wc-forward:hover {
  background: transparent;
  color: var(--d33-notice-accent);
}

body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
  .woocommerce-notices-wrapper > :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Same accepted coupon markup/handler, with a smaller notice rhythm. */
body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle:has(> .alert.woocommerce-info:not(.-hidden):not([hidden])) {
  margin-bottom: 24px;
}

body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle .alert.woocommerce-info:not(.-hidden) {
  box-sizing: border-box;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 12px 18px;
  border: 1px solid var(--d33-notice-line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--d33-notice-surface);
  color: var(--d33-notice-text);
  font-size: .94rem;
  line-height: 1.55;
  box-shadow: none;
}

body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle .alert.woocommerce-info > .alert-message {
  min-width: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
}

body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle .alert.woocommerce-info a.showcoupon {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s ease;
}

body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle .alert.woocommerce-info a.showcoupon:where(:hover, :focus-visible) {
  color: var(--d33-notice-accent);
}

body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
  .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
  .woocommerce-form-coupon-toggle .alert.woocommerce-info a.showcoupon:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
    .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
    .woocommerce-form-coupon-toggle:has(> .alert.woocommerce-info:not(.-hidden):not([hidden])) {
    margin-bottom: 20px;
  }

  body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
    .woocommerce-notices-wrapper > :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) {
    padding-right: 16px;
    padding-left: 42px;
  }

  body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
    .woocommerce-notices-wrapper > :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
    left: 14px;
  }

  body.demo33-demo20-commerce:not(.jay-demo19-transaction-content)
    .woocommerce-notices-wrapper > .woocommerce-message > a.button.wc-forward {
    margin-left: 0;
  }

  body.woocommerce-checkout.demo33-demo20-commerce.jay-demo19-transaction-content
    .jay-demo19-transaction-surface .site-content .jay-demo19-checkout-after-form
    .woocommerce-form-coupon-toggle .alert.woocommerce-info:not(.-hidden) {
    padding: 12px 14px;
    gap: 8px;
  }
}
/* Keep the cart coupon's native accessible label without duplicating its
 * visible placeholder. The accepted Demo20 template remains unchanged. */
body.woocommerce-cart.demo33-demo20-commerce .woocommerce-cart-form
  .coupon > label.field-label[for="coupon_code"] {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keep native coupon errors in flow so wrapped copy cannot cover the next
 * cart action. The overlay Apply button stays beside its 48px input row. */
body.woocommerce-cart.demo33-demo20-commerce .jay-demo19-transaction-surface
  .woo-actions .coupon > .coupon-error-notice {
  position: static;
  margin: 8px 0 0;
  color: var(--d33-notice-accent);
  font-size: .875em;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body.woocommerce-cart.demo33-demo20-commerce .jay-demo19-transaction-surface
  .woo-actions .coupon:has(> .coupon-error-notice) > .button {
  top: 0;
  bottom: auto;
}

body.woocommerce-cart.demo33-demo20-commerce .jay-demo19-transaction-surface
  .woo-actions:has(> .coupon > .coupon-error-notice) {
  align-items: flex-start;
}
