/**
 * Vyskakovací hlášky (assets/js/notices.js) – nahoře vpravo pod hlavičkou, na mobilu přes šířku.
 */

.ed-toasts {
    position: fixed;
    top: calc(var(--ed-masthead-h, 121px) + var(--wp-admin--admin-bar--height, 0px) + 12px);
    right: 16px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.ed-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 14px 14px;
    background: var(--ed-surface, #fff);
    border: 1px solid var(--ed-line, #e5e7eb);
    border-left: 4px solid var(--ed-brand, #3BC1F4);
    border-radius: var(--ed-radius, 12px);
    box-shadow: 0 12px 32px rgba(17, 24, 39, .14);
    color: var(--ed-text, #111827);
    font-family: var(--ed-font, "Segoe UI", system-ui, sans-serif);
    font-size: 14px;
    line-height: 1.45;
    pointer-events: auto;
    animation: ed-toast-in .22s ease-out;
}

.ed-toast.is-leaving { animation: ed-toast-out .22s ease-in forwards; }

.ed-toast--success { border-left-color: var(--ed-success, #059669); }
.ed-toast--error { border-left-color: var(--ed-danger, #dc2626); }

.ed-toast__icon {
    flex: 0 0 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--ed-brand-soft, #e8f8fe) center / 14px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a6a90' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 11v6M12 7h.01'/%3E%3C/svg%3E");
}

.ed-toast--success .ed-toast__icon {
    background-color: var(--ed-success-soft, #ecfdf5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}

.ed-toast--error .ed-toast__icon {
    background-color: #fef2f2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E");
}

.ed-toast__body { flex: 1 1 auto; min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
.ed-toast__body a { color: var(--ed-brand-ink, #0a6a90); font-weight: 700; }

/* Odkaz „Zobrazit košík" z hlášky WooCommerce jako malé tlačítko pod textem. */
.ed-toast__body a.button,
.ed-toast__body a.wc-forward {
    float: none;
    display: inline-flex;
    margin: 0 8px 0 0;
    padding: 4px 12px;
    border-radius: var(--ed-pill, 50px);
    background: var(--ed-brand-soft, #e8f8fe);
    color: var(--ed-brand-ink, #0a6a90);
    font-size: 13px;
    text-decoration: none;
}

.ed-toast__close {
    appearance: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 0;
    height: 28px;
    min-height: 0;
    margin: -2px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--ed-muted, #6b7280);
    line-height: 0;
    cursor: pointer;
}

.ed-toast__close:hover { background: var(--ed-surface-2, #f3f4f6); color: var(--ed-text, #111827); }
.ed-toast__close:focus-visible { outline: 2px solid var(--ed-brand, #3BC1F4); outline-offset: 2px; }

@media (max-width: 600px) {
    .ed-toasts { right: 12px; left: 12px; width: auto; }
}

@keyframes ed-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes ed-toast-out { to { opacity: 0; transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
    .ed-toast, .ed-toast.is-leaving { animation: none; }
}
