/* =============================================
   ALLNATURALS — INLINE STYLED MESSAGES
   Messages always visible; JS adds animation class
   ============================================= */

/* ── Always fix messages to the viewport — prevents overflow from wide
      page content (e.g. cart table) pushing them off-screen ── */
#system-messages {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  z-index: 99999 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* ── Wrapper ─────────────────────────────────── */
.messages-list { margin: 0 !important; padding: 0 !important; }
.messages__wrapper {
  padding: 12px 10px 4px !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

/* ── Base message ────────────────────────────── */
.messages-list__item.messages {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 18px 20px 18px 22px !important;
  border-radius: 14px !important;
  margin-bottom: 10px !important;
  position: relative !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  /* overflow: visible — overflow:hidden clips child outlines/rings */
  overflow: visible !important;
  border: none !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  opacity: 1;
}

/* ── Slide-in animation (added by JS) ─────────── */
@keyframes an-slide-in {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.messages-list__item.messages.an-animate {
  animation: an-slide-in 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

/* Shine sweep (added by JS) — clip-path keeps it inside the card without overflow:hidden */
@keyframes an-shine {
  from { clip-path: inset(0 100% 0 0); }
  60%  { clip-path: inset(0 0 0 0);    }
  to   { clip-path: inset(0 0 0 100%); }
}
.messages-list__item.messages.an-animate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.12) 50%, transparent 80%);
  pointer-events: none;
  animation: an-shine 0.9s ease 0.3s both;
}

/* Warning glow pulse (added by JS) */
@keyframes an-pulse-warning {
  0%,100% { box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 2px 10px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1); }
  50%     { box-shadow: 0 8px 32px rgba(245,166,35,0.4), 0 0 30px rgba(245,166,35,0.25), inset 0 1px 0 rgba(255,255,255,0.1); }
}
.messages--warning.an-animate {
  animation: an-slide-in 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) forwards,
             an-pulse-warning 2.5s ease 0.9s 2;
}

/* Error shake (added by JS) */
@keyframes an-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-7px); }
  30%  { transform: translateX(6px); }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.messages--error.an-animate {
  animation: an-slide-in 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) forwards,
             an-shake 0.55s ease 0.55s both;
}

/* Dismiss slide-out */
@keyframes an-slide-out {
  0%   { transform: translateX(0);    opacity: 1; max-height: 200px; margin-bottom: 10px; padding-top: 18px; padding-bottom: 18px; }
  50%  { transform: translateX(50px); opacity: 0; }
  100% { transform: translateX(70px); opacity: 0; max-height: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
}
.messages-list__item.messages.an-dismissing {
  animation: an-slide-out 0.38s ease forwards !important;
  pointer-events: none;
}

/* ── STATUS — deep forest green ──────────────── */
.messages--status {
  background: linear-gradient(135deg, #082516 0%, #0f4028 60%, #166234 100%) !important;
  color: #c3f7d4 !important;
  border-left: 5px solid #34d870 !important;
}
.messages--status .an-msg-icon {
  background: radial-gradient(circle, #34d870, #1db954);
  color: #051a0e;
  box-shadow: 0 0 14px rgba(52, 216, 112, 0.5);
}
.messages--status a { color: #7fffa8 !important; }
/* .page-wrapper a:hover in solo-subtheme-style.css sets purple with !important;
   adding .page-wrapper in the selector gives us higher specificity to override it. */
.page-wrapper .messages--status a:hover,
.messages--status a:hover { color: #ffffff !important; text-decoration: underline !important; }

/* ── "Your cart" link — 3D raised pill button with flash ── */
@keyframes cart-link-flash {
  0%, 100% {
    background: linear-gradient(180deg, #5de88a 0%, #28c76f 45%, #1fa05a 100%);
  }
  50% {
    background: linear-gradient(180deg, #82f5a8 0%, #3ee882 45%, #28c76f 100%);
  }
}
.messages--status a[href*="/cart"],
.messages--status a[href*="cart"] {
  display: inline-block !important;
  padding: 5px 16px 6px !important;
  border-radius: 30px !important;
  font-weight: 700 !important;
  font-size: 1.05em !important;
  text-decoration: none !important;
  letter-spacing: 0.4px;
  vertical-align: middle;
  /* 3D raised effect — no box-shadow glow, just the border-bottom depth */
  background: linear-gradient(180deg, #5de88a 0%, #28c76f 45%, #1fa05a 100%) !important;
  color: #042e14 !important;
  border: none !important;
  border-bottom: 3px solid #0a5228 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  animation: cart-link-flash 1.1s ease-in-out 4 !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
}
.messages--status a[href*="/cart"]::before,
.messages--status a[href*="cart"]::before {
  content: '🛒\00A0';
  text-shadow: 0 0 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.6);
}
.messages--status a[href*="/cart"]:hover,
.messages--status a[href*="cart"]:hover {
  animation: none !important;
  background: linear-gradient(180deg, #82f5a8 0%, #3ee882 45%, #28c76f 100%) !important;
  color: #031f0e !important;
  border-bottom-color: #073d1e !important;
  transform: translateY(-1px);
  text-decoration: none !important;
}
.messages--status a[href*="/cart"]:active,
.messages--status a[href*="cart"]:active {
  transform: translateY(2px) !important;
  border-bottom-width: 1px !important;
}

/* ── WARNING — deep amber ────────────────────── */
.messages--warning {
  background: linear-gradient(135deg, #1e0d00 0%, #4a2200 60%, #6b3300 100%) !important;
  color: #ffe8a0 !important;
  border-left: 5px solid #f5a623 !important;
}
.messages--warning .an-msg-icon {
  background: radial-gradient(circle, #f5a623, #d4880e);
  color: #1e0d00;
  box-shadow: 0 0 14px rgba(245, 166, 35, 0.5);
}
.messages--warning a { color: #ffd066 !important; }

/* ── ERROR — deep crimson ────────────────────── */
.messages--error {
  background: linear-gradient(135deg, #1c0004 0%, #4a000e 60%, #7a0018 100%) !important;
  color: #ffb0be !important;
  border-left: 5px solid #ff2244 !important;
}
.messages--error .an-msg-icon {
  background: radial-gradient(circle, #ff2244, #cc0033);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 34, 68, 0.55);
}
.messages--error a { color: #ff8fa3 !important; }
.messages--error a[href*="/cart"],
.messages--error a[href*="cart"] {
  display: inline-block !important;
  padding: 5px 16px 6px !important;
  border-radius: 30px !important;
  font-weight: 700 !important;
  font-size: 1.05em !important;
  text-decoration: none !important;
  letter-spacing: 0.4px;
  vertical-align: middle;
  background: linear-gradient(180deg, #5de88a 0%, #28c76f 45%, #1fa05a 100%) !important;
  color: #042e14 !important;
  border: none !important;
  border-bottom: 3px solid #0a5228 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  transition: all 0.15s ease !important;
  cursor: pointer !important;
}
.messages--error a[href*="/cart"]::before,
.messages--error a[href*="cart"]::before {
  content: '🛒\00A0';
  text-shadow: 0 0 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.6);
}
.messages--error a[href*="/cart"]:hover,
.messages--error a[href*="cart"]:hover {
  background: linear-gradient(180deg, #82f5a8 0%, #3ee882 45%, #28c76f 100%) !important;
  color: #031f0e !important;
  border-bottom-color: #073d1e !important;
  transform: translateY(-1px);
  text-decoration: none !important;
}
.messages--error a[href*="/cart"]:active,
.messages--error a[href*="cart"]:active {
  transform: translateY(2px) !important;
  border-bottom-width: 1px !important;
}

/* ── INFO — deep navy ────────────────────────── */
.messages--info {
  background: linear-gradient(135deg, #00102e 0%, #002060 60%, #003494 100%) !important;
  color: #a8d4ff !important;
  border-left: 5px solid #4fa6ff !important;
}
.messages--info .an-msg-icon {
  background: radial-gradient(circle, #4fa6ff, #1a7de0);
  color: #00102e;
  box-shadow: 0 0 14px rgba(79, 166, 255, 0.5);
}
.messages--info a { color: #8ecfff !important; }

/* ── Icon circle ─────────────────────────────── */
.an-msg-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  margin-top: 1px;
  position: relative;
  z-index: 2;
}

/* Hide the original Solo icon/header */
.messages__header { display: none !important; }

/* ── Type label ──────────────────────────────── */
.an-msg-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 4px;
}

/* ── Content ─────────────────────────────────── */
.messages__container {
  display: contents !important;
}
.messages__content {
  flex: 1 !important;
  font-size: 0.97rem !important;
  line-height: 1.55 !important;
  color: inherit !important;
  padding-top: 6px !important;
  position: relative;
  z-index: 2;
  min-width: 0;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}
.messages__content ul  { margin: 4px 0 0 0; padding-left: 18px; }
.messages__content li  { margin-bottom: 3px; }


/* ── Mobile ──────────────────────────────────── */
@media (max-width: 600px) {
  .messages-list__item.messages {
    padding: 14px 14px 14px 16px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }
}

/* ── Mobile: tighter padding and shadow ─────────────────────── */
@media (max-width: 768px) {
  .messages-list__item.messages {
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.45),
      0 2px 8px rgba(0, 0, 0, 0.25) !important;
  }
}
