/**
 * WooCommerce notices – site-wide (product, cart, checkout, account).
 *
 * Black box, white text, brand-red button, rounded like the theme cards.
 * Covers classic notices (.woocommerce-message / -info / -error, also inside
 * .woocommerce-NoticeGroup on checkout) and block notices
 * (.wc-block-components-notice-banner) used by the block cart/checkout.
 *
 * Loaded after main.min.css and overrides WooCommerce's and the theme's
 * older notice styles (single-product-style1.css, checkout-style1.css),
 * which is why some declarations use !important. The doubled classes
 * (.woocommerce-message.woocommerce-message) only raise specificity above
 * ".woocommerce-notices-wrapper .woocommerce-message" in those files.
 */

:root {
  --tp-notice-bg: #1c1c1c;
  --tp-notice-text: #ffffff;
  --tp-notice-muted: rgba(255, 255, 255, 0.72);
  --tp-notice-accent: #c61618;
  --tp-notice-radius: var(--border-radius-lg, 10px);
}

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

.woocommerce-notices-wrapper > * + *,
.woocommerce-NoticeGroup > * + * {
  margin-top: 10px !important;
}

/* ── Classic notices ───────────────────────────────────────────────────────── */
body .woocommerce-message.woocommerce-message,
body .woocommerce-info.woocommerce-info,
body .woocommerce-error.woocommerce-error {
  position: relative;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0 0 16px !important;
  padding: 14px 18px 14px 54px !important;
  min-height: 52px;
  list-style: none !important;
  background: var(--tp-notice-bg) !important;
  color: var(--tp-notice-text) !important;
  border: 0 !important;
  border-radius: var(--tp-notice-radius) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  font-size: 0.92rem !important;
  font-weight: 500;
  line-height: 1.45 !important;
  text-align: left;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* WooCommerce focuses notices for screen readers; no visible frame needed. */
body .woocommerce-message.woocommerce-message:focus,
body .woocommerce-info.woocommerce-info:focus,
body .woocommerce-error.woocommerce-error:focus {
  outline: none !important;
}

body .woocommerce-error.woocommerce-error {
  display: block !important;
  box-shadow: inset 4px 0 0 var(--tp-notice-accent), 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

body .woocommerce-error.woocommerce-error li {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  color: inherit !important;
}

body .woocommerce-error.woocommerce-error li a:not(.button) {
  font-weight: inherit;
}

body .woocommerce-error.woocommerce-error li + li {
  margin-top: 4px !important;
}

body .woocommerce-message.woocommerce-message strong,
body .woocommerce-info.woocommerce-info strong,
body .woocommerce-error.woocommerce-error strong {
  color: inherit;
  font-weight: 700;
}

/* Icon (replaces WooCommerce's icon font) */
body .woocommerce-message.woocommerce-message::before,
body .woocommerce-info.woocommerce-info::before,
body .woocommerce-error.woocommerce-error::before {
  content: "\2713" !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute !important;
  left: 18px !important;
  top: 15px !important;
  width: 22px;
  height: 22px;
  margin: 0 !important;
  border-radius: 50%;
  background: var(--tp-notice-text);
  color: var(--tp-notice-bg) !important;
  font-family: inherit !important;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

body .woocommerce-info.woocommerce-info::before {
  content: "i" !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-style: italic;
  font-size: 14px;
}

body .woocommerce-error.woocommerce-error::before {
  content: "!" !important;
  background: var(--tp-notice-accent);
  color: #ffffff !important;
  font-size: 14px;
}

body .woocommerce-message.woocommerce-message::after,
body .woocommerce-info.woocommerce-info::after,
body .woocommerce-error.woocommerce-error::after {
  content: none !important;
  display: none !important;
}

/* Links */
body .woocommerce-message.woocommerce-message a:not(.button),
body .woocommerce-info.woocommerce-info a:not(.button),
body .woocommerce-error.woocommerce-error a:not(.button),
.wc-block-components-notice-banner a:not(.button):not(.wc-block-components-button) {
  color: var(--tp-notice-text) !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
  font-weight: 600;
}

body .woocommerce-message.woocommerce-message a:not(.button):hover,
body .woocommerce-info.woocommerce-info a:not(.button):hover,
body .woocommerce-error.woocommerce-error a:not(.button):hover,
.wc-block-components-notice-banner a:not(.button):not(.wc-block-components-button):hover {
  color: var(--tp-notice-muted) !important;
}

/* "Visa varukorg" and other buttons in notices */
body .woocommerce-message.woocommerce-message .button,
body .woocommerce-info.woocommerce-info .button,
body .woocommerce-error.woocommerce-error .button,
body .woocommerce-notices-wrapper .button.wc-forward,
.wc-block-components-notice-banner .wc-forward,
.wc-block-components-notice-banner .button {
  order: 2;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 0 0 auto !important;
  padding: 9px 16px !important;
  min-height: 0;
  border: 0 !important;
  border-radius: var(--border-radius-smort, 6px) !important;
  background: var(--tp-notice-accent) !important;
  color: #ffffff !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  font-style: normal !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  box-shadow: none !important;
  transition: background 0.15s ease;
}

body .woocommerce-message.woocommerce-message .button:hover,
body .woocommerce-info.woocommerce-info .button:hover,
body .woocommerce-error.woocommerce-error .button:hover,
body .woocommerce-notices-wrapper .button.wc-forward:hover,
.wc-block-components-notice-banner .wc-forward:hover,
.wc-block-components-notice-banner .button:hover {
  background: #a51214 !important;
  color: #ffffff !important;
}

body .woocommerce-message.woocommerce-message .button:focus-visible,
body .woocommerce-info.woocommerce-info .button:focus-visible,
.wc-block-components-notice-banner .wc-forward:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ── Block notices (block cart / checkout) ─────────────────────────────────── */
.wc-block-components-notice-banner {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 0 16px !important;
  padding: 14px 18px !important;
  background: var(--tp-notice-bg) !important;
  color: var(--tp-notice-text) !important;
  border: 0 !important;
  border-radius: var(--tp-notice-radius) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

.wc-block-components-notice-banner.is-error {
  box-shadow: inset 4px 0 0 var(--tp-notice-accent), 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.wc-block-components-notice-banner > svg {
  flex: 0 0 22px;
  width: 22px !important;
  height: 22px !important;
  padding: 2px;
  border-radius: 50%;
  background-color: var(--tp-notice-text) !important;
  fill: var(--tp-notice-bg) !important;
}

.wc-block-components-notice-banner.is-error > svg {
  background-color: var(--tp-notice-accent) !important;
  fill: #ffffff !important;
}

.wc-block-components-notice-banner > .wc-block-components-notice-banner__content {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  color: inherit !important;
}

.wc-block-components-notice-banner__content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wc-block-components-notice-banner__summary {
  margin: 0 0 4px !important;
  font-weight: 700;
}

.wc-block-components-notice-banner > .wc-block-components-button,
.wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss {
  background: transparent !important;
  color: var(--tp-notice-text) !important;
  box-shadow: none !important;
}

.wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss svg {
  fill: var(--tp-notice-text) !important;
}

/* ── Mobile ────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body .woocommerce-message.woocommerce-message,
  body .woocommerce-info.woocommerce-info,
  body .woocommerce-error.woocommerce-error,
  .wc-block-components-notice-banner {
    font-size: 0.88rem !important;
    padding-right: 14px !important;
  }

  body .woocommerce-message.woocommerce-message .button,
  body .woocommerce-info.woocommerce-info .button,
  body .woocommerce-notices-wrapper .button.wc-forward,
  .wc-block-components-notice-banner .wc-forward {
    width: 100%;
    margin: 4px 0 0 !important;
  }
}
