/* ------------------------------------------------------------------ *
 * Toast notifications.
 *
 * Success messages used to be a green bar that pushed the page down and
 * stayed until the next navigation, so a customer who had just signed in
 * kept being told they had signed in. These sit over the page instead of
 * in it, and take themselves down after a few seconds.
 *
 * A file of its own rather than part of nx.css because the storefront and
 * the staff dashboard load different stylesheets and both need these.
 * Every custom property therefore carries a literal fallback: the tokens
 * are defined in nx.css, which the dashboard does not load.
 *
 * The base `.message` rules still apply until nx-toast.js moves the
 * element into .toast-stack, so with scripting off the text stays a
 * normal message in the page and nothing is lost.
 * ------------------------------------------------------------------ */

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1080; /* above the dashboard's fixed sidebar and Bootstrap modals */
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
  pointer-events: none;
}

.toast-stack .toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(1, 171, 157, 0.35);
  border-left: 4px solid var(--c-p1, #01ab9d);
  border-radius: var(--radius-sm, 12px);
  background: #fff;
  color: var(--c-n4, #10211f);
  box-shadow: var(--shadow, 0 12px 40px rgba(16, 33, 31, 0.18));
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-stack .toast.is-visible { opacity: 1; transform: translateX(0); }
.toast-stack .toast.is-leaving { opacity: 0; transform: translateX(16px); }

.toast-icon { flex: 0 0 auto; margin-top: 1px; color: var(--c-p1, #01ab9d); }
.toast-message { flex: 1 1 auto; }

.toast-close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 20px;
  line-height: 1;
  color: var(--c-muted, #4a5b58);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.toast-close:hover, .toast-close:focus-visible { opacity: 1; }

/* Until the script lifts it out, the close button would do nothing. */
.toast:not(.is-visible):not(.is-leaving) .toast-close { display: none; }

@media (max-width: 640px) {
  .toast-stack { top: auto; bottom: 14px; right: 14px; left: 14px; width: auto; }
  .toast-stack .toast { transform: translateY(16px); }
  .toast-stack .toast.is-visible { transform: translateY(0); }
  .toast-stack .toast.is-leaving { transform: translateY(16px); }
}

@media (prefers-reduced-motion: reduce) {
  .toast-stack .toast { transition: opacity 0.2s ease; transform: none; }
  .toast-stack .toast.is-visible,
  .toast-stack .toast.is-leaving { transform: none; }
}

/* ------------------------------------------------------------------ *
 * Upload problem panel.
 *
 * Shown next to a file input when the chosen file is the wrong type or
 * over the limit, offering the two ways out: pick another file, or give
 * up and go back. Lives here rather than in nx.css because the artwork
 * form also renders inside the dashboard's stylesheet context.
 * ------------------------------------------------------------------ */
.upload-problem {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(155, 28, 28, 0.35);
  border-left: 4px solid var(--c-error, #9b1c1c);
  border-radius: var(--radius-sm, 12px);
  background: #fdecea;
  color: var(--c-error, #9b1c1c);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
.upload-problem.is-open { display: block; }
.upload-problem-text { margin: 0 0 10px; }
.upload-problem-actions { display: flex; flex-wrap: wrap; gap: 8px; }
