/* CLEIR WooCommerce notices — site-wide (checkout, account, shop, cart, product) */

body.cleir-theme .woocommerce-notices-wrapper {
  max-width: var(--cleir-wrap, 1280px);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 24px;
  margin-bottom: 0;
  padding-left: 40px;
  padding-right: 40px;
  box-sizing: border-box;
}

/* Checkout — Woo prints empty wrappers above the layout; collapse when no notice */
body.cleir-page-checkout .woocommerce > .woocommerce-notices-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
}

body.cleir-page-checkout .woocommerce-notices-wrapper:not(:has(.woocommerce-message, .woocommerce-info, .woocommerce-error, .cleir-checkout-notice)) {
  display: none !important;
}

body.cleir-page-checkout .woocommerce-notices-wrapper:has(.woocommerce-message, .woocommerce-info, .woocommerce-error, .cleir-checkout-notice) {
  margin-top: 16px !important;
  margin-bottom: 16px !important;
  padding-left: 40px !important;
  padding-right: 40px !important;
  max-width: var(--cleir-wrap, 1280px) !important;
}

body.cleir-theme .woocommerce-message,
body.cleir-theme .woocommerce-info,
body.cleir-theme .woocommerce-error,
body.cleir-theme .woocommerce-notices-wrapper .woocommerce-message,
body.cleir-theme .woocommerce-notices-wrapper .woocommerce-info,
body.cleir-theme .woocommerce-notices-wrapper .woocommerce-error,
body.cleir-theme ul.woocommerce-error,
body.cleir-theme ul.woocommerce-message,
body.cleir-theme ul.woocommerce-info {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 16px 20px 16px 52px;
  list-style: none;
  font-family: var(--cleir-sans, "DM Sans", sans-serif);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--cleir-muted, #5a5654);
  background: var(--cleir-panel, #f5f0ec);
  border: 1px solid var(--cleir-line, #e8ddd0);
  border-top: 1px solid var(--cleir-line, #e8ddd0);
  border-radius: 14px;
  box-shadow: none;
  outline: none;
}

body.cleir-theme ul.woocommerce-error li,
body.cleir-theme ul.woocommerce-message li,
body.cleir-theme ul.woocommerce-info li {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.cleir-theme .woocommerce-message::before,
body.cleir-theme .woocommerce-info::before,
body.cleir-theme .woocommerce-error::before {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  font-size: 15px;
  line-height: 1;
  color: var(--cleir-terra, #c4796a);
  float: none;
}

body.cleir-theme .woocommerce-error::before {
  color: #a8544a;
}

body.cleir-theme .woocommerce-message .button,
body.cleir-theme .woocommerce-info .button,
body.cleir-theme .woocommerce-message a.button,
body.cleir-theme .woocommerce-notices-wrapper .button,
body.cleir-theme .woocommerce-error .button {
  float: none;
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto;
  padding: 10px 22px;
  border: none;
  border-radius: 100px;
  background: var(--cleir-terra, #c4796a);
  color: #fff;
  font-family: var(--cleir-sans, "DM Sans", sans-serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  box-shadow: none;
  white-space: nowrap;
}

body.cleir-theme .woocommerce-message .button:hover,
body.cleir-theme .woocommerce-info .button:hover,
body.cleir-theme .woocommerce-notices-wrapper .button:hover,
body.cleir-theme .woocommerce-error .button:hover {
  background: var(--cleir-terra-dark, #b56b5c);
  color: #fff;
}

body.cleir-theme .woocommerce-message a:not(.button),
body.cleir-theme .woocommerce-info a:not(.button) {
  color: var(--cleir-terra, #c4796a);
  text-decoration: none;
  font-weight: 500;
}

body.cleir-theme .woocommerce-error a {
  color: #a8544a;
  font-weight: 500;
}

/* Checkout step notices */
body.cleir-theme .cleir-checkout-notice {
  margin: 0 0 20px;
  padding: 14px 18px 14px 48px;
  border-radius: 12px;
  border: 1px solid var(--cleir-line, #e8ddd0);
  background: var(--cleir-panel, #f5f0ec);
  color: var(--cleir-muted, #5a5654);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

body.cleir-theme .cleir-checkout-notice.is-error {
  border-color: rgba(168, 84, 74, 0.35);
  background: #fdf3f1;
  color: #7a4038;
}

@media (max-width: 767px) {
  body.cleir-theme .woocommerce-notices-wrapper {
    padding-left: 20px;
    padding-right: 20px;
  }

  body.cleir-theme .woocommerce-message,
  body.cleir-theme .woocommerce-info,
  body.cleir-theme .woocommerce-error {
    padding: 14px 16px 14px 44px;
    font-size: 14px;
  }

  body.cleir-theme .woocommerce-message .button,
  body.cleir-theme .woocommerce-info .button {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }
}
