/* Стили для виджета корзины */
.cart-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-widget:hover {
    transform: scale(1.1);
}

.cart-icon {
    position: relative;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    border: 3px solid white;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
    transform: rotate(-10deg);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3838;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Стили для модального окна корзины */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.cart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.4s ease;
}

.cart-modal-header {
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-close {
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.cart-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem 0;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background: #f8fafc;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    margin-right: 1rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    color: #667eea;
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.quantity-change {
    background: #64748b;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-change:hover {
    background: #475569;
    transform: scale(1.1);
}

.cart-item-quantity span {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-remove {
    background: #f56565;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.cart-item-remove:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: #718096;
}

.empty-cart p {
    margin: 0;
    font-size: 1.1rem;
}

.cart-summary {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
}

.order-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.order-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.order-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.order-btn:hover::before {
    left: 100%;
}

.order-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.order-btn:disabled::before {
    display: none;
}

.order-btn-text {
    font-size: 1.1rem;
}

.order-btn-icon {
    font-size: 1.3rem;
}

/* Анимации */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .cart-widget {
        top: 15px;
        right: 15px;
    }
    
    .cart-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    .cart-count {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .cart-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .cart-modal-header {
        padding: 1.2rem 1.5rem;
    }
    
    .cart-modal-header h2 {
        font-size: 1.3rem;
    }
    
    .cart-item {
        padding: 1rem 1.5rem;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-summary {
        padding: 1.2rem 1.5rem;
    }
    
    .order-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cart-widget {
        top: 10px;
        right: 10px;
    }
    
    .cart-icon {
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }
    
    .cart-modal-content {
        border-radius: 15px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cart-item-image {
        margin-right: 0;
    }
    
    .cart-item-actions {
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .cart-item-remove {
        margin-left: auto;
    }
}

/* Стили для состояния загрузки */
.cart-items .empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: #718096;
}

.cart-items .empty-cart p {
    margin: 0;
    font-size: 1.1rem;
}

/* Fallback для битых изображений */
.cart-item-image {
    background: #f1f5f9;
    border-radius: 10px;
}