.cogop-toast-container {
  --cogop-toast-surface: #1b2030;
  --cogop-toast-surface-2: #161a24;
  --cogop-toast-text: #e8eaf2;
  --cogop-toast-muted: #8d98ad;
  --cogop-toast-soft: #566175;
  --cogop-toast-border: rgba(255, 255, 255, 0.14);
  --cogop-toast-accent: #4f8ef7;
  --cogop-toast-accent-2: #82b0ff;
  --cogop-toast-accent-soft: rgba(79, 142, 247, 0.12);
  --cogop-toast-accent-border: rgba(79, 142, 247, 0.26);
  --cogop-toast-green: #2ebc82;
  --cogop-toast-green-soft: rgba(46, 188, 130, 0.11);
  --cogop-toast-green-border: rgba(46, 188, 130, 0.22);
  --cogop-toast-gold: #d4942a;
  --cogop-toast-gold-soft: rgba(212, 148, 42, 0.12);
  --cogop-toast-gold-border: rgba(212, 148, 42, 0.28);
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: 360px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
  font-family: "DM Sans", "DM Sans Placeholder", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Hide only PHP-marked Add to Cart success notices before first paint.
   Critical WooCommerce errors/info notices are intentionally untouched. */
body.woocommerce-cart .woocommerce-message:has(.cogop-toast-source[data-cogop-toast-type="add-to-cart"]),
body.woocommerce-checkout .woocommerce-message:has(.cogop-toast-source[data-cogop-toast-type="add-to-cart"]),
body.single-product .woocommerce-message:has(.cogop-toast-source[data-cogop-toast-type="add-to-cart"]),
body.single-songs .woocommerce-message:has(.cogop-toast-source[data-cogop-toast-type="add-to-cart"]),
body:has(.cogop-music-library) .woocommerce-message:has(.cogop-toast-source[data-cogop-toast-type="add-to-cart"]) {
  display: none;
}

.cogop-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  overflow: hidden;
  padding: 16px;
  color: var(--cogop-toast-text);
  background: var(--cogop-toast-surface);
  border: 1px solid var(--cogop-toast-border);
  border-left: 3px solid var(--cogop-toast-green);
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 0.5px rgba(255, 255, 255, 0.04);
  pointer-events: auto;
  transform-origin: bottom right;
  animation: cogopToastIn 0.32s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.cogop-toast.is-leaving {
  animation: cogopToastOut 0.22s ease forwards;
}

.cogop-toast.is-already,
.cogop-toast.is-removed {
  border-left-color: var(--cogop-toast-gold);
}

.cogop-toast.is-error {
  border-left-color: #e05555;
}

@keyframes cogopToastIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cogopToastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
}

.cogop-toast__icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 10px;
  color: var(--cogop-toast-green);
  background: var(--cogop-toast-green-soft);
  border: 1px solid var(--cogop-toast-green-border);
}

.cogop-toast.is-already .cogop-toast__icon,
.cogop-toast.is-removed .cogop-toast__icon {
  color: var(--cogop-toast-gold);
  background: var(--cogop-toast-gold-soft);
  border-color: var(--cogop-toast-gold-border);
}

.cogop-toast.is-error .cogop-toast__icon {
  color: #e05555;
  background: rgba(224, 85, 85, 0.08);
  border-color: rgba(224, 85, 85, 0.28);
}

.cogop-toast__icon svg,
.cogop-toast__close svg {
  width: 16px;
  height: 16px;
  display: block;
}

.cogop-toast__body {
  min-width: 0;
  flex: 1;
  padding-right: 18px;
}

.cogop-toast__resource {
  margin-bottom: 2px;
  color: var(--cogop-toast-accent-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cogop-toast__title {
  margin-bottom: 3px;
  color: var(--cogop-toast-text);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}

.cogop-toast__description {
  margin-bottom: 12px;
  color: var(--cogop-toast-soft);
  font-size: 12px;
  line-height: 1.5;
}

.cogop-toast__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cogop-toast__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.cogop-toast__button--primary {
  color: #fff;
  background: var(--cogop-toast-accent);
}

.cogop-toast__button--primary:hover,
.cogop-toast__button--primary:focus-visible {
  color: #fff;
  background: #6aa0ff;
}

.cogop-toast__button--secondary {
  color: var(--cogop-toast-soft);
  background: transparent;
  border: 1px solid var(--cogop-toast-border);
}

.cogop-toast__button--secondary:hover,
.cogop-toast__button--secondary:focus-visible {
  color: var(--cogop-toast-muted);
  border-color: rgba(255, 255, 255, 0.22);
}

.cogop-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--cogop-toast-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.cogop-toast__close:hover,
.cogop-toast__close:focus-visible {
  color: var(--cogop-toast-muted);
  background: rgba(255, 255, 255, 0.08);
}

.cogop-toast__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(46, 188, 130, 0.12);
}

.cogop-toast.is-already .cogop-toast__progress,
.cogop-toast.is-removed .cogop-toast__progress {
  background: rgba(212, 148, 42, 0.14);
}

.cogop-toast.is-error .cogop-toast__progress {
  background: rgba(224, 85, 85, 0.12);
}

.cogop-toast__progress-fill {
  width: 100%;
  height: 100%;
  background: var(--cogop-toast-green);
  transform-origin: left;
}

.cogop-toast.is-already .cogop-toast__progress-fill,
.cogop-toast.is-removed .cogop-toast__progress-fill {
  background: var(--cogop-toast-gold);
}

.cogop-toast.is-error .cogop-toast__progress-fill {
  background: #e05555;
}

@media (max-width: 600px) {
  .cogop-toast-container {
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }

  .cogop-toast {
    border-radius: 16px;
  }

  .cogop-toast__actions {
    flex-direction: column;
  }

  .cogop-toast__button {
    width: 100%;
  }
}
