/* ===== УНИФИЦИРОВАННЫЕ СТИЛИ ДЛЯ ВСЕХ УВЕДОМЛЕНИЙ ===== */
/* Позиция и вид fixed-toast — эталон #cart-toast (ПК: top 150px) */

:root {
    --fixed-toast-top-desktop: 150px;
    --fixed-toast-right-desktop: 30px;
    --fixed-toast-z-index: 3000;
    --fixed-toast-top-tablet: 80px;
    --fixed-toast-top-mobile: 100px;
    --fixed-toast-right-mobile: 20px;
}

/* Базовые стили для всех всплывающих уведомлений в углу экрана */
.unified-notification,
#promo-toast,
#cart-toast,
.message-notification {
    position: fixed;
    top: var(--fixed-toast-top-desktop);
    right: var(--fixed-toast-right-desktop);
    z-index: var(--fixed-toast-z-index);
    display: none;
    min-width: 220px;
    max-width: 400px;
    padding: 16px 24px;
    border-radius: 16px;
    border: none;
    font-family: TTFirsNeue-Medium, TTFirsNeue-Regular, sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: #fff;
    background: linear-gradient(135deg, #ffb05c 0%, #ff8c42 100%);
    box-shadow: 0 4px 16px rgba(255, 176, 92, 0.3);
    animation: slideInRight 0.3s ease;
    word-wrap: break-word;
}

/* Стили для успешных уведомлений (зеленые) */
.unified-notification.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

/* Стили для уведомлений об ошибках (красные) */
.unified-notification.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
}

/* Иконка уведомления */
.unified-notification-icon {
    margin-right: 8px;
    font-size: 16px;
    display: inline-block;
    vertical-align: middle;
}

/* Сообщение уведомления */
.unified-notification-msg {
    flex: 1;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Кнопка закрытия */
.unified-notification-close {
    cursor: pointer;
    font-size: 18px;
    color: #999;
    font-weight: bold;
    line-height: 1;
    float: right;
    margin-left: 16px;
    display: inline-block;
    vertical-align: middle;
}

.unified-notification-close:hover {
    color: #666;
}

/* Стили для кнопки закрытия в зависимости от типа уведомления */
.unified-notification.success .unified-notification-close {
    color: #155724;
}

.unified-notification.error .unified-notification-close {
    color: #721c24;
}

/* Анимации */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.unified-notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* ===== СТИЛИ ДЛЯ СУЩЕСТВУЮЩИХ УВЕДОМЛЕНИЙ ===== */

#promo-toast.success,
.unified-notification.success,
#cart-toast.success,
.message-notification.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    color: #155724;
}

#promo-toast.error,
.unified-notification.error,
#cart-toast.error,
.message-notification.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-color: #dc3545;
    color: #721c24;
}

#promo-toast-icon {
    margin-right: 10px;
    font-size: 22px;
    display: inline-block;
    vertical-align: middle;
}

#promo-toast-msg {
    flex: 1;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

#promo-toast-close {
    cursor: pointer;
    font-size: 20px;
    color: inherit;
    font-weight: bold;
    line-height: 1;
    float: right;
    margin-left: 16px;
    display: inline-block;
    vertical-align: middle;
}

#promo-toast-close:hover {
    opacity: 0.85;
}

.unified-notification.success .unified-notification-close,
#promo-toast.success #promo-toast-close,
#cart-toast.success #promo-toast-close,
.message-notification.success .message-close {
    color: #155724;
}

.unified-notification.error .unified-notification-close,
#promo-toast.error #promo-toast-close,
#cart-toast.error #promo-toast-close,
.message-notification.error .message-close {
    color: #721c24;
}

/* balance-notification - используем унифицированные стили */
.balance-notification {
    background: transparent;
    border: none;
    padding: 8px 0;
    margin-top: 8px;
    font-family: TTFirsNeue-Regular;
    font-size: 14px;
    color: #28a745;
    text-align: center;
    line-height: 1.4;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #28a745;
    padding: 12px 16px;
    margin: 8px 0;
}

/* balance-notification-modal - используем унифицированные стили */
.balance-notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.balance-notification-modal.show {
    opacity: 1;
    visibility: visible;
}

.balance-notification-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.balance-notification-modal.show .balance-notification-content {
    transform: scale(1);
}

.balance-notification-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: white;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
}

.balance-notification-title {
    font-family: TTFirsNeue-Regular;
    font-size: 24px;
    color: #000000;
    margin-bottom: 15px;
    font-weight: bold;
}

.balance-notification-message {
    font-family: TTFirsNeue-Regular;
    font-size: 16px;
    color: #333333;
    margin-bottom: 30px;
    line-height: 1.5;
}

.balance-notification-amount {
    font-family: TTFirsNeue-Regular;
    font-size: 28px;
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
}

.balance-notification-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.balance-notification-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: TTFirsNeue-Regular;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.balance-notification-btn.primary {
    background-color: #0F0F0F;
    color: #FFFFFF;
}

.balance-notification-btn.primary:hover {
    background-color: #333333;
}

.balance-notification-btn.secondary {
    background-color: #DEDEDE;
    color: #000000;
}

.balance-notification-btn.secondary:hover {
    background-color: #CCCCCC;
}

/* cart-notification-modal - используем унифицированные стили */
.cart-notification-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.cart-notification-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.cart-notification-header {
    margin-bottom: 20px;
}

.cart-notification-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.cart-notification-title {
    font-family: TTFirsNeue-DemiBold;
    font-size: 22px;
    color: #333;
    margin: 0 0 10px 0;
}

.cart-notification-text {
    font-family: TTFirsNeue-Regular;
    font-size: 16px;
    color: #666;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.cart-notification-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cart-notification-btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-family: TTFirsNeue-Medium;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    min-width: 140px;
    text-decoration: none;
    display: inline-block;
}

.continue-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.continue-btn:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.go-to-cart-btn {
    background: linear-gradient(135deg, #ffb05c, #ff8c42);
    color: #fff;
    border: 1px solid #ff8c42;
}

.go-to-cart-btn:hover {
    background: linear-gradient(135deg, #ff9f3a, #ff8f2a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 176, 92, 0.4);
}

/* alert_main - используем унифицированные стили */
.alert_main {
    display: none;
    position: fixed;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px;
    background-color: #fff;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.alert_main p {
    font-family: TTFirsNeue-Medium;
    font-size: 28px;
    margin-bottom: 10px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 380px;
    color: #333;
}

.alert_but a {
    padding-left: 14px;
}

.alert_main button {
    padding: 15px;
    border-radius: 10px;
    border: none;
    font-family: TTFirsNeue-Medium;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert_but {
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: nowrap;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .unified-notification,
    #promo-toast,
    #cart-toast,
    .message-notification {
        font-size: 14px;
        padding: 12px 20px;
        top: var(--fixed-toast-top-tablet);
        right: var(--fixed-toast-right-mobile);
        left: auto;
        max-width: 400px;
    }
    
    .balance-notification-content {
        padding: 30px 20px;
        max-width: 350px;
    }
    
    .balance-notification-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .balance-notification-title {
        font-size: 20px;
    }
    
    .balance-notification-message {
        font-size: 14px;
    }
    
    .balance-notification-amount {
        font-size: 24px;
    }
    
    .balance-notification-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .balance-notification-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .cart-notification-content {
        padding: 25px 20px;
        max-width: 350px;
    }
    
    .cart-notification-icon {
        width: 50px;
        height: 50px;
        font-size: 25px;
    }
    
    .cart-notification-title {
        font-size: 20px;
    }
    
    .cart-notification-text {
        font-size: 14px;
    }
    
    .cart-notification-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-notification-btn {
        width: 100%;
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .alert_main {
        padding: 20px;
        max-width: 350px;
    }
    
    .alert_main p {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .unified-notification,
    #promo-toast,
    #cart-toast,
    .message-notification {
        top: var(--fixed-toast-top-mobile);
    }

    .balance-notification-content {
        padding: 25px 15px;
        max-width: 300px;
    }
    
    .balance-notification-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .balance-notification-title {
        font-size: 18px;
    }
    
    .balance-notification-message {
        font-size: 13px;
    }
    
    .balance-notification-amount {
        font-size: 20px;
    }
    
    .cart-notification-content {
        padding: 20px 15px;
        max-width: 300px;
    }
    
    .cart-notification-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .cart-notification-title {
        font-size: 18px;
    }
    
    .cart-notification-text {
        font-size: 13px;
    }
    
    .cart-notification-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .alert_main {
        padding: 15px;
        max-width: 300px;
    }
    
    .alert_main p {
        font-size: 20px;
    }
}
