/* Стили для уведомлений повторного заказа */
.reorder-notification {
    padding: 12px 15px;
    margin: 10px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.4;
}

.reorder-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.reorder-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.reorder-notification ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.reorder-notification li {
    margin-bottom: 4px;
}

/* Предотвращаем прокрутку к уведомлениям */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    scroll-margin-top: 0 !important;
    scroll-margin-bottom: 0 !important;
}

/* Отключаем автоматическую прокрутку */
html {
    scroll-behavior: auto !important;
}

/* Скрываем стандартные уведомления WooCommerce о корзине */
.woocommerce-message:contains("Корзина обновлена"),
.woocommerce-message:contains("Cart updated"),
.woocommerce-message:contains("корзина обновлена"),
.woocommerce-message:contains("cart updated") {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Контейнер для уведомлений повторного заказа */
#reorder-notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

/* Специальные стили для страницы корзины */
.cart-page #reorder-notifications-container,
.woocommerce-cart #reorder-notifications-container {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    max-width: none;
    width: auto;
    margin: 20px 0;
    order: 2; /* Размещаем после навигации */
}

/* Стили для списка неудачных товаров */
.failed-products-list {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.failed-products-list li {
    margin-bottom: 4px;
    color: inherit;
}

/* Стили для уведомлений */
.reorder-notification {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    animation: slideInRight 0.3s ease-out;
    /* Отключаем автоматическое исчезновение */
    transition: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Специальные стили для уведомлений на странице корзины */
.cart-page .reorder-notification,
.woocommerce-cart .reorder-notification {
    animation: slideInTop 0.3s ease-out;
    margin-bottom: 15px;
}

/* Кнопка закрытия (крестик) */
.reorder-notification .close-notification {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #666;
    transition: all 0.2s ease;
    z-index: 10;
}

.reorder-notification .close-notification:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

.reorder-notification .close-notification:active {
    transform: scale(0.95);
}

/* Символ крестика */
.reorder-notification .close-notification::before,
.reorder-notification .close-notification::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: currentColor;
    top: 50%;
    left: 50%;
}

.reorder-notification .close-notification::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.reorder-notification .close-notification::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Успешное уведомление */
.reorder-notification.reorder-success {
    border-left: 4px solid #46b450;
    background-color: #f7fcf7;
}

.reorder-notification.reorder-success .info-msg {
    color: #46b450;
    font-weight: 600;
    margin: 0 0 10px 0;
}

/* Список успешно добавленных товаров */
.added-products-list {
    margin-top: 10px;
}

.added-products-list b {
    color: #46b450;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.success-products-list {
    margin: 8px 0;
    padding-left: 20px;
    list-style: none;
}

.success-products-list li {
    color: #46b450;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.4;
}

/* Кнопка "В корзину" */
.reorder-notification .go-to-cart-btn {
    display: inline-block;
    background: #46b450;
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.reorder-notification .go-to-cart-btn:hover {
    background: #3a9a43;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(70, 180, 80, 0.3);
}

.reorder-notification .go-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(70, 180, 80, 0.3);
}

/* Уведомление об ошибке */
.reorder-notification.reorder-error {
    border-left: 4px solid #dc3232;
    background-color: #fef7f7;
}

.reorder-notification.reorder-error b {
    color: #dc3232;
    font-weight: 600;
}

/* Список неудачных товаров */
.failed-products-list {
    margin: 10px 0;
    padding-left: 20px;
    list-style: none;
}

.failed-products-list li {
    color: #dc3232;
    margin-bottom: 5px;
    font-size: 14px;
}

/* Отключаем стандартные кнопки закрытия WooCommerce */
.reorder-notification .woocommerce-message-close,
.reorder-notification .notice-dismiss {
    display: none !important;
    pointer-events: none !important;
}

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

/* Анимация появления сверху для страницы корзины */
@keyframes slideInTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Анимация закрытия */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Анимация закрытия сверху для страницы корзины */
@keyframes slideOutTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

.reorder-notification.closing {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Специальная анимация закрытия для страницы корзины */
.cart-page .reorder-notification.closing,
.woocommerce-cart .reorder-notification.closing {
    animation: slideOutTop 0.3s ease-in forwards;
}

/* Отключаем все анимации исчезновения */
.reorder-notification {
    animation-fill-mode: forwards !important;
}

.reorder-notification.fadeOut,
.reorder-notification.slideOut {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Дополнительная защита от скрытия */
.reorder-notification[style*="display: none"],
.reorder-notification[style*="opacity: 0"],
.reorder-notification[style*="visibility: hidden"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
    #reorder-notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* Специальные стили для мобильной версии страницы корзины */
    .cart-page #reorder-notifications-container,
    .woocommerce-cart #reorder-notifications-container {
        margin: 15px 0;
    }
    
    .reorder-notification {
        padding: 12px;
        font-size: 14px;
    }
    
    .reorder-notification .close-notification {
        top: 6px;
        right: 6px;
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .reorder-notification .close-notification::before,
    .reorder-notification .close-notification::after {
        width: 8px;
        height: 1.5px;
    }
    
    .success-products-list,
    .failed-products-list {
        padding-left: 15px;
    }
    
    .success-products-list li,
    .failed-products-list li {
        font-size: 13px;
    }
    
    .reorder-notification .go-to-cart-btn {
        padding: 10px 20px;
        font-size: 16px;
        width: 100%;
        text-align: center;
        margin-top: 15px;
    }
}

/* Отключаем все hover-эффекты, которые могут скрыть уведомления */
.reorder-notification:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Дополнительная защита от JavaScript-скрытия */
.reorder-notification {
    /* Принудительно показываем уведомления */
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Отключаем все возможные способы скрытия */
.reorder-notification.hidden,
.reorder-notification.invisible,
.reorder-notification.collapsed {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Стили для кнопки удаления товара из корзины */
.remove-cart-item {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px 10px 0px;
    margin-right: 8px;
    border-radius: 4px;
    color: #999;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.remove-cart-item:hover {
    /*background-color: #ffebee;*/
    color: #d32f2f;
    transform: scale(1.1);
}

.remove-cart-item:active {
    transform: scale(0.95);
}

.remove-cart-item svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.remove-cart-item:hover svg {
    filter: drop-shadow(0 1px 2px rgba(211, 47, 47, 0.3));
}

/* Анимация удаления товара */
.account-page__product-item.removing {
    animation: slideOutLeft 0.3s ease-in forwards;
    opacity: 0.7;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .remove-cart-item {
        padding: 6px;
        margin-right: 10px;
    }
    
    .remove-cart-item svg {
        width: 18px;
        height: 18px;
    }
} 