/**
 * Shopping Cart Styles for CraftingStudioHub
 * Custom styles for dynamic cart functionality
 */

/* Cart Item Styles */
.cart-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.cart-item-image {
    flex-shrink: 0;
    margin-right: 20px;
}

.cart-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

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

.cart-item-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.cart-item-details h4 a {
    color: #333;
    text-decoration: none;
}

.cart-item-details h4 a:hover {
    color: #007bff;
}

.cart-item-options {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.cart-item-options .size,
.cart-item-options .color {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: #007bff;
}

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

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.quantity-btn:active {
    background: #dee2e6;
}

.quantity-input {
    border: none;
    padding: 8px 12px;
    text-align: center;
    width: 60px;
    font-size: 16px;
    font-weight: 600;
}

.quantity-input:focus {
    outline: none;
    background: #fff;
}

.cart-item-total {
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
    text-align: center;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.remove-item-btn:hover {
    background: #c82333;
}

/* Cart Summary Styles */
.cart-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.cart-totals {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

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

.cart-total-item.total {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    border-top: 2px solid #007bff;
    margin-top: 10px;
    padding-top: 15px;
}

/* Empty Cart Styles */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-cart div:first-child {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart h3 {
    color: #666;
    margin-bottom: 10px;
    font-size: 24px;
}

.empty-cart p {
    color: #999;
    margin-bottom: 30px;
    font-size: 16px;
}

/* Cart Notification Styles */
#cart-notification {
    font-family: Arial, sans-serif;
    font-size: 14px;
    max-width: 300px;
}

/* Cart Icon Styles */
.cart-btn a {
    text-decoration: none;
    color: inherit;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-icon .item-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    padding: 0 4px;
    box-sizing: border-box;
}

/* Checkout Button Styles */
.checkout-btn {
    background: #28a745 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.checkout-btn:hover {
    background: #218838 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.checkout-btn:active {
    transform: translateY(0);
}

/* Checkout Success Modal Responsive */
@media (max-width: 768px) {
    #checkout-success-modal div {
        margin: 10px !important;
        padding: 30px 20px !important;
    }
    
    #checkout-success-modal h2 {
        font-size: 24px !important;
    }
    
    #checkout-success-modal div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #checkout-success-modal button {
        width: 100% !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .cart-item-image {
        margin-right: 0;
        align-self: center;
    }
    
    .cart-item-details {
        margin-right: 0;
        text-align: center;
        width: 100%;
    }
    
    .cart-item-controls {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .cart-item-options {
        justify-content: center;
    }
    
    .quantity-controls {
        order: 1;
    }
    
    .cart-item-total {
        order: 2;
        flex: 1;
        text-align: center;
    }
    
    .remove-item-btn {
        order: 3;
    }
}

@media (max-width: 480px) {
    .cart-item {
        padding: 15px;
    }
    
    .cart-item-image img {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-details h4 {
        font-size: 14px;
    }
    
    .cart-item-price,
    .cart-item-total {
        font-size: 16px;
    }
    
    .quantity-input {
        width: 50px;
        padding: 6px 8px;
    }
    
    .quantity-btn {
        padding: 6px 10px;
    }
}
