/* =======================================================================
   eBuy UI Overlays — Toast Stack + Confirm Dialog
   ======================================================================= */

/* -----------------------------------------------------------------------
   Toast Container
   ----------------------------------------------------------------------- */
#eb-toast-container {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: var(--eb-z-modal);
    pointer-events: none;
    max-width: min(520px, calc(100vw - 2.5rem));
}

/* Phones: full width, above the tab bar. */
@media (max-width: 767.98px) {
    #eb-toast-container {
        left: 8px;
        right: 8px;
        bottom: calc(var(--eb-tabbar-height, 0px) + 8px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    #eb-toast-container .eb-toast {
        width: 100%;
    }
}

/* -----------------------------------------------------------------------
   Toast (board: Components, feedback and status)
   ----------------------------------------------------------------------- */
.eb-toast {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 8px 0 16px;
    border-radius: var(--eb-radius-0);
    background: var(--eb-gray-900);
    color: var(--eb-white);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: var(--eb-shadow-soft-toast);
    pointer-events: all;
    opacity: 0;
    transform: translateY(0.75rem);
    transition:
        opacity var(--eb-duration-base) var(--eb-ease-standard),
        transform var(--eb-duration-base) var(--eb-ease-decelerate);
}

.eb-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .eb-toast { transition: none; transform: none; }
}

/* Error and warning keep a tint until their pages move to x-alert. */
.eb-toast--error {
    background: var(--eb-danger-50);
    color: var(--eb-danger-700);
    border: 1px solid var(--eb-danger-200);
}
.eb-toast--warning {
    background: var(--eb-warning-50);
    color: var(--eb-warning-700);
    border: 1px solid var(--eb-warning-200);
}

.eb-toast__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.eb-toast__msg {
    flex: 1;
    padding: 12px 0;
}

.eb-toast__action {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--eb-primary-300);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.eb-toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--eb-gray-300);
    cursor: pointer;
}

.eb-toast--error .eb-toast__close,
.eb-toast--warning .eb-toast__close {
    color: inherit;
}

/* -----------------------------------------------------------------------
   Confirm Dialog Overlay
   ----------------------------------------------------------------------- */
#eb-confirm-overlay {
    position: fixed;
    inset: 0;
    background: var(--eb-gray-900-45);
    z-index: var(--eb-z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity var(--eb-duration-base) var(--eb-ease-standard);
}

#eb-confirm-overlay.eb-confirm--visible {
    opacity: 1;
    pointer-events: all;
}

#eb-confirm-dialog {
    background: var(--eb-white);
    border-radius: var(--eb-radius-0);
    padding: 1.5rem 1.5rem 1.25rem;
    max-width: 360px;
    width: calc(100vw - 2rem);
    box-shadow: var(--eb-shadow-soft-modal);

    transform: scale(0.94) translateY(0.5rem);
    transition: transform var(--eb-duration-slow) var(--eb-ease-decelerate);
}

#eb-confirm-dialog.eb-confirm__dialog--in {
    transform: scale(1) translateY(0);
}

.eb-confirm__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--eb-gray-900);
    margin: 0 0 0.35rem;
}

.eb-confirm__msg {
    font-size: 0.84rem;
    color: var(--eb-gray-500);
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.eb-confirm__msg:empty {
    display: none;
}

.eb-confirm__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
