/* ============================================
   Nomagri - Global Notifications & Modal System
   Premium toast + cart popup
   ============================================ */

/* ===== TOAST NOTIFICATIONS ===== */
.nomagri-toast-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.nomagri-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 340px;
    max-width: 440px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--color-primary, #2D5F2D);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.nomagri-toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.nomagri-toast--success {
    border-left-color: #16a34a;
}

.nomagri-toast--error {
    border-left-color: #dc2626;
}

.nomagri-toast--warning {
    border-left-color: #d97706;
}

.nomagri-toast--info {
    border-left-color: #2563eb;
}

.nomagri-toast__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.nomagri-toast--success .nomagri-toast__icon {
    background: #dcfce7;
    color: #16a34a;
}

.nomagri-toast--error .nomagri-toast__icon {
    background: #fee2e2;
    color: #dc2626;
}

.nomagri-toast--warning .nomagri-toast__icon {
    background: #fef3c7;
    color: #d97706;
}

.nomagri-toast--info .nomagri-toast__icon {
    background: #dbeafe;
    color: #2563eb;
}

.nomagri-toast__body {
    flex: 1;
    min-width: 0;
}

.nomagri-toast__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    line-height: 1.3;
}

.nomagri-toast__message {
    font-size: 0.8125rem;
    color: #666;
    line-height: 1.4;
}

.nomagri-toast__close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    margin: -4px -6px -4px 0;
}

.nomagri-toast__close:hover {
    background: #f3f3f3;
    color: #333;
}

/* ===== CART ADDED MODAL ===== */
.nomagri-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.25s ease;
}

.nomagri-modal-overlay.modal-exit {
    animation: modalFadeOut 0.2s ease forwards;
}

.nomagri-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    animation: modalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.nomagri-modal-overlay.modal-exit .nomagri-modal {
    animation: modalScaleOut 0.2s ease forwards;
}

.nomagri-modal__header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 24px 0;
}

.nomagri-modal__header-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    flex-shrink: 0;
}

.nomagri-modal__header-text {
    flex: 1;
}

.nomagri-modal__header-text h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.nomagri-modal__header-text p {
    font-size: 0.8125rem;
    color: #666;
    margin: 2px 0 0;
}

.nomagri-modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nomagri-modal__close:hover {
    background: #f3f3f3;
    color: #333;
}

.nomagri-modal__product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin: 16px 24px;
    background: #f9fafb;
    border-radius: 14px;
}

.nomagri-modal__product-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}

.nomagri-modal__product-info {
    flex: 1;
    min-width: 0;
}

.nomagri-modal__product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nomagri-modal__product-detail {
    font-size: 0.8125rem;
    color: #888;
}

.nomagri-modal__product-price {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-primary, #2D5F2D);
    flex-shrink: 0;
}

.nomagri-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 24px 24px;
}

.nomagri-modal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.nomagri-modal__btn--primary {
    background: var(--color-primary, #2D5F2D);
    color: #fff;
}

.nomagri-modal__btn--primary:hover {
    background: var(--color-primary-dark, #1E4620);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45, 95, 45, 0.25);
}

.nomagri-modal__btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.nomagri-modal__btn--secondary:hover {
    background: #e5e7eb;
}

/* ===== ANIMATIONS ===== */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(80px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(80px) scale(0.95);
    }
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalScaleOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .nomagri-toast-container {
        top: auto;
        bottom: 20px;
        right: 12px;
        left: 12px;
    }

    .nomagri-toast {
        min-width: auto;
        max-width: none;
    }

    .nomagri-modal {
        max-width: none;
        margin: 12px;
        border-radius: 16px;
    }

    .nomagri-modal__product {
        margin: 12px 16px;
        padding: 14px 16px;
    }

    .nomagri-modal__actions {
        padding: 0 16px 20px;
    }
}
