.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: -650px;
    width: 600px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    left: 0;
}

.cart-header {
    padding: 28px 30px 24px;
    border-bottom: 2px solid #f0f0f0;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.cart-title {
    font-family: "Unbounded", sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: #2c3e50;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.5px;
}

.close-cart {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-cart:hover {
    background: #f5f5f5;
    color: #B43F20;
    transform: rotate(90deg);
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    /* Кастомный скроллбар */
    scrollbar-width: thin;
    scrollbar-color: #B43F20 #f5f5f5;
}

/* Webkit браузеры (Chrome, Safari, Edge) */
.cart-content::-webkit-scrollbar {
    width: 8px;
}

.cart-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.cart-content::-webkit-scrollbar-thumb {
    background: #B43F20;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: #9a3619;
}

.cart-empty {
    text-align: center;
    padding: 80px 30px;
    color: #999;
}

.cart-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.cart-empty-text {
    font-size: 18px;
    margin-bottom: 24px;
    color: #666;
    font-weight: 500;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 30px;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border-radius: 16px;
    animation: slideInUp 0.4s ease;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.cart-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-color: #B43F20;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(180, 63, 32, 0.15);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
}

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

.cart-item-name {
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 16px;
    color: #B43F20;
    font-weight: 700;
    font-family: "Unbounded", sans-serif;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    font-weight: bold;
    color: #666;
}

.quantity-btn:hover {
    background: #B43F20;
    color: white;
    border-color: #B43F20;
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-display {
    font-weight: 700;
    font-size: 17px;
    min-width: 35px;
    text-align: center;
    color: #2c3e50;
    font-family: "Unbounded", sans-serif;
}

.remove-item {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #ffebee;
    transform: scale(1.15);
}

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

.cart-footer {
    padding: 28px 30px;
    border-top: 2px solid #f0f0f0;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.delivery-info {
    margin-bottom: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.delivery-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.delivery-price {
    font-size: 15px;
    color: #B43F20;
    font-weight: 700;
    font-family: "Unbounded", sans-serif;
}

.cart-totals {
    margin-bottom: 24px;
    background: #f8f8f8;
    padding: 18px;
    border-radius: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
    gap: 16px;
}

.total-label {
    font-size: 15px;
    color: #666;
    font-weight: 500;
    flex: 1;
}

.total-value {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    font-family: "Unbounded", sans-serif;
    text-align: right;
    white-space: nowrap;
}

.total-row.final {
    border-top: 2px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 12px;
    margin-bottom: 0;
}

.total-row.final .total-label {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 600;
}

.total-row.final .total-value {
    font-size: 22px;
    color: #B43F20;
    font-family: "Unbounded", sans-serif;
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    padding: 18px 24px;
    background: #B43F20;
    color: white;
    border: none;
    border-radius: 50px;
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(180, 63, 32, 0.3);
    letter-spacing: 0.5px;
}

.checkout-btn:hover {
    background: #9a3619;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180, 63, 32, 0.4);
}

.checkout-btn:active {
    transform: translateY(0);
}

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

.clear-cart {
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
}

.clear-cart:hover {
    background: #f5f5f5;
    border-color: #ff4444;
    color: #ff4444;
}

.clear-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.continue-shopping-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #B43F20 0%, #E94B3C 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: "Unbounded", sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(180, 63, 32, 0.3);
}

.continue-shopping-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(180, 63, 32, 0.4);
}

@keyframes cartItemAdd {
    0% {
        opacity: 0;
        transform: scale(0.8) translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

@keyframes cartItemRemove {
    0% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateX(-50px);
    }
}

.cart-item.adding {
    animation: cartItemAdd 0.3s ease;
}

.cart-item.removing {
    animation: cartItemRemove 0.3s ease;
}

@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        left: -100%; 
    }
    
    .cart-header {
        padding: 20px 20px 16px;
    }
    
    .cart-title {
        font-size: 20px;
    }
    
    .cart-items {
        padding: 16px 20px;
        gap: 12px;
    }
    
    .cart-item {
        padding: 14px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        margin-right: 12px;
    }
    
    .cart-item-name {
        font-size: 13px;
    }
    
    .cart-item-price {
        font-size: 14px;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .quantity-display {
        font-size: 15px;
        min-width: 30px;
    }
    
    .cart-footer {
        padding: 20px 20px;
    }
    
    .delivery-info {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .delivery-address {
        font-size: 13px;
    }
    
    .delivery-price {
        font-size: 14px;
    }
    
    .cart-totals {
        padding: 14px;
        margin-bottom: 20px;
    }
    
    .total-label {
        font-size: 13px;
    }
    
    .total-value {
        font-size: 15px;
    }
    
    .total-row.final .total-label {
        font-size: 14px;
    }
    
    .total-row.final .total-value {
        font-size: 18px;
    }
    
    .checkout-btn {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    .clear-cart {
        padding: 12px 20px;
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    .cart-header {
        padding: 18px 15px 14px;
    }
    
    .cart-title {
        font-size: 18px;
    }
    
    .cart-items {
        padding: 14px 15px;
        gap: 10px;
    }
    
    .cart-item {
        padding: 12px;
    }
    
    .cart-item-image {
        width: 55px;
        height: 55px;
        margin-right: 10px;
    }
    
    .cart-item-name {
        font-size: 12px;
    }
    
    .cart-item-price {
        font-size: 13px;
    }
    
    .quantity-btn {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .quantity-display {
        font-size: 14px;
        min-width: 28px;
    }
    
    .cart-footer {
        padding: 18px 15px;
    }
    
    .delivery-info {
        padding: 10px;
        margin-bottom: 14px;
    }
    
    .delivery-address {
        font-size: 12px;
    }
    
    .delivery-price {
        font-size: 13px;
    }
    
    .cart-totals {
        padding: 12px;
        margin-bottom: 18px;
    }
    
    .total-label {
        font-size: 12px;
    }
    
    .total-value {
        font-size: 14px;
    }
    
    .total-row.final .total-label {
        font-size: 13px;
    }
    
    .total-row.final .total-value {
        font-size: 16px;
    }
    
    .checkout-btn {
        padding: 14px 18px;
        font-size: 13px;
    }
    
    .clear-cart {
        padding: 10px 18px;
        font-size: 12px;
    }
}

@media (max-width: 320px) {
    .cart-header {
        padding: 16px 12px 12px;
    }
    
    .cart-title {
        font-size: 16px;
    }
    
    .cart-items {
        padding: 12px;
        gap: 8px;
    }
    
    .cart-item {
        padding: 10px;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 8px;
    }
    
    .cart-item-name {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .cart-item-price {
        font-size: 12px;
    }
    
    .cart-item-controls {
        gap: 8px;
        margin-top: 8px;
    }
    
    .quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
    
    .quantity-display {
        font-size: 13px;
        min-width: 24px;
    }
    
    .remove-item {
        margin-left: 8px;
        padding: 4px;
    }
    
    .cart-footer {
        padding: 16px 12px;
    }
    
    .delivery-info {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .delivery-address {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .delivery-price {
        font-size: 12px;
    }
    
    .cart-totals {
        padding: 10px;
        margin-bottom: 16px;
    }
    
    .total-row {
        margin-bottom: 8px;
        padding: 6px 0;
    }
    
    .total-label {
        font-size: 11px;
    }
    
    .total-value {
        font-size: 13px;
    }
    
    .total-row.final .total-label {
        font-size: 12px;
    }
    
    .total-row.final .total-value {
        font-size: 15px;
    }
    
    .checkout-btn {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .clear-cart {
        padding: 10px 16px;
        font-size: 11px;
        margin-top: 10px;
    }
    
    .cart-empty {
        padding: 60px 20px;
    }
    
    .cart-empty-icon {
        font-size: 48px;
        margin-bottom: 16px;
    }
    
    .cart-empty-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
}
/* Стили для вариантов товара в корзине */
.cart-item-variant {
    font-weight: 600;
    color: var(--color-primary, #B43F20);
    font-size: 14px;
}

.cart-item-gram {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}
