/* ===== ИКОНКА КОРЗИНЫ В ШАПКЕ ===== */
.cart-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(230, 126, 34, 0.08);
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 20px;
    border: 1.5px solid rgba(230, 126, 34, 0.15);
    position: relative;
}

.cart-icon:hover {
    background: rgba(230, 126, 34, 0.15);
    transform: scale(1.05);
    border-color: #e67e22;
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.2);
}

.cart-icon__emoji {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.cart-icon:hover .cart-icon__emoji {
    transform: rotate(-5deg) scale(1.1);
}

.cart-icon__count {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3);
    display: inline-block;
}

.cart-icon__count:empty {
    display: none;
}

/* ===== ОВЕРЛЕЙ ===== */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(4px);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== ВЫЕЗЖАЮЩАЯ КОРЗИНА ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -480px;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    background: #ffffff;
    z-index: 1000;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

/* ===== ЗАГОЛОВОК ===== */
.cart-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: white;
}

.cart-sidebar__header h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-sidebar__header h3::before {
    content: '🛒';
    font-size: 24px;
}

.cart-sidebar__close {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-sidebar__close:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: rotate(90deg);
}

/* ===== ТЕЛО КОРЗИНЫ ===== */
.cart-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.cart-sidebar__body::-webkit-scrollbar {
    width: 6px;
}

.cart-sidebar__body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* ===== ПУСТАЯ КОРЗИНА ===== */
.cart-empty-sidebar {
    text-align: center;
    padding: 60px 30px;
    animation: fadeIn 0.5s ease;
}

.cart-empty__icon {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cart-empty-sidebar p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: 500;
}

/* ===== ТОВАРЫ В КОРЗИНЕ ===== */
.cart-items-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item-sidebar {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: slideLeft 0.4s ease;
}

@keyframes slideLeft {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.cart-item-sidebar:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(230, 126, 34, 0.2);
}

.cart-item-sidebar__info {
    flex: 1;
}

.cart-item-sidebar__name {
    font-size: 16px;
    font-weight: 600;
    color: #1a252f;
    margin-bottom: 8px;
    padding-right: 30px;
    line-height: 1.3;
}

.cart-item-sidebar__price {
    font-size: 20px;
    font-weight: 700;
    color: #e67e22;
    margin-bottom: 15px;
}

/* ===== КОНТРОЛЫ КОЛИЧЕСТВА ===== */
.cart-item-sidebar__quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
}

.quantity-btn-sidebar {
    width: 34px;
    height: 34px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #1a252f;
}

.quantity-btn-sidebar:hover {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
    transform: scale(1.05);
}

.quantity-btn-sidebar:active {
    transform: scale(0.95);
}

.quantity-input-sidebar {
    width: 50px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 8px 5px;
    font-size: 15px;
    font-weight: 600;
    color: #1a252f;
    background: white;
    transition: border-color 0.2s ease;
}

.quantity-input-sidebar:focus {
    outline: none;
    border-color: #e67e22;
}

/* ===== КНОПКА УДАЛЕНИЯ ===== */
.cart-item-sidebar__remove {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(231, 76, 60, 0.1);
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-item-sidebar__remove:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

/* ===== ФУТЕР КОРЗИНЫ ===== */
.cart-sidebar__footer {
    padding: 25px;
    background: #ffffff;
    border-top: 1px solid #eee;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 15px;
    color: #666;
}

.cart-summary__total {
    font-size: 22px;
    font-weight: 700;
    color: #1a252f;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px dashed #e0e0e0;
}

.cart-summary__total span:last-child {
    color: #e67e22;
}

/* ===== КНОПКИ В КОРЗИНЕ ===== */
.btn--block {
    width: 100%;
    margin-top: 12px;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.btn--primary {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    border: none;
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.3);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(230, 126, 34, 0.4);
}

.btn--outline {
    background: transparent;
    border: 2px solid #e0e0e0;
    color: #666;
}

.btn--outline:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.btn--small {
    padding: 12px 20px;
    font-size: 14px;
}

/* ===== КНОПКА "В КОРЗИНУ" В КАТАЛОГЕ ===== */
.catalog-card__add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    width: 100%;
    background: linear-gradient(135deg, #1a252f 0%, #2c3e50 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.catalog-card__add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.catalog-card__add-to-cart:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.35);
}

.catalog-card__add-to-cart:hover::before {
    left: 100%;
}

.catalog-card__add-to-cart:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

/* Состояние "Добавлено" */
.catalog-card__add-to-cart.added {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    pointer-events: none;
    gap: 8px;
}

.catalog-card__add-to-cart.added::after {
    content: ' ✓';
    font-size: 18px;
    font-weight: bold;
    animation: checkmark 0.4s ease;
}

@keyframes checkmark {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.catalog-card__add-to-cart .cart-icon-small {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.catalog-card__add-to-cart:hover .cart-icon-small {
    transform: rotate(-5deg) scale(1.1);
}

/* ===== УВЕДОМЛЕНИЕ ===== */
.cart-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: white;
    padding: 16px 28px;
    border-radius: 16px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-notification::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #27ae60;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

/* ===== БЛОКИРОВКА СКРОЛЛА ===== */
body.cart-open {
    overflow: hidden;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 480px) {
    .cart-sidebar {
        max-width: 100%;
    }
    
    .cart-sidebar__header {
        padding: 20px;
    }
    
    .cart-sidebar__header h3 {
        font-size: 20px;
    }
    
    .cart-sidebar__body {
        padding: 15px;
    }
    
    .cart-item-sidebar {
        padding: 15px;
    }
    
    .cart-item-sidebar__name {
        font-size: 14px;
    }
    
    .cart-item-sidebar__price {
        font-size: 18px;
    }
    
    .cart-sidebar__footer {
        padding: 20px;
    }
    
    .cart-icon {
        padding: 8px 14px;
        margin-left: 10px;
    }
    
    .cart-icon__emoji {
        font-size: 18px;
    }
    
    .cart-icon__count {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 20px;
    }
}