/* ============================================
   ИНДИКАТОРЫ КОРЗИНЫ И СРАВНЕНИЯ НА КАРТОЧКАХ ТОВАРА
   ============================================ */

/* Индикация товара в корзине */
.product-thumb.in-cart,
.product-grid.in-cart,
.product-layout.in-cart {
    position: relative;
}

.product-thumb.in-cart::after,
.product-grid.in-cart::after,
.product-layout.in-cart .product-thumb::after {
    content: '✓ В корзине';
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.product-thumb.in-cart .btn-addtocart,
.product-grid.in-cart .btn-addtocart,
.product-layout.in-cart .btn-addtocart {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

.product-thumb.in-cart .btn-addtocart:hover,
.product-grid.in-cart .btn-addtocart:hover,
.product-layout.in-cart .btn-addtocart:hover {
    background-color: #45a049 !important;
    border-color: #45a049 !important;
}

/* Индикация товара в сравнении */
.btn-compare.iscompare {
    background-color: #2196F3 !important;
    border-color: #2196F3 !important;
}

.btn-compare.iscompare::before {
    content: '✓';
    margin-right: 3px;
}

/* Счетчики в header */
.badge[data-amount="0"] {
    display: none !important;
}

.badge[data-amount]:not([data-amount="0"]) {
    display: flex !important;
}

/* ============================================
   АНИМАЦИЯ ДОБАВЛЕНИЯ В КОРЗИНУ
   ============================================ */

/* Анимация полета в корзину */
@keyframes flyToCart {
    0% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.5) translate(var(--fly-x), calc(var(--fly-y) * 0.5));
    }
    100% {
        opacity: 0;
        transform: scale(0.1) translate(var(--fly-x), var(--fly-y));
    }
}

/* Клон изображения для анимации */
.flying-image {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    animation: flyToCart 0.8s cubic-bezier(0.5, 0.1, 0.3, 1) forwards;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Анимация пульсации счетчика */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

.badge.pulse {
    animation: pulse 0.4s ease-in-out;
}

/* Анимация для иконки корзины при добавлении */
@keyframes cartBounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(-7px);
    }
}

#victorinox-cart-btn.cart-bounce {
    animation: cartBounce 0.6s ease-in-out;
}

/* Эффект успешного добавления */
@keyframes successGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.product-thumb.added-success,
.product-grid.added-success {
    animation: successGlow 0.8s ease-out;
}

/* Стили для кнопки на странице товара */
#button-cart.btn-success {
    background-color: #4CAF50 !important;
    border-color: #4CAF50 !important;
}

#button-cart.btn-success:hover {
    background-color: #45a049 !important;
    border-color: #45a049 !important;
}

/* Модальное окно корзины */
#modal-cart .modal-dialog {
    max-width: 800px;
}

#modal-cart .modal-content {
    border-radius: 8px;
}

#modal-cart .modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

#modal-cart .modal-body {
    padding: 20px;
}

#modal-cart .table-responsive {
    position: relative;
}

/* Loader для корзины */
#modal-cart .table-responsive.recart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9) url('/image/sloading.gif') center center no-repeat;
    z-index: 100;
    border-radius: 4px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .product-thumb.in-cart::after,
    .product-grid.in-cart::after {
        font-size: 10px;
        padding: 4px 8px;
        top: 5px;
        right: 5px;
    }
    
    #modal-cart .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }
}

@media (max-width: 480px) {
    .product-thumb.in-cart::after,
    .product-grid.in-cart::after {
        content: '✓';
        padding: 4px 6px;
        min-width: 24px;
        text-align: center;
    }
}

