/* ==========================================================================
   TechStore - Notistack Notification Component Stylesheet
   Mô phỏng 100% giao diện Material Snackbar & hiệu ứng Stacking của Notistack
   Kế thừa toàn bộ design tokens từ theme.css
   ========================================================================== */

/* 1. CONTAINERS THEO TỪNG VỊ TRÍ */
.notistack-container {
    position: fixed;
    z-index: 99999;
    display: flex;
    pointer-events: none;
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    padding: 0;
    margin: 0;
    list-style: none;
}

.notistack-container--top-right {
    top: 20px;
    right: 20px;
    flex-direction: column;
    align-items: flex-end;
}

.notistack-container--top-left {
    top: 20px;
    left: 20px;
    flex-direction: column;
    align-items: flex-start;
}

.notistack-container--top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
    align-items: center;
}

.notistack-container--bottom-right {
    bottom: 20px;
    right: 20px;
    flex-direction: column-reverse;
    align-items: flex-end;
}

.notistack-container--bottom-left {
    bottom: 20px;
    left: 20px;
    flex-direction: column-reverse;
    align-items: flex-start;
}

.notistack-container--bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column-reverse;
    align-items: center;
}

/* 2. ITEM WRAPPER ĐỂ XỬ LÝ COLLAPSE/EXPAND HEIGHT KHI ĐÓNG/MỞ */
.notistack-item-wrap {
    pointer-events: auto;
    box-sizing: border-box;
    overflow: visible;
    transition:
        max-height 0.3s cubic-bezier(0.2, 0, 0, 1),
        margin 0.3s cubic-bezier(0.2, 0, 0, 1),
        opacity 0.25s ease;
    margin-bottom: 10px;
}

.notistack-container--bottom-right .notistack-item-wrap,
.notistack-container--bottom-left .notistack-item-wrap,
.notistack-container--bottom-center .notistack-item-wrap {
    margin-bottom: 0;
    margin-top: 10px;
}

.notistack-item-wrap.notistack-item-wrap--collapsing {
    max-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    opacity: 0 !important;
    pointer-events: none;
}

/* 3. SNACKBAR MAIN CARD */
.notistack-snackbar {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 288px;
    max-width: 480px;
    padding: 11px 16px;
    border-radius: 8px;
    box-shadow:
        0 3px 5px -1px rgba(0, 0, 0, 0.2),
        0 6px 10px 0 rgba(0, 0, 0, 0.14),
        0 1px 18px 0 rgba(0, 0, 0, 0.12);
    font-family: inherit;
    font-size: 1.4rem;
    line-height: 1.45;
    font-weight: 500;
    color: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
    will-change: transform, opacity;
    transition:
        transform 0.28s cubic-bezier(0.2, 0, 0, 1),
        opacity 0.28s ease,
        box-shadow 0.2s ease;
}

.notistack-snackbar:hover {
    box-shadow:
        0 5px 8px -1px rgba(0, 0, 0, 0.24),
        0 8px 14px 0 rgba(0, 0, 0, 0.18),
        0 2px 22px 0 rgba(0, 0, 0, 0.15);
}

/* 4. ANIMATION TRANSITIONS THEO VỊ TRÍ */
/* Top-Right & Bottom-Right: Trượt từ phải sang */
.notistack-container--top-right .notistack-snackbar,
.notistack-container--bottom-right .notistack-snackbar {
    transform: translateX(115%);
    opacity: 0;
}
.notistack-container--top-right .notistack-snackbar.notistack-snackbar--show,
.notistack-container--bottom-right
    .notistack-snackbar.notistack-snackbar--show {
    transform: translateX(0);
    opacity: 1;
}
.notistack-container--top-right .notistack-snackbar.notistack-snackbar--hide,
.notistack-container--bottom-right
    .notistack-snackbar.notistack-snackbar--hide {
    transform: translateX(115%);
    opacity: 0;
}

/* Top-Left & Bottom-Left: Trượt từ trái sang */
.notistack-container--top-left .notistack-snackbar,
.notistack-container--bottom-left .notistack-snackbar {
    transform: translateX(-115%);
    opacity: 0;
}
.notistack-container--top-left .notistack-snackbar.notistack-snackbar--show,
.notistack-container--bottom-left .notistack-snackbar.notistack-snackbar--show {
    transform: translateX(0);
    opacity: 1;
}
.notistack-container--top-left .notistack-snackbar.notistack-snackbar--hide,
.notistack-container--bottom-left .notistack-snackbar.notistack-snackbar--hide {
    transform: translateX(-115%);
    opacity: 0;
}

/* Top-Center: Trượt từ trên xuống */
.notistack-container--top-center .notistack-snackbar {
    transform: translateY(-120%);
    opacity: 0;
}
.notistack-container--top-center .notistack-snackbar.notistack-snackbar--show {
    transform: translateY(0);
    opacity: 1;
}
.notistack-container--top-center .notistack-snackbar.notistack-snackbar--hide {
    transform: translateY(-120%);
    opacity: 0;
}

/* Bottom-Center: Trượt từ dưới lên */
.notistack-container--bottom-center .notistack-snackbar {
    transform: translateY(120%);
    opacity: 0;
}
.notistack-container--bottom-center
    .notistack-snackbar.notistack-snackbar--show {
    transform: translateY(0);
    opacity: 1;
}
.notistack-container--bottom-center
    .notistack-snackbar.notistack-snackbar--hide {
    transform: translateY(120%);
    opacity: 0;
}

/* 5. CÁC BIẾN THỂ MÀU SẮC (VARIANTS) */
/* Default (Snackbar xám đậm Material chuẩn) */
.notistack-snackbar--default {
    background-color: var(--dark-surface, #313131);
    color: #ffffff;
}

/* Success (Màu xanh thành công) */
.notistack-snackbar--success {
    background-color: var(--admin-success, #2e7d32);
    color: #ffffff;
}

/* Error (Màu đỏ cảnh báo lỗi) */
.notistack-snackbar--error {
    background-color: var(--card-price-red, #d32f2f);
    color: #ffffff;
}

/* Warning (Màu cam hổ phách) */
.notistack-snackbar--warning {
    background-color: var(--admin-warn, #ed6c02);
    color: #ffffff;
}

/* Info (Màu cam chủ đạo TechStore) */
.notistack-snackbar--info {
    background-color: var(--primary, #ff6b00);
    color: #ffffff;
}

/* 6. ICON BIỂU TƯỢNG */
.notistack-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 12px;
    flex-shrink: 0;
    line-height: 1;
    color: #ffffff;
}

/* 7. NỘI DUNG THÔNG BÁO */
.notistack-message {
    flex-grow: 1;
    min-width: 0;
    word-break: break-word;
    padding: 2px 0;
}

.notistack-message strong {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.3;
}

.notistack-message .notistack-sub {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.4;
    font-weight: 400;
}

/* 8. NÚT HÀNH ĐỘNG (ACTION BUTTON) */
.notistack-action {
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.notistack-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none !important;
    text-transform: uppercase;
    cursor: pointer;
    letter-spacing: 0.4px;
    line-height: 1.3;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.notistack-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff !important;
    transform: translateY(-1px);
}

.notistack-action-btn:active {
    transform: translateY(0);
}

/* 9. NÚT ĐÓNG (CLOSE BUTTON) */
.notistack-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    padding: 4px;
    margin-left: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notistack-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

/* 10. THANH ĐẾM THỜI GIAN (PROGRESS BAR) */
.notistack-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.notistack-progress-bar {
    height: 100%;
    width: 100%;
    background: rgba(255, 255, 255, 0.65);
    transform-origin: left center;
    transition: width linear;
}

/* 11. RESPONSIVE MOBILE */
@media (max-width: 576px) {
    .notistack-container {
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
        max-width: calc(100vw - 32px);
        align-items: stretch !important;
    }

    .notistack-snackbar {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
}
