/* ════════════════════════════════════════════════════════
   Toast notifications
   Always-visible, fixed-position notification stack rendered
   by <ToastContainer /> in MainLayout and AdminLayout.

   Rules:
     - Top-right, fixed positioning so toasts never get lost
       below the fold.
     - High z-index — must clear modals, drawers, and the
       admin sidebar.
     - Token-driven colors — works on both the storefront
       (--color-*) and admin (--adm-*) shells via per-shell
       overrides at the bottom of this file.
   ════════════════════════════════════════════════════════ */

.picklly-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    z-index: 9999;
    pointer-events: none; /* clicks pass through gaps; toasts re-enable below */
    max-width: min(420px, calc(100vw - 2rem));
    width: 100%;
}

.picklly-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #1a1a1a);
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.1));
    border-left-width: 4px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
    font-size: 0.9rem;
    line-height: 1.35;
    animation: picklly-toast-in 0.18s ease-out;
}

@keyframes picklly-toast-in {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.picklly-toast-icon {
    width: 1.4rem;
    height: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 1px;
}

.picklly-toast-message {
    word-break: break-word;
    align-self: center;
}

.picklly-toast-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted, #666);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    flex-shrink: 0;
    margin-top: -2px;
    transition: color 0.12s;
}

.picklly-toast-close:hover {
    color: var(--color-text, #1a1a1a);
}

/* ── Per-level accents.
   Hard-coded greens/reds/ambers/blues — these are semantic
   status colors, not brand colors, and need to read
   consistently across all themes regardless of palette. */

.picklly-toast-success {
    border-left-color: #22c55e;
}
.picklly-toast-success .picklly-toast-icon {
    background: #22c55e;
}

.picklly-toast-error {
    border-left-color: #ef4444;
}
.picklly-toast-error .picklly-toast-icon {
    background: #ef4444;
}

.picklly-toast-warning {
    border-left-color: #f59e0b;
}
.picklly-toast-warning .picklly-toast-icon {
    background: #f59e0b;
}

.picklly-toast-info {
    border-left-color: #3b82f6;
}
.picklly-toast-info .picklly-toast-icon {
    background: #3b82f6;
}

/* ── Admin shell override.
   Admin pages don't use --color-* tokens; they use --adm-*.
   Scope the surface vars when this stack lives inside the
   admin shell so toasts match the dark admin aesthetic. */

.admin-shell .picklly-toast {
    background: var(--adm-surface, #1f2230);
    color: var(--adm-text, #e4e6f0);
    border-color: var(--adm-border, rgba(255, 255, 255, 0.1));
}

.admin-shell .picklly-toast-close {
    color: var(--adm-text-muted, #9ca3af);
}

.admin-shell .picklly-toast-close:hover {
    color: var(--adm-text, #e4e6f0);
}

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
    .picklly-toast-stack {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}
