/* ========== КОНТЕЙНЕР УВЕДОМЛЕНИЙ ========== */
.notification-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification-container-top-right {
    top: 80px;
    right: 20px;
}

/* ========== УВЕДОМЛЕНИЕ ========== */
.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 350px;
    min-width: 250px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}

/* Прогресс-бар */
.notification::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

.notification:hover::before {
    animation-play-state: paused;
}

.notification-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    line-height: 1.4;
}

/* Крестик ТОЛЬКО для мобильных устройств */
.notification-close {
    display: none; /* Скрыт по умолчанию */
}

/* ============================================
   УВЕДОМЛЕНИЕ-ПОДТВЕРЖДЕНИЕ (CONFIRM)
   ============================================ */
.notification-confirm {
    background: linear-gradient(135deg, #17a2b8, #138496) !important;
    padding: 0 !important;
    min-width: 320px;
    max-width: 380px;
    border-radius: 12px !important;
}

.notification-confirm .notification-icon {
    display: none;
}

.notification-confirm .notification-message {
    display: block;
    text-align: center;
    padding: 18px 15px 14px;
    font-size: 14px;
    line-height: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.notification-buttons {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
}

.notification-btn {
    flex: 1;
    padding: 6px 16px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    text-align: center;
}

/* Кнопка ДА (первая, справа) */
.notification-btn-confirm {
    background: #c20e00;
    order: 2;
}

.notification-btn-confirm:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Кнопка ОТМЕНА (вторая, слева) */
.notification-btn-cancel {
    background: rgba(46, 192, 12, 0.3);
    order: 1;
}

.notification-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Убираем прогресс-бар у confirm уведомлений */
.notification-confirm::before {
    display: none;
}

/* На мобильных устройствах */
@media (max-width: 768px) {
    .notification-confirm {
        min-width: 280px;
        max-width: 320px;
    }

    .notification-confirm .notification-message {
        padding: 16px 16px 12px;
        font-size: 13px;
    }

    .notification-buttons {
        gap: 10px;
        padding: 10px 14px;
    }

    .notification-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* ========== МОБИЛЬНАЯ ВЕРСИЯ ========== */
@media (max-width: 768px) {
    .notification-container-top-right {
        left: 10px;
        right: 10px;
        top: 10px;
        bottom: auto;
    }

    .notification {
        max-width: none;
        width: 93%;
        min-width: auto;
        padding: 14px 16px;
        font-size: 15px;
        border-radius: 10px;
        cursor: default; /* Убираем курсор pointer на мобильных */
    }

    /* Показываем крестик только на мобильных */
    .notification-close {
        display: flex;
        background: none;
        border: none;
        color: inherit;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        margin: 0;
        margin-left: 8px;
        opacity: 0.7;
        transition: opacity 0.2s;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }

    .notification-close:active {
        opacity: 1;
        background: rgba(255, 255, 255, 0.2);
        transform: scale(0.95);
    }

    /* Убираем hover эффекты на мобильных */
    .notification:hover {
        transform: none;
    }

    /* Анимации для мобильных */
    @keyframes slideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
}

/* Типы уведомлений */
.notification-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #ffffff ;
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #333;
}

.notification-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* Анимации для десктопа */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Десктоп: клик по уведомлению закрывает его */
@media (min-width: 769px) {
    .notification {
        cursor: pointer;
    }

    .notification:active {
        transform: scale(0.98);
    }
}

/* ============================================
   КОЛОКОЛЬЧИК УВЕДОМЛЕНИЙ
   ============================================ */

.notification-bell-wrapper {
    position: relative;
}

.notification-bell {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s;
    font-size: 22px;
}

.notification-bell:hover {
    color: #e44c2c;
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e44c2c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(228, 76, 44, 0.3);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    overflow: hidden;
    flex-direction: column;
}

.notification-dropdown.show {
    display: flex;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ЗАГОЛОВОК
   ============================================ */

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    background: #f8f9fa;
    flex-shrink: 0;
}

.notification-header span {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.mark-all-read {
    background: none;
    border: none;
    color: #007bff;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.mark-all-read:hover {
    background: #e8f0fe;
    text-decoration: none;
}

/* ============================================
   СПИСОК
   ============================================ */

.notification-list {
    overflow-y: auto;
    max-height: 350px;
    flex: 1;
}

.notification-list::-webkit-scrollbar {
    width: 4px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
   ЭЛЕМЕНТ УВЕДОМЛЕНИЯ
   ============================================ */

.notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 14px 5px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s, opacity 0.3s, transform 0.3s;
    cursor: default;
    min-height: 60px;
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-item.unread:hover {
    background: #e8f0fe;
}

/* ============================================
   КРЕСТИК (закрыть)
   ============================================ */

.notification-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    color: #bbb;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close-btn:hover {
    background: #dc3545;
    color: white;
    transform: rotate(90deg);
}

/* ============================================
   ИКОНКА
   ============================================ */

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-icon.cart { background: white;}
.notification-icon.favorite { background: white; }
.notification-icon.order { background: white; }
.notification-icon.system { background: white; }
.notification-icon.promo { background: white; }

/* ============================================
   КОНТЕНТ
   ============================================ */

.notification-content {
    flex: 1;
    padding-right: 30px;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    word-wrap: break-word;
    max-height: 2.6em;
}

.bell-notification-message {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    max-height: 7em;
}

.notification-time {
    font-size: 11px;
    color: #999;
    display: block;
    margin-top: 4px;
}

/* ============================================
   КНОПКА "ПЕРЕЙТИ"
   ============================================ */

.notification-go-btn {
    margin-top: 6px;
    padding: 4px 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
    display: inline-block;
}

.notification-go-btn:hover {
    background: #0056b3;
}

/* ============================================
   ПУСТОЕ СОСТОЯНИЕ
   ============================================ */

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .notification-dropdown {
        width: calc(100vw - 30px);
        right: -10px;
        max-height: 400px;
        top: calc(100% + 6px);
    }

    .notification-list {
        max-height: 320px;
    }

    .notification-item {
        padding: 12px 14px 12px 14px;
        min-height: 50px;
    }

    .notification-icon {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .notification-title {
        font-size: 13px;
    }

    .bell-notification-message {
        font-size: 12px;
    }

    .notification-close-btn {
        top: 8px;
        right: 10px;
        width: 22px;
        height: 22px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .notification-dropdown {
        width: calc(100vw - 20px);
        right: -5px;
    }
}
