/*
 * Shared toast notifications (Toastr). Presentation only: behaviour (close button, timeouts,
 * duplicate prevention, hover pause) is configured in public/js/common.js.
 * Loaded by the core and PosCustom CSS partials, so every screen gets the same look.
 */
#toast-container {
    --toast-success: #1b7f46;
    --toast-error: #c4161c;
    --toast-warning: #b26a00;
    --toast-info: #1f5fbf;
    pointer-events: none; /* the container never blocks the screen; only the toasts react */
}

#toast-container > div {
    pointer-events: auto;
    position: relative;
    width: 360px;
    max-width: calc(100vw - 24px);
    padding: 14px 44px 14px 52px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    background-image: none !important; /* replace the stock PNG icons */
    opacity: 0.97;
    font-size: 14px;
    line-height: 1.5;
    color: #fff;
}

#toast-container > div:hover {
    opacity: 1;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

#toast-container > .toast-success { background-color: var(--toast-success); }
#toast-container > .toast-error { background-color: var(--toast-error); }
#toast-container > .toast-warning { background-color: var(--toast-warning); }
#toast-container > .toast-info { background-color: var(--toast-info); }

/* One icon per type (glyphs, no image files) */
#toast-container > div::before {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    line-height: 28px;
}
#toast-container > .toast-success::before { content: "\2713"; }
#toast-container > .toast-error::before { content: "\2715"; }
#toast-container > .toast-warning::before { content: "!"; }
#toast-container > .toast-info::before { content: "i"; font-style: italic; }

/* Close button: large enough to hit on touch screens */
#toast-container > div .toast-close-button {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    opacity: 0.85;
    text-shadow: none;
    cursor: pointer;
}
#toast-container > div .toast-close-button:hover,
#toast-container > div .toast-close-button:focus {
    background: rgba(255, 255, 255, 0.22);
    opacity: 1;
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

/* Arabic / RTL: icon and close button mirror to the other side */
#toast-container.rtl > div,
#toast-container > div.rtl {
    padding: 14px 52px 14px 44px;
    direction: rtl;
    text-align: right;
}
#toast-container.rtl > div::before,
#toast-container > div.rtl::before { left: auto; right: 14px; }
#toast-container.rtl > div .toast-close-button,
#toast-container > div.rtl .toast-close-button { right: auto; left: 8px; }

/* Phones: full width, below the status bar, thumb sized close button */
@media (max-width: 575px) {
    #toast-container.toast-top-right,
    #toast-container.toast-top-left,
    #toast-container.toast-top-center {
        left: 12px;
        right: 12px;
        top: 8px;
    }
    #toast-container > div { width: 100%; max-width: none; margin-bottom: 8px; }
    #toast-container > div .toast-close-button { width: 40px; height: 40px; line-height: 40px; top: 2px; }
}

@media print {
    #toast-container { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    #toast-container > div { transition: none !important; animation: none !important; }
}
