/* =========================================================
   M-CODE Sales Notification – Frontend Popup CSS
   Glassmorphism • Premium Modern UI
   ========================================================= */
.mcode-sn-popup-container {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
}
.mcode-sn-popup-container.pos-bottom-left  { bottom: 24px; left: 24px; }
.mcode-sn-popup-container.pos-bottom-right { bottom: 24px; right: 24px; }
.mcode-sn-popup-container.pos-top-left     { top: 24px;    left: 24px; }
.mcode-sn-popup-container.pos-top-right    { top: 24px;    right: 24px; }

/* ---- Popup Card ---- */
.mcode-sn-popup {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  width: 320px;
  max-width: calc(100vw - 48px);

  /* Glassmorphism */
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(79,70,229,.12),
    0 2px 8px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,.8);

  /* Animation states */
  opacity: 0;
  transform: translateY(16px) scale(.96);
  transition: opacity .35s cubic-bezier(.34,1.56,.64,1), transform .35s cubic-bezier(.34,1.56,.64,1);
  will-change: transform, opacity;
  position: relative;
}

/* Top-position popups slide down */
.mcode-sn-popup-container.pos-top-left .mcode-sn-popup,
.mcode-sn-popup-container.pos-top-right .mcode-sn-popup {
  transform: translateY(-16px) scale(.96);
}

.mcode-sn-popup.mcode-popup-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mcode-sn-popup.mcode-popup-hiding {
  opacity: 0;
  transform: translateY(8px) scale(.95);
  transition: opacity .25s ease, transform .25s ease;
}

/* ---- Product Image ---- */
.mcode-sn-popup-img {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(79,70,229,.15);
  background: #f3f4f6;
}

/* ---- Content ---- */
.mcode-sn-popup-body { flex: 1; min-width: 0; }

.mcode-sn-popup-msg {
  font-size: 13px;
  line-height: 1.55;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0 0 5px;
}

.mcode-sn-popup-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mcode-sn-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 20px;
}
.mcode-sn-verified::before {
  content: '✓';
  font-size: 10px;
  font-weight: 700;
}

.mcode-sn-time {
  font-size: 11px;
  color: #9ca3af;
}

/* ---- Close Button ---- */
.mcode-sn-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(107,114,128,.12);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background .2s, color .2s;
}
.mcode-sn-close:hover {
  background: rgba(107,114,128,.25);
  color: #374151;
}

/* ---- Accent stripe ---- */
.mcode-sn-popup::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: linear-gradient(180deg, #4f46e5, #7c3aed);
  border-radius: 0 3px 3px 0;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
  .mcode-sn-popup-container.pos-bottom-left,
  .mcode-sn-popup-container.pos-bottom-right { left: 12px; right: 12px; bottom: 16px; }
  .mcode-sn-popup-container.pos-top-left,
  .mcode-sn-popup-container.pos-top-right    { left: 12px; right: 12px; top: 16px; }
  .mcode-sn-popup { width: 100%; max-width: 100%; }
}
