/* ==========================================
   CART STYLES - HenschTech3D
   ========================================== */

.cart-section {
    padding: 40px 0;
    min-height: 60vh;
    background-color: #f8f9fa;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Cart Header */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.cart-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.cart-info {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Cart Content */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Cart Items */
.cart-items {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.cart-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.cart-item:hover {
    background-color: #f8f9fa;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 20px;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    text-decoration: none;
    transition: color 0.2s;
}

.cart-item-title:hover {
    color: #667eea;
}

.cart-item-options {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.cart-item-price {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.quantity-input {
    width: 60px;
    height: 32px;
    border: none;
    text-align: center;
    font-weight: 600;
    color: #495057;
}

.quantity-input:focus {
    outline: none;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: #f8d7da;
    color: #721c24;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 80px 40px;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h3 {
    color: #6c757d;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.empty-cart p {
    color: #adb5bd;
    margin-bottom: 30px;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.summary-card {
    padding: 24px;
}

.summary-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.summary-row span:first-child {
    color: #6c757d;
}

.summary-row span:last-child {
    font-weight: 500;
    color: #495057;
}

.total-row {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    margin-bottom: 24px;
}

.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-block {
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
}

.checkout-icon {
    margin-left: 8px;
    transition: transform 0.2s;
}

.btn-primary:hover .checkout-icon {
    transform: translateX(3px);
}

.summary-guarantees {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.guarantee-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #6c757d;
}

.guarantee-item:last-child {
    margin-bottom: 0;
}

.guarantee-icon {
    margin-right: 8px;
    font-size: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin: 0;
    color: #6c757d;
    line-height: 1.5;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cart-item-image {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }

    .summary-card {
        padding: 20px;
    }

    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
}