/* =========================================================================
   BRITTLE NOTICES  —  every WooCommerce message on the site

   Why "body:not(#bn)" in front of every rule: the theme, Elementor and the
   checkout styles all target these same classes. ":not(#bn)" adds the weight
   of an id without needing one, so these rules win wherever the notice appears.
   ========================================================================= */

body:not(#bn) {
  --bn-plum: #3B203D;
  --bn-muted: #756B73;
  --bn-paper: #FFFDF9;
  --bn-coral: #E99A8A;

  --bn-err-bg: #FDF0EE;
  --bn-err-line: rgba(179, 38, 30, 0.2);
  --bn-err-text: #7A1F17;
  --bn-err-strong: #5C140E;

  --bn-ok-bg: #EEF6EF;
  --bn-ok-line: rgba(46, 125, 69, 0.22);
  --bn-ok-text: #1F4D2B;

  --bn-info-bg: #FFFDF9;
  --bn-info-line: rgba(59, 32, 61, 0.14);

  --bn-icon-err: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%23B3261E'/%3E%3Cpath d='M12 6.5v7' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='17.2' r='1.4' fill='%23fff'/%3E%3C/svg%3E");
  --bn-icon-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%232E7D45'/%3E%3Cpath d='M7 12.4l3.2 3.1L17 8.8' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --bn-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%233B203D'/%3E%3Ccircle cx='12' cy='7.4' r='1.4' fill='%23fff'/%3E%3Cpath d='M12 11v6' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}


/* =========================================================================
   1. THE BOX (shared by all three types)
   ========================================================================= */

body:not(#bn) .woocommerce-error,
body:not(#bn) .woocommerce-message,
body:not(#bn) .woocommerce-info {
  position: relative !important;
  display: block;
  width: auto !important;
  margin: 0 0 20px !important;
  padding: 16px 20px 16px 54px !important;
  border: 1px solid transparent !important;
  border-left-width: 1px !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  list-style: none !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  text-align: left !important;
  word-wrap: break-word;
}

/* the icon (replaces WooCommerce's / the theme's bell, tick or info glyph) */
body:not(#bn) .woocommerce-error::before,
body:not(#bn) .woocommerce-message::before,
body:not(#bn) .woocommerce-info::before {
  content: "" !important;
  position: absolute !important;
  top: 16px !important;
  left: 18px !important;
  right: auto !important;
  bottom: auto !important;
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  border: 0 !important;
  background-color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 22px 22px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  transform: none !important;
}

body:not(#bn) .woocommerce-error::after,
body:not(#bn) .woocommerce-message::after,
body:not(#bn) .woocommerce-info::after {
  display: none !important;
}

/* list items inside (errors come as a list, one item per problem) */
body:not(#bn) .woocommerce-error li,
body:not(#bn) .woocommerce-message li,
body:not(#bn) .woocommerce-info li {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  list-style: none !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

body:not(#bn) .woocommerce-error li::before,
body:not(#bn) .woocommerce-error li::marker {
  content: none !important;
  display: none !important;
}


/* =========================================================================
   2. ERROR
   ========================================================================= */

body:not(#bn) .woocommerce-error {
  border-color: var(--bn-err-line) !important;
  background: var(--bn-err-bg) !important;
  color: var(--bn-err-text) !important;
}

body:not(#bn) .woocommerce-error::before {
  background-image: var(--bn-icon-err) !important;
}

body:not(#bn) .woocommerce-error strong,
body:not(#bn) .woocommerce-error b {
  color: var(--bn-err-strong) !important;
  font-weight: 600 !important;
}

body:not(#bn) .woocommerce-error a {
  color: var(--bn-err-strong) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

/* several problems: heading + a tidy list (the heading is added by notices.js) */
body:not(#bn) .woocommerce-error .bn-title {
  margin: 0 0 6px !important;
  color: var(--bn-err-strong) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

body:not(#bn) .woocommerce-error.bn-many li:not(.bn-title) {
  position: relative;
  padding: 3px 0 3px 14px !important;
}

body:not(#bn) .woocommerce-error.bn-many li:not(.bn-title)::after {
  content: "" !important;
  position: absolute;
  top: 12px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
}

/* items that point at a field are tappable (notices.js makes them jump to it) */
body:not(#bn) .woocommerce-error li.bn-jump {
  cursor: pointer;
}

body:not(#bn) .woocommerce-error li.bn-jump:hover,
body:not(#bn) .woocommerce-error li.bn-jump:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
  outline: none;
}

body:not(#bn) .woocommerce-error li.bn-jump:focus-visible {
  border-radius: 6px !important;
  box-shadow: 0 0 0 2px var(--bn-err-line) !important;
}


/* =========================================================================
   3. SUCCESS  ("… has been added to your cart"  [View cart])
   ========================================================================= */

body:not(#bn) .woocommerce-message {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  border-color: var(--bn-ok-line) !important;
  background: var(--bn-ok-bg) !important;
  color: var(--bn-ok-text) !important;
}

body:not(#bn) .woocommerce-message::before {
  top: 50% !important;
  margin-top: -11px !important;
  background-image: var(--bn-icon-ok) !important;
}

/* the text takes the room; the button goes to the end */
body:not(#bn) .woocommerce-message > a.button,
body:not(#bn) .woocommerce-message > .button,
body:not(#bn) .woocommerce-info > a.button,
body:not(#bn) .woocommerce-info > .button {
  order: 2;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 40px !important;
  margin: 0 0 0 auto !important;
  padding: 0 18px !important;
  border: 1px solid var(--bn-plum) !important;
  border-radius: 999px !important;
  background: var(--bn-plum) !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body:not(#bn) .woocommerce-message > a.button:hover,
body:not(#bn) .woocommerce-message > .button:hover,
body:not(#bn) .woocommerce-info > a.button:hover,
body:not(#bn) .woocommerce-info > .button:hover {
  border-color: var(--bn-coral) !important;
  background: var(--bn-coral) !important;
  color: var(--bn-plum) !important;
}

body:not(#bn) .woocommerce-message a:not(.button) {
  color: var(--bn-ok-text) !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}


/* =========================================================================
   4. INFO  ("Returning customer? Click here to login", "Have a coupon?" …)
   ========================================================================= */

body:not(#bn) .woocommerce-info {
  border-color: var(--bn-info-line) !important;
  background: var(--bn-info-bg) !important;
  color: var(--bn-plum) !important;
}

body:not(#bn) .woocommerce-info::before {
  background-image: var(--bn-icon-info) !important;
}

body:not(#bn) .woocommerce-info a:not(.button) {
  color: var(--bn-plum) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
  text-decoration-color: var(--bn-coral) !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
}

body:not(#bn) .woocommerce-info a:not(.button):hover {
  text-decoration-color: var(--bn-plum) !important;
}

/* the checkout's "Returning customer?" / "Have a coupon?" strips: a bit tighter */
body:not(#bn) .woocommerce-form-login-toggle .woocommerce-info,
body:not(#bn) .woocommerce-form-coupon-toggle .woocommerce-info {
  margin-bottom: 16px !important;
}


/* checkout: field problems are shown under their fields, so notices.js hides them up here */
body:not(#bn) .bn-hidden {
  display: none !important;
}


/* =========================================================================
   5. THE SMALL ERROR UNDER A CHECKOUT FIELD
   ========================================================================= */

body:not(#bn) .checkout-inline-error-message,
body:not(#bn) .woocommerce-invalid .checkout-inline-error-message {
  position: relative;
  display: block;
  margin: 6px 0 0 !important;
  padding: 0 0 0 22px !important;
  border: 0 !important;
  background: none !important;
  color: #9B2C22 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
}

body:not(#bn) .checkout-inline-error-message::before {
  content: "" !important;
  position: absolute;
  top: 2px;
  left: 0;
  width: 15px;
  height: 15px;
  background: var(--bn-icon-err) no-repeat center / 15px 15px;
}

/* the field itself: one clean red border, no glow (a glow bleeds past the field's edge) */
body:not(#bn) .woocommerce-invalid input.input-text,
body:not(#bn) .woocommerce-invalid select,
body:not(#bn) .woocommerce-invalid textarea,
body:not(#bn) .woocommerce-invalid .select2-selection {
  border: 1px solid #C0392B !important;
  box-shadow: none !important;
  outline: none !important;
}

/* while typing in a field that had a problem: the site's normal focus look, no red */
body:not(#bn) .woocommerce-invalid input.input-text:focus,
body:not(#bn) .woocommerce-invalid textarea:focus {
  border-color: #3B203D !important;
}


/* =========================================================================
   6. BLOCK-BASED CART / CHECKOUT (if those pages ever use blocks)
   ========================================================================= */

body:not(#bn) .wc-block-components-notice-banner {
  border-radius: 16px !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

body:not(#bn) .wc-block-components-notice-banner.is-error {
  border-color: var(--bn-err-line) !important;
  background: var(--bn-err-bg) !important;
  color: var(--bn-err-text) !important;
}

body:not(#bn) .wc-block-components-notice-banner.is-success {
  border-color: var(--bn-ok-line) !important;
  background: var(--bn-ok-bg) !important;
  color: var(--bn-ok-text) !important;
}

body:not(#bn) .wc-block-components-notice-banner.is-info {
  border-color: var(--bn-info-line) !important;
  background: var(--bn-info-bg) !important;
  color: var(--bn-plum) !important;
}


/* =========================================================================
   7. PHONES
   ========================================================================= */

@media (max-width: 600px) {
  body:not(#bn) .woocommerce-error,
  body:not(#bn) .woocommerce-message,
  body:not(#bn) .woocommerce-info {
    padding: 14px 16px 14px 48px !important;
    border-radius: 14px !important;
  }

  body:not(#bn) .woocommerce-error::before,
  body:not(#bn) .woocommerce-info::before {
    top: 14px !important;
    left: 15px !important;
  }

  body:not(#bn) .woocommerce-message::before {
    top: 14px !important;
    left: 15px !important;
    margin-top: 0 !important;
  }

  /* on a phone the View cart button sits on its own line, full width */
  body:not(#bn) .woocommerce-message > a.button,
  body:not(#bn) .woocommerce-message > .button {
    flex: 1 1 100%;
    margin: 4px 0 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(#bn) .woocommerce-message > a.button,
  body:not(#bn) .woocommerce-info > a.button {
    transition: none;
  }
}
