/* ===================================
   Simple Cart UI Styles
   =================================== */

/* Cart Container */
.cart-container {
    background: #f8f9fa;
    min-height: 100vh;
    padding: 2rem 0;
}

.cart-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Cart Header */
.cart-header {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border-left: 4px solid #007bff;
}

.cart-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.cart-header .cart-count-badge {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-left: 1rem;
    font-weight: 500;
}

/* Cart Content */
.cart-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
}

.empty-cart-icon {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.empty-cart h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: 500;
}

.empty-cart p {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Cart Items */
.cart-items {
    padding: 1.5rem;
}

.cart-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

/* Product Image */
.product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e9ecef;
}

/* Product Info */
.product-info h5 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.product-attributes {
    background: #f8f9fa;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #6c757d;
    display: inline-block;
}

/* Price Display */
.price-display {
    text-align: right;
}

.main-price {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.attribute-price {
    font-size: 0.85rem;
    color: #28a745;
    margin-top: 0.25rem;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
    margin: 0 auto;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f8f9fa;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.quantity-btn:hover:not(:disabled) {
    background: #007bff;
    color: white;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.quantity-btn i {
    pointer-events: none;
    font-style: normal;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    background: white;
}

.quantity-input:focus {
    outline: none;
    background: #f8f9fa;
}

/* Total Price */
.item-total {
    font-size: 1.25rem;
    font-weight: 600;
    color: #007bff;
    text-align: center;
}

/* Remove Button */
.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.remove-btn:hover {
    background: #c82333;
}

/* Cart Actions */
.cart-actions {
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.continue-shopping-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.continue-shopping-btn:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

.clear-cart-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 1rem;
}

.clear-cart-btn:hover {
    background: #c82333;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    z-index: 1;
}

.cart-summary * {
    pointer-events: auto;
}

.cart-summary h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid #f8f9fa;
}

.summary-label {
    font-size: 1rem;
    color: #6c757d;
}

.summary-value {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.total-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #007bff;
}

/* Checkout Button */
.checkout-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: block;
    text-align: center;
    width: 100%;
    margin-top: 1.5rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.checkout-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

.checkout-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-container {
        padding: 1rem 0;
    }
    
    .cart-header {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .cart-header h1 {
        font-size: 1.5rem;
    }
    
    .cart-items {
        padding: 1rem;
    }
    
    .cart-item {
        padding: 1rem;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
    
    .product-info h5 {
        font-size: 1rem;
    }
    
    .main-price {
        font-size: 1.1rem;
    }
    
    .cart-summary {
        margin-top: 1rem;
        position: static;
    }
    
    .cart-actions {
        padding: 1rem;
    }
    
    .continue-shopping-btn,
    .clear-cart-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .cart-header h1 {
        font-size: 1.25rem;
    }
    
    .cart-count-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .empty-cart {
        padding: 2rem 1rem;
    }
    
    .empty-cart-icon {
        font-size: 3rem;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
    }
    
    .quantity-controls {
        transform: scale(0.9);
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-out {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-100%); }
}

/* Success/Error Messages */
.cart-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.cart-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cart-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Checkout FAB */
@media (max-width: 768px) {
    .mobile-checkout-fab {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: #28a745;
        color: white;
        border: none;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        font-size: 1.25rem;
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
        z-index: 1000;
        transition: all 0.2s ease;
    }
    
    .mobile-checkout-fab:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
    }
}

/* Login Required Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-title {
    color: #333;
    font-weight: 600;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}