/* ==========================================
   SHOPPING CART STYLES
   ========================================== */

/* Cart Icon Button */
.cart-icon-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: 20px;
    color: var(--text-dark, #2c3e50);
    transition: color 0.3s ease;
}

.cart-icon-btn:hover {
    color: var(--primary-color, #4a90a4);
}

.cart-icon-btn svg {
    display: block;
}

.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-color, #e74c3c);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none; /* Hidden when cart is empty */
}

/* 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;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width:450px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    transition: right 0.3s ease;
}

.cart-sidebar.open {
    right: 0;
    pointer-events: auto;
}

/* Cart Header */
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.cart-header h2 {
    font-size: 24px;
    margin: 0;
    font-family: 'Playfair Display', serif;
    color: var(--text-dark, #2c3e50);
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #666;
    transition: color 0.3s ease;
}

.cart-close-btn:hover {
    color: var(--text-dark, #2c3e50);
}

/* Cart Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-cart svg {
    margin: 0 auto 20px;
    opacity: 0.3;
}

.empty-cart p {
    font-size: 18px;
    margin: 10px 0;
    color: #666;
}

.empty-cart small {
    font-size: 14px;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    transition: box-shadow 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark, #2c3e50);
}

.cart-item-specs {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.cart-item-price {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 14px;
}

.item-unit-price {
    color: #999;
}

.item-total-price {
    font-weight: 600;
    color: var(--primary-color, #4a90a4);
    font-size: 16px;
}

/* Cart Item Actions */
.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 8px;
    padding: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color, #4a90a4);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: var(--primary-dark, #3a7a8a);
}

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--text-dark, #2c3e50);
}

.remove-item-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 6px;
    transition: color 0.3s ease;
}

.remove-item-btn:hover {
    color: var(--accent-color, #e74c3c);
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid #eee;
    padding: 20px 24px;
    background: #f8f9fa;
}

.cart-totals {
    margin-bottom: 20px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.cart-grand-total {
    border-top: 2px solid #ddd;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark, #2c3e50);
}

.cart-grand-total span:last-child {
    color: var(--primary-color, #4a90a4);
}

/* Cart Actions */
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-actions .btn {
    width: 100%;
    justify-content: center;
}

.btn-outline {
    background: white;
    color: var(--primary-color, #4a90a4);
    border: 2px solid var(--primary-color, #4a90a4);
}

.btn-outline:hover {
    background: var(--primary-color, #4a90a4);
    color: white;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--success-color, #27ae60);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(450px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Add to Cart Button Styles */
.cart-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.cart-form-actions .btn {
    flex: 1;
}

.btn-add-cart {
    background: var(--primary-color, #4a90a4);
    color: white;
}

.btn-quote {
    background: var(--primary-dark, #3a7a8a);
    color: white;
}

/* Quantity Input in Form */
.quantity-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quantity-input {
    width: 100px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }
    
    .cart-icon-btn {
        margin-left: 12px;
    }
    
    .cart-form-actions {
        flex-direction: column;
    }
    
    .cart-form-actions .btn {
        width: 100%;
    }
}
