/* 
 * E-commerce Cart - Dedicated Cart Functionality Styles
 * Version: 1.0
 * Date: 2025
 */

:root {
    --ecommerce-primary: #FC5F49;
    --ecommerce-primary-light: #ff7b65;
    --ecommerce-primary-dark: #d14436;
    --ecommerce-white: #ffffff;
    --ecommerce-black: #070707;
    --ecommerce-gray: #666666;
    --ecommerce-light-gray: #f5f5f5;
    --ecommerce-border-color: #e0e0e0;
    --ecommerce-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --ecommerce-shadow-hover: 0 5px 25px rgba(0, 0, 0, 0.15);
}

/* Floating Cart Button */
.ecommerce-floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--ecommerce-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--ecommerce-shadow-hover);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ecommerce-floating-cart-btn:hover {
    background: var(--ecommerce-primary-dark);
    transform: scale(1.1);
}

.ecommerce-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--ecommerce-black);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid white;
}

/* Cart Sidebar */
.ecommerce-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);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.ecommerce-cart-sidebar.active {
    right: 0;
}

/* Cart Backdrop */
.ecommerce-cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

/* Cart Header */
.ecommerce-cart-header {
    background: var(--ecommerce-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ecommerce-cart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

/* Close Button */
.ecommerce-cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

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

/* Cart Items Container */
.ecommerce-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: calc(100vh - 200px);
}

.ecommerce-cart-items::-webkit-scrollbar {
    width: 6px;
}

.ecommerce-cart-items::-webkit-scrollbar-track {
    background: var(--ecommerce-light-gray);
}

.ecommerce-cart-items::-webkit-scrollbar-thumb {
    background: var(--ecommerce-primary);
    border-radius: 3px;
}

/* Cart Item */
.ecommerce-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--ecommerce-border-color);
    transition: background 0.3s ease;
}

.ecommerce-cart-item:hover {
    background: var(--ecommerce-light-gray);
    margin: 0 -20px;
    padding: 15px 20px;
}

.ecommerce-cart-item:last-child {
    border-bottom: none;
}

.ecommerce-cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--ecommerce-light-gray);
    flex-shrink: 0;
}

.ecommerce-cart-item-details {
    flex: 1;
    min-width: 0;
}

.ecommerce-cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ecommerce-black);
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.ecommerce-cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--ecommerce-primary);
    margin-bottom: 8px;
}

/* Quantity Controls */
.ecommerce-quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ecommerce-light-gray);
    border-radius: 6px;
    padding: 4px;
}

.ecommerce-quantity-btn {
    background: white;
    border: 1px solid var(--ecommerce-border-color);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--ecommerce-gray);
    transition: all 0.3s ease;
}

.ecommerce-quantity-btn:hover {
    background: var(--ecommerce-primary);
    color: white;
    border-color: var(--ecommerce-primary);
}

.ecommerce-quantity-display {
    min-width: 30px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--ecommerce-black);
}

/* Remove Button */
.ecommerce-cart-item-remove {
    background: none;
    border: none;
    color: var(--ecommerce-gray);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ecommerce-cart-item-remove:hover {
    background: #ff4444;
    color: white;
}

/* Cart Footer */
.ecommerce-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--ecommerce-border-color);
    background: var(--ecommerce-light-gray);
    flex-shrink: 0;
}

.ecommerce-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--ecommerce-black);
}

.ecommerce-cart-total-amount {
    color: var(--ecommerce-primary);
    font-size: 20px;
    font-weight: 700;
}

/* Checkout Button */
.ecommerce-checkout-btn {
    width: 100%;
    background: var(--ecommerce-primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.ecommerce-checkout-btn:hover {
    background: var(--ecommerce-primary-dark);
    transform: translateY(-2px);
}

/* Clear Cart Button */
.ecommerce-clear-cart-btn {
    width: 100%;
    padding: 12px 16px;
    background: #fff5f4;
    color: var(--ecommerce-primary);
    border: 2px solid var(--ecommerce-primary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ecommerce-clear-cart-btn:hover {
    background: var(--ecommerce-primary);
    color: white;
}

/* Add to Cart Button */
.ecommerce-add-to-cart-btn {
    background: var(--ecommerce-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.ecommerce-add-to-cart-btn:hover {
    background: var(--ecommerce-primary-dark);
    transform: translateY(-2px);
}

.ecommerce-add-to-cart-btn:disabled {
    background: var(--ecommerce-gray);
    cursor: not-allowed;
    transform: none;
}

/* Empty Cart State */
.ecommerce-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--ecommerce-gray);
}

.ecommerce-cart-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--ecommerce-border-color);
}

.ecommerce-cart-empty h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--ecommerce-black);
}

.ecommerce-cart-empty p {
    font-size: 14px;
    margin: 0;
}

/* Toast Notification */
.ecommerce-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--ecommerce-primary);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--ecommerce-shadow-hover);
    z-index: 1002;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.ecommerce-toast.show {
    transform: translateX(0);
}

.ecommerce-toast.success {
    background: #4CAF50;
}

.ecommerce-toast.error {
    background: #f44336;
}

.ecommerce-toast.warning {
    background: #ff9800;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ecommerce-cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .ecommerce-floating-cart-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .ecommerce-cart-count {
        width: 20px;
        height: 20px;
        font-size: 10px;
        top: -6px;
        right: -6px;
    }
    
    .ecommerce-cart-item {
        gap: 10px;
    }
    
    .ecommerce-cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .ecommerce-cart-item-title {
        font-size: 13px;
    }
    
    .ecommerce-cart-item-price {
        font-size: 14px;
    }
    
    .ecommerce-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Animation Classes */
.ecommerce-fade-in {
    animation: ecommerceFadeIn 0.3s ease;
}

.ecommerce-slide-in {
    animation: ecommerceSlideIn 0.3s ease;
}

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

@keyframes ecommerceSlideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading State */
.ecommerce-loading {
    position: relative;
    overflow: hidden;
}

.ecommerce-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: ecommerceLoading 1.5s infinite;
}

@keyframes ecommerceLoading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Enhanced Filter Card Styles */
.ecommerce-filter-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--ecommerce-shadow);
    border: 1px solid var(--ecommerce-border-color);
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.ecommerce-filter-card:hover {
    box-shadow: var(--ecommerce-shadow-hover);
    transform: translateY(-2px);
}

.ecommerce-filter-card-header {
    background: linear-gradient(135deg, var(--ecommerce-primary), var(--ecommerce-primary-light));
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ecommerce-filter-card-body {
    padding: 20px;
}

.ecommerce-filter-section {
    margin-bottom: 24px;
}

.ecommerce-filter-section:last-child {
    margin-bottom: 0;
}

.ecommerce-filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ecommerce-black);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecommerce-filter-divider {
    height: 1px;
    background: var(--ecommerce-border-color);
    margin: 16px 0;
}
