/* =========================================================
   Nuni — WooCommerce notice toasts
   Refined, borderless cards floating top-right. Add-to-cart
   success messages include a product thumbnail (see PHP filter
   wc_add_to_cart_message_html).

   Behaviour:
   - Wrapper is position:fixed in the top-right (or top inset on
     mobile), so a new notice never pushes page content down.
   - Each notice slides + blur-clears in (~360ms), holds ~4.5s,
     then collapses (max-height → 0) so the next notice can take
     its place without leaving a gap.
   - Three flavours: .woocommerce-message (success, with thumbnail
     when added-to-cart), .woocommerce-error, .woocommerce-info —
     differentiated by a small inset icon, not by borders.

   Edit freely — this file loads after Elementor's CSS and uses
   high-specificity selectors so it wins over WC defaults.
   ========================================================= */

.woocommerce-notices-wrapper {
  --nuni-toast-bg:        #F4ECDD;
  --nuni-toast-bg-alt:    #FBF7EE;
  --nuni-toast-ink:       #2A1F14;
  --nuni-toast-ink-2:     #4A3C2C;
  --nuni-toast-muted:     #6B5B47;
  --nuni-toast-line:      rgba(42, 31, 20, 0.06);
  --nuni-toast-success:   #8A765C;
  --nuni-toast-error:     #C44D3E;
  --nuni-toast-info:      #6B5B47;
  --nuni-toast-shadow:
    0 22px 50px -20px rgba(42, 31, 20, 0.35),
    0 6px 14px -8px rgba(42, 31, 20, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --nuni-toast-ease:      cubic-bezier(.6, .05, .2, 1);

  position: fixed !important;
  top: calc(var(--nuni-nav-h, 92px) + 16px);
  right: 24px;
  left: auto;
  width: min(440px, calc(100vw - 32px));
  margin: 0 !important;
  padding: 0 !important;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ----- Notice card -----
   No border — elevation reads through a layered, warm-tinted shadow
   plus a faint inset top highlight that gives the card a printed,
   slightly luminous feel. */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  pointer-events: auto;
  position: relative;
  margin: 0;
  padding: 16px 22px 16px 22px;
  background: var(--nuni-toast-bg, #F4ECDD);
  color: var(--nuni-toast-ink, #2A1F14);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--nuni-toast-shadow);
  font-family: var(--e-global-typography-primary-font-family, 'Inter'), system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  list-style: none;
  text-align: left;
  animation:
    nuniWcNoticeIn  380ms var(--nuni-toast-ease, ease) both,
    nuniWcNoticeOut 460ms var(--nuni-toast-ease, ease) 4.5s both;
  transform-origin: top right;
  will-change: opacity, transform, max-height;
}

/* Inline ul / li handling for multi-line errors. */
.woocommerce-error > li,
.woocommerce-message > li,
.woocommerce-info > li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.woocommerce-error > li + li,
.woocommerce-message > li + li,
.woocommerce-info > li + li {
  margin-top: 4px;
}

/* ----- Default icon column (error / info, or a fallback for messages
        that don't carry our .nuni-wc-toast wrapper). Subtle, not loud. */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  padding-left: 52px;
}
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 17px;
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.woocommerce-message::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A765C' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M8 12.5l3 3 5-6'/></svg>");
}
.woocommerce-error {
  background: var(--nuni-toast-bg-alt, #FBF7EE);
}
.woocommerce-error::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C44D3E' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 7v6M12 17h.01'/></svg>");
}
.woocommerce-info {
  background: var(--nuni-toast-bg-alt, #FBF7EE);
}
.woocommerce-info::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B5B47' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v.01M11 12h1v5h1'/></svg>");
}

/* ----- Toast layout (success messages w/ thumbnail from PHP filter) -----
   When the message HTML is wrapped in .nuni-wc-toast, suppress the
   default ::before icon (the thumbnail communicates the same thing)
   and set up a clean two-column layout. */
.woocommerce-message:has(.nuni-wc-toast) {
  padding: 14px 16px;
}
.woocommerce-message:has(.nuni-wc-toast)::before {
  display: none;
}
.nuni-wc-toast {
  display: flex;
  align-items: center;
  gap: 14px;
}
.nuni-wc-toast__thumb {
  flex: 0 0 auto;
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background-color: #D6C8B3;
  background-size: cover;
  background-position: center;
  box-shadow:
    0 4px 12px -6px rgba(42, 31, 20, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.nuni-wc-toast__body {
  flex: 1 1 0;
  min-width: 0;
  color: var(--nuni-toast-ink, #2A1F14);
  font-size: 14px;
  line-height: 1.45;
}
/* WC inserts the "View cart" anchor inline within the body. We display
   it on its own line so the message stays readable. */
.nuni-wc-toast__body > a.wc-forward,
.nuni-wc-toast__body > a.button {
  display: inline-flex;
}
.nuni-wc-toast__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ----- "View cart" / wc-forward link -----
   Demoted from button to a small uppercase link with a trailing
   arrow. Color hard-locked through every state so theme/Elementor
   blue link colors (a:visited, a:focus) can't leak in. */
.woocommerce-message .wc-forward,
.woocommerce-message a.wc-forward,
.woocommerce-message a.button,
.woocommerce-message .button.wc-forward,
.woocommerce-message .wc-forward:link,
.woocommerce-message .wc-forward:visited,
.woocommerce-message .wc-forward:focus,
.woocommerce-message .wc-forward:focus-visible,
.woocommerce-message .wc-forward:active,
.woocommerce-message a.button:link,
.woocommerce-message a.button:visited,
.woocommerce-message a.button:focus,
.woocommerce-message a.button:active {
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #8A765C !important;
  border-radius: 0 !important;
  color: #8A765C !important;
  font-family: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  text-shadow: none !important;
  transition: color 180ms var(--nuni-toast-ease, ease), border-color 180ms var(--nuni-toast-ease, ease);
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
}
.woocommerce-message .wc-forward::after,
.woocommerce-message a.button::after {
  content: "→";
  margin-left: 2px;
  font-weight: 400;
}
.woocommerce-message .wc-forward:hover,
.woocommerce-message a.button:hover {
  color: #2A1F14 !important;
  border-bottom-color: #2A1F14 !important;
}

/* Generic links inside notices (e.g. "log in" prompts) */
.woocommerce-message a:not(.wc-forward):not(.button),
.woocommerce-error a,
.woocommerce-info a {
  color: var(--nuni-toast-success, #8A765C);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 180ms var(--nuni-toast-ease, ease);
}
.woocommerce-message a:not(.wc-forward):not(.button):hover,
.woocommerce-error a:hover,
.woocommerce-info a:hover {
  color: var(--nuni-toast-ink, #2A1F14);
}

/* ----- Keyframes ----- */
@keyframes nuniWcNoticeIn {
  0% {
    opacity: 0;
    transform: translateX(28px) translateY(-4px) scale(0.985);
    filter: blur(5px);
  }
  60% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes nuniWcNoticeOut {
  0% {
    opacity: 1;
    max-height: 320px;
    margin-top: 0;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  55% {
    opacity: 0;
    transform: translateY(-10px) scale(0.99);
    max-height: 320px;
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.99);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}

/* ----- Responsive ----- */
@media (max-width: 720px) {
  .woocommerce-notices-wrapper {
    top: calc(var(--nuni-nav-h, 76px) + 12px);
    right: 12px;
    left: 12px;
    width: auto;
  }
  .woocommerce-message,
  .woocommerce-error,
  .woocommerce-info {
    padding: 14px 18px 14px 48px;
    font-size: 13.5px;
    border-radius: 12px;
  }
  .woocommerce-message::before,
  .woocommerce-error::before,
  .woocommerce-info::before {
    left: 14px;
    top: 14px;
    width: 20px;
    height: 20px;
  }
  .woocommerce-message:has(.nuni-wc-toast) {
    padding: 12px 14px;
  }
  .nuni-wc-toast__thumb {
    width: 48px;
    height: 48px;
    border-radius: 9px;
  }
  .nuni-wc-toast {
    gap: 12px;
  }
}
@media (max-width: 380px) {
  .woocommerce-notices-wrapper {
    top: calc(var(--nuni-nav-h, 64px) + 10px);
    right: 10px;
    left: 10px;
  }
  .nuni-wc-toast__thumb {
    width: 44px;
    height: 44px;
  }
}

/* ----- Suppress competing popups / banners -----
   WPC Product Bundles (woosb) renders its own confirmation popup with
   a blue chrome on add-to-cart — hide ONLY the popup variants so our
   toast is the only feedback. Do NOT hide `.woosb-wrap` here: that's
   the outer container of the bundle picker on the PDP itself, and
   hiding it makes the items list + +/- counters disappear entirely,
   leaving only a bare add-to-cart form (the bug fixed in 0.25.8). */
.woosb-popup,
.woosb-cart-popup,
.woosb-notice,
.woosb-added-popup,
.woosb-message,
.woosb-content > .woosb-message {
  display: none !important;
}
.woocommerce-notices-wrapper > *:not(.woocommerce-message):not(.woocommerce-error):not(.woocommerce-info):not(ul):not(li) {
  display: none !important;
}

/* Belt-and-suspenders: kill any top accent stripe / background that a
   theme might paint on a WC notice. We rely on the warm shadow + sand
   bg alone. */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  border-top: 0 !important;
  border-top-color: transparent !important;
  background-image: none !important;
}
.woocommerce-message::after,
.woocommerce-error::after,
.woocommerce-info::after {
  display: none !important;
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .woocommerce-message,
  .woocommerce-error,
  .woocommerce-info {
    animation:
      nuniWcNoticeFadeIn  150ms linear both,
      nuniWcNoticeFadeOut 220ms linear 4.5s both;
    transform: none !important;
    filter: none !important;
  }
}
@keyframes nuniWcNoticeFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes nuniWcNoticeFadeOut {
  0%   { opacity: 1; max-height: 320px; padding-top: 16px; padding-bottom: 16px; }
  100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
}
