/* Кнопка корзины в шапке */
.desktop-cart-wrapper {
    display: flex;
    align-items: center;
}

.cart-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--dark-brown);
    font-size: 1.4rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.cart-btn:hover {
    background: rgba(124, 87, 71, 0.1);
    transform: translateY(-2px);
}

.mobile-cart-btn {
    background: var(--gradient-bright);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 150, 64, 0.3);
}

.cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--bright-red);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.mobile-cart-btn .cart-count-badge {
    position: static;
    background: rgba(255, 255, 255, 0.3);
    width: 24px;
    height: 24px;
}

/* Модальное окно корзины */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.cart-modal.active {
    display: block;
}

.cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

.cart-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Заголовок корзины */
.cart-header {
    padding: 20px;
    background: var(--gradient-bright);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

/* Контент корзины */
.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--warm-brown);
}

.cart-empty i {
    font-size: 4rem;
    color: rgba(124, 87, 71, 0.2);
    margin-bottom: 20px;
}

.cart-empty h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-brown);
}

/* Товары в корзине */
.cart-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid rgba(124, 87, 71, 0.1);
    animation: fadeInUp 0.3s ease;
}

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

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    margin-right: 15px;
}

.cart-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-brown);
}

.cart-item-description {
    font-size: 0.85rem;
    color: var(--warm-brown);
    margin-bottom: 8px;
    line-height: 1.3;
}

.cart-item-price {
    font-weight: 700;
    color: var(--warm-brown);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cart-item-controls button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: rgba(124, 87, 71, 0.1);
    color: var(--warm-brown);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-item-controls button:hover {
    background: var(--gradient-bright);
    color: white;
}

.cart-item-quantity {
    font-weight: 600;
    color: var(--dark-brown);
    min-width: 30px;
    text-align: center;
}

.cart-item-remove {
    background: rgba(227, 6, 19, 0.1) !important;
    color: var(--bright-red) !important;
}

.cart-item-remove:hover {
    background: var(--bright-red) !important;
    color: white !important;
}

/* Подвал корзины */
.cart-footer {
    padding: 20px;
    background: var(--bg-variant-1);
    border-top: 1px solid rgba(124, 87, 71, 0.1);
    flex-shrink: 0;
}

.cart-summary {
    margin-bottom: 20px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-brown);
}

.cart-total-price {
    color: var(--warm-brown);
    font-size: 1.3rem;
}

.cart-shipping {
    font-size: 0.9rem;
    color: var(--medium-green);
    display: flex;
    align-items: center;
}

.cart-checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient-bright);
    color: black;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 150, 64, 0.3);
}

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

.cart-continue-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--warm-brown);
    border: 1px solid rgba(124, 87, 71, 0.2);
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-continue-btn:hover {
    background: rgba(124, 87, 71, 0.05);
    border-color: var(--bright-green);
}

/* Адаптивность */
@media (max-width: 768px) {
    .cart-sidebar {
        max-width: 100%;
    }

    .cart-header {
        padding: 15px;
    }

    .cart-title {
        font-size: 1.3rem;
    }

    .cart-item {
        padding: 12px 0;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-footer {
        padding: 15px;
    }
}
