/* ==============================
   Cart Styles
   ============================== */

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.close-cart {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.close-cart:hover {
    color: #000;
}

.cart-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 40px 20px;
}

.empty-cart i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
}

/* Cart Items */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #f5f5f5;
}

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

.cart-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cart-item-variant {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #666;
}

.cart-item-price {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

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

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 4px;
}

.quantity-controls button {
    width: 24px;
    height: 24px;
    border: none;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.quantity-controls button:hover {
    background: #e0e0e0;
}

.quantity-controls span {
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.remove-item:hover {
    background: #ffe6e6;
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid #eee;
    padding: 20px 0 0 0;
}

.cart-total {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.cart-actions .btn-secondary,
.cart-actions .btn-primary {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.cart-actions .btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.cart-actions .btn-secondary:hover {
    background: #e0e0e0;
}

.cart-actions .btn-primary {
    background: #000;
    color: white;
}

.cart-actions .btn-primary:hover {
    background: #333;
}

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

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

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

.notification-content {
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}

.notification-content i {
    font-size: 18px;
}

.notification-content button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    padding: 0 5px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Cart Count Badge */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-notification {
        right: 10px;
        left: 10px;
    }
    
    .notification-content {
        min-width: auto;
    }
}

/* Product Page Cart Integration */
.variant-btn.selected {
    border-color: #000;
    background: #f0f0f0;
    font-weight: 600;
}

.add-to-cart-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-to-cart-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
