﻿/* Cart Icon Styles */
.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

    .cart-icon-wrapper:hover {
        transform: scale(1.1);
    }

.cart-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

/* Cart Sidebar Styles */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

    .cart-sidebar.active {
        right: 0;
    }

/* Cart Header */
.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .close-cart:hover {
        color: #333;
        background: #e0e0e0;
    }

/* Cart Items Container */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cart-item-price {
    color: #667eea;
    font-weight: 500;
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: white;
    border-radius: 20px;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #C45C26;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    font-size: 16px;
}

    .quantity-btn:hover {
        background: #000;
    }

    .quantity-btn:active {
        transform: scale(0.95);
    }

.quantity-display {
    width: 30px;
    text-align: center;
    font-weight: 600;
}

.remove-item {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.3s ease;
    padding: 5px;
}

    .remove-item:hover {
        transform: scale(1.2);
    }

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-cart-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart-text {
    font-size: 18px;
    margin-bottom: 10px;
}

.empty-cart-subtext {
    font-size: 14px;
    color: #bbb;
}

/* Cart Footer */
.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-summary {
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

    .summary-row.total {
        font-size: 18px;
        font-weight: 600;
        padding-top: 10px;
        border-top: 1px solid #ddd;
    }

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: #C45C26;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .checkout-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

    .checkout-btn:active {
        transform: translateY(0);
    }

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Responsive */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}
