/**
 * plg_system_vmactivity – popup styles
 * Override the custom properties in your template CSS to match the shop, e.g.
 *   .vma-root { --vma-accent: #c2410c; --vma-radius: 6px; }
 */
.vma-root {
  --vma-bg: #ffffff;
  --vma-fg: #1c1d21;
  --vma-muted: #6a6c75;
  --vma-border: rgba(20, 22, 30, 0.09);
  --vma-cart: #15803d;
  --vma-view: #1d4ed8;
  --vma-radius: 14px;
  --vma-shadow: 0 12px 32px rgba(20, 22, 30, 0.14), 0 2px 6px rgba(20, 22, 30, 0.06);

  position: fixed;
  bottom: 16px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 340px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}
.vma-root.vma-left { left: 16px; }
.vma-root.vma-right { right: 16px; }

.vma-root .vma-toast,
.vma-root .vma-toast * { box-sizing: border-box; }

.vma-root .vma-toast {
  position: relative;
  pointer-events: auto;
  margin: 0;
  padding: 12px 36px 12px 12px;
  background: var(--vma-bg);
  color: var(--vma-fg);
  border: 1px solid var(--vma-border);
  border-radius: var(--vma-radius);
  box-shadow: var(--vma-shadow);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.vma-root .vma-toast.vma-in { opacity: 1; transform: none; }
.vma-root .vma-toast.vma-out { opacity: 0; transform: translateY(8px); }

/* Templates often style every link; the popup keeps its own look. */
.vma-root a.vma-link,
.vma-root a.vma-link:hover,
.vma-root a.vma-link:focus {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit !important;
  text-decoration: none !important;
  background: none;
  border: 0;
  outline-offset: 3px;
}

.vma-root .vma-media {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: calc(var(--vma-radius) - 4px);
  background: #f1f2f5;
}
.vma-root .vma-img {
  display: block;
  width: 56px;
  height: 56px;
  max-width: none;
  margin: 0;
  object-fit: cover;
  border: 0;
  border-radius: inherit;
}
.vma-root .vma-media.vma-noimg::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 6px;
  background: rgba(20, 22, 30, 0.08);
}

.vma-root .vma-badge {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--vma-bg);
  background: var(--vma-view);
  color: #fff;
}
.vma-root .vma-type-cart .vma-badge { background: var(--vma-cart); }
.vma-root .vma-badge svg { display: block; width: 12px; height: 12px; }

.vma-root .vma-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vma-root .vma-line { color: var(--vma-muted); font-size: 13px; }
.vma-root .vma-line strong { color: var(--vma-fg); font-weight: 600; }
.vma-root .vma-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--vma-fg);
  font-weight: 600;
  font-size: 14px;
}
.vma-root a.vma-link:hover .vma-name { text-decoration: underline !important; text-underline-offset: 2px; }
.vma-root .vma-meta { color: var(--vma-muted); font-size: 12px; padding-right: 92px; }

.vma-root .vma-close {
  all: unset;
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--vma-muted);
  cursor: pointer;
}
.vma-root .vma-close svg { width: 16px; height: 16px; display: block; }
.vma-root .vma-close:hover { background: rgba(20, 22, 30, 0.06); color: var(--vma-fg); }
.vma-root .vma-close:focus-visible { outline: 2px solid var(--vma-view); outline-offset: 1px; }

.vma-root a.vma-attr,
.vma-root a.vma-attr:hover {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-size: 10px;
  line-height: 1;
  color: var(--vma-muted) !important;
  opacity: 0.75;
  text-decoration: none !important;
  background: none;
}
.vma-root a.vma-attr:hover { opacity: 1; text-decoration: underline !important; }

@media (max-width: 640px) {
  .vma-root,
  .vma-root.vma-left,
  .vma-root.vma-right {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
  }
  .vma-root .vma-toast { padding: 10px 34px 10px 10px; }
  .vma-root .vma-media,
  .vma-root .vma-img { flex-basis: 48px; width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .vma-root .vma-toast,
  .vma-root .vma-toast.vma-out { transform: none; transition: opacity 0.2s linear; }
}

@media print {
  .vma-root { display: none !important; }
}
