/* Исправление корзины - открывается поверх всего контента */

/* Основные стили корзины */
.cart-dropdown {
    position: fixed !important; /* Изменено с absolute на fixed */
    top: 80px !important; /* Позиционируем под хедером */
    right: 50px !important; /* Отступ от правого края */
    width: 350px !important; /* Увеличиваем ширину */
    max-width: 90vw !important; /* Адаптивность */
    background: #FFF !important;
    padding: 20px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    border-radius: 15px !important;
    z-index: 99999 !important; /* Очень высокий z-index */
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-20px) scale(0.95) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

/* Открытое состояние корзины */
.dropdown.open > .cart-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}

/* Список товаров в корзине */
.cart-dropdown .cart-list {
    max-height: 300px !important; /* Увеличиваем высоту */
    overflow-y: auto !important;
    margin-bottom: 20px !important;
    padding-right: 10px !important;
}

/* Стилизация скроллбара */
.cart-dropdown .cart-list::-webkit-scrollbar {
    width: 6px !important;
}

.cart-dropdown .cart-list::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 3px !important;
}

.cart-dropdown .cart-list::-webkit-scrollbar-thumb {
    background: #D10024 !important;
    border-radius: 3px !important;
}

.cart-dropdown .cart-list::-webkit-scrollbar-thumb:hover {
    background: #b3001e !important;
}

/* Товары в корзине */
.cart-dropdown .cart-list .product-widget {
    padding: 15px !important;
    margin-bottom: 15px !important;
    background: #f8f9fa !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e9ecef !important;
}

.cart-dropdown .cart-list .product-widget:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
}

.cart-dropdown .cart-list .product-widget:last-child {
    margin-bottom: 0 !important;
}

/* Изображение товара */
.cart-dropdown .cart-list .product-widget .product-img {
    left: 0 !important;
    top: 0 !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.cart-dropdown .cart-list .product-widget .product-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Тело товара */
.cart-dropdown .cart-list .product-widget .product-body {
    margin-left: 75px !important;
    padding-top: 5px !important;
}

.cart-dropdown .cart-list .product-widget .product-body .product-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 5px !important;
    line-height: 1.3 !important;
}

.cart-dropdown .cart-list .product-widget .product-body .product-price {
    color: #D10024 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
}

/* Кнопки корзины */
.cart-dropdown .cart-btns {
    margin: 0 -20px -20px -20px !important;
    display: flex !important;
    border-radius: 0 0 15px 15px !important;
    overflow: hidden !important;
}

.cart-dropdown .cart-btns > a {
    display: inline-block !important;
    width: 50% !important;
    padding: 15px !important;
    background-color: #D10024 !important;
    color: #FFF !important;
    text-align: center !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    font-size: 14px !important;
    border: none !important;
}

.cart-dropdown .cart-btns > a:first-child {
    margin-right: 0 !important;
    background-color: #1e1f29 !important;
    border-right: 1px solid rgba(255,255,255,0.1) !important;
}

.cart-dropdown .cart-btns > a:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

/* Сумма заказа */
.cart-dropdown .cart-summary {
    border-top: 2px solid #e9ecef !important;
    padding-top: 15px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
}

.cart-dropdown .cart-summary .text {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
    margin-bottom: 5px !important;
}

.cart-dropdown .cart-summary .text-primary {
    color: #D10024 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Пустая корзина */
.cart-dropdown .empty-cart {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #6c757d !important;
}

.cart-dropdown .empty-cart i {
    font-size: 48px !important;
    color: #dee2e6 !important;
    margin-bottom: 15px !important;
    display: block !important;
}

.cart-dropdown .empty-cart p {
    font-size: 16px !important;
    margin: 0 !important;
    font-weight: 500 !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .cart-dropdown {
        top: 70px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
}

@media (max-width: 480px) {
    .cart-dropdown {
        top: 60px !important;
        right: 5px !important;
        left: 5px !important;
        padding: 15px !important;
    }
    
    .cart-dropdown .cart-list .product-widget {
        padding: 10px !important;
    }
    
    .cart-dropdown .cart-list .product-widget .product-img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .cart-dropdown .cart-list .product-widget .product-body {
        margin-left: 65px !important;
    }
}

/* Убираем старые стили */
.cart-dropdown {
    -webkit-box-shadow: none !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
}

/* Дополнительные улучшения */
.cart-dropdown::before {
    content: '' !important;
    position: absolute !important;
    top: -8px !important;
    right: 60px !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 8px solid transparent !important;
    border-right: 8px solid transparent !important;
    border-bottom: 8px solid #FFF !important;
    z-index: 1 !important;
}

/* Анимация появления */
@keyframes cartSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown.open > .cart-dropdown {
    animation: cartSlideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Дополнительные стили для гарантии отображения поверх всего */
.cart-dropdown {
    position: fixed !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

/* Убираем возможные конфликты с навигацией */
#navigation {
    z-index: 1 !important;
}

#navigation * {
    z-index: 1 !important;
}

/* Убираем возможные конфликты с header */
#header {
    z-index: 100 !important;
}

#header * {
    z-index: 100 !important;
}

/* Убираем возможные конфликты с другими элементами */
.dropdown {
    z-index: 99999 !important;
}

.modern-cart {
    z-index: 99999 !important;
}

.cart-toggle {
    z-index: 99999 !important;
}
