/* ============================================================
   PD TOAST — Branded notification with circular logo + badge
   ============================================================ */
.pd-toast-stack {
    position: fixed;
    z-index: 10100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    pointer-events: none;
    max-width: min(380px, calc(100vw - 32px));
}

/* Position variants (driven by data-position) */
.pd-toast-stack[data-position="top-right"]     { top: 0; right: 0; align-items: flex-end; }
.pd-toast-stack[data-position="top-left"]      { top: 0; left: 0;  align-items: flex-start; }
.pd-toast-stack[data-position="bottom-right"]  { bottom: 0; right: 0; align-items: flex-end; flex-direction: column-reverse; }
.pd-toast-stack[data-position="bottom-left"]   { bottom: 0; left: 0;  align-items: flex-start; flex-direction: column-reverse; }
.pd-toast-stack[data-position="top-center"]    { top: 0; left: 50%; transform: translateX(-50%); align-items: center; }
.pd-toast-stack[data-position="bottom-center"] { bottom: 0; left: 50%; transform: translateX(-50%); align-items: center; flex-direction: column-reverse; }

/* Toast card */
.pd-toast {
    --pd-toast-accent: #16a34a;
    --pd-toast-duration: 4000ms;
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 360px;
    max-width: 100%;
    padding: 14px 16px 14px 14px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 12px 30px -8px rgba(15, 23, 42, 0.18),
        0 4px 10px -4px rgba(15, 23, 42, 0.10),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    animation: pdToastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    border-left: 4px solid var(--pd-toast-accent);
}

/* Circular logo + status badge */
.pd-toast__logo {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.06),
        0 2px 6px rgba(15, 23, 42, 0.06);
}

.pd-toast__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.pd-toast__badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--pd-toast-accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

/* Body */
.pd-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pd-toast__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--pd-toast-accent);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.pd-toast__msg {
    font-size: 13.5px;
    line-height: 1.45;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Close button */
.pd-toast__close {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s ease, color 0.15s ease;
}

.pd-toast__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #1f2937;
}

/* Progress bar */
.pd-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--pd-toast-accent);
    transform-origin: left center;
    animation: pdToastProgress var(--pd-toast-duration) linear forwards;
    opacity: 0.85;
}

.pd-toast--paused .pd-toast__progress {
    animation-play-state: paused;
}

/* Leaving animation */
.pd-toast--leaving {
    animation: pdToastOut 0.32s ease forwards;
}

/* Animations */
@keyframes pdToastIn {
    from { transform: translateY(8px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

@keyframes pdToastOut {
    to { transform: translateY(8px) scale(0.96); opacity: 0; }
}

@keyframes pdToastProgress {
    to { transform: scaleX(0); }
}

/* Mobile: full-width, bottom-pinned */
@media (max-width: 480px) {
    .pd-toast-stack {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        transform: none !important;
        max-width: 100vw;
        align-items: stretch !important;
        flex-direction: column-reverse !important;
        padding: 12px;
    }
    .pd-toast {
        width: 100%;
    }
}
