/* ==========================================================================
   M4H FAST AJAX CART & HIGH-AESTHETICS TOAST NOTIFICATION SYSTEM 2026
   ========================================================================== */

/* 1. BUTTON LOADING & DISABLED STATES */
.m4h-btn-processing {
    position: relative !important;
    opacity: 0.85 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.m4h-spinner-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: m4h-spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes m4h-spin {
    to { transform: rotate(360deg); }
}

/* 2. TOAST CONTAINER (GÓC DƯỚI BÊN PHẢI MÀN HÌNH) */
#m4h-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100vw - 32px);
}

/* 3. TOAST CARD DESIGN */
.m4h-toast-card {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    padding: 16px;
    overflow: hidden;
    position: relative;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(120%);
    opacity: 0;
}

.m4h-toast-card.m4h-toast-active {
    transform: translateX(0);
    opacity: 1;
}

.m4h-toast-card.m4h-toast-exit {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Header */
.m4h-toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
}

.m4h-toast-check {
    width: 20px;
    height: 20px;
    background: #22c55e;
    color: #ffffff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.m4h-toast-header-text {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    flex: 1;
}

.m4h-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.m4h-toast-close:hover {
    color: #0f172a;
}

/* Toast Body */
.m4h-toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.m4h-toast-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.m4h-toast-info {
    flex: 1;
    min-width: 0;
}

.m4h-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 3px 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m4h-toast-price {
    font-size: 13px;
    font-weight: 800;
    color: #d9261c;
}

/* Toast Footer Action Buttons */
.m4h-toast-footer {
    display: flex;
    gap: 8px;
}

.m4h-toast-btn {
    flex: 1;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    border-radius: 8px;
    text-decoration: none !important;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.m4h-toast-btn.btn-cart {
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.m4h-toast-btn.btn-cart:hover {
    background: #e2e8f0;
}

.m4h-toast-btn.btn-checkout {
    background: linear-gradient(135deg, #ea3829 0%, #d9261c 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(217, 38, 28, 0.3);
}

.m4h-toast-btn.btn-checkout:hover {
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

/* Progress Bar Timer */
.m4h-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    width: 100%;
    animation: toast-timer 4.5s linear forwards;
}

@keyframes toast-timer {
    from { width: 100%; }
    to { width: 0%; }
}

@media screen and (max-width: 550px) {
    #m4h-toast-container {
        bottom: 75px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}
