/* ==========================================================================
   Velgrina — Toast Messages (success / error / notice / warning)
   ========================================================================== */

/* ---------- Container ---------- */
.velgrina-messages {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 640px) {
    .velgrina-messages {
        left: auto;
        width: 420px;
    }
}

@media (min-width: 1024px) {
    .velgrina-messages {
        top: 20px;
        right: 24px;
        width: 440px;
    }
}

/* Hide page-level message container space */
#messages:not(:has(.velgrina-message)) {
    display: none;
}

#messages {
    position: static;
    min-height: 0;
}

/* ---------- Single message ---------- */
.velgrina-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-left: 4px solid transparent;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
    pointer-events: auto;
    animation: velgrina-toast-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

/* Type variants */
.velgrina-message--success {
    border-left-color: #16a34a;
}

.velgrina-message--error {
    border-left-color: #dc2626;
}

.velgrina-message--notice,
.velgrina-message--warning {
    border-left-color: #f59e0b;
}

/* ---------- Body (icon + text) ---------- */
.velgrina-message__body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Icon */
.velgrina-message__icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 1px;
}

.velgrina-message--success .velgrina-message__icon {
    color: #16a34a;
}

.velgrina-message--error .velgrina-message__icon {
    color: #dc2626;
}

.velgrina-message--notice .velgrina-message__icon,
.velgrina-message--warning .velgrina-message__icon {
    color: #f59e0b;
}

/* Text */
.velgrina-message__text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1E2022;
    word-break: break-word;
}

.velgrina-message__text a {
    color: #2E7D8C;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.velgrina-message__text a:hover {
    color: #246876;
}

/* ---------- Actions (cart button + close) ---------- */
.velgrina-message__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Cart button (success only) */
.velgrina-message__cart-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #2E7D8C;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.velgrina-message__cart-btn:hover {
    background: #246876;
}

/* Close button */
.velgrina-message__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
    border-radius: 4px;
}

.velgrina-message__close:hover {
    color: #1E2022;
    background: #F4F5F4;
}

.velgrina-message__close svg {
    width: 20px;
    height: 20px;
}

/* ---------- Slide-in animation ---------- */
@keyframes velgrina-toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
