/* Enhanced Cart Styles for Better UX */

/* Mini Cart Improvements */
.cart-container {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, rgb(46, 169, 226) 0%, #04c3d8 100%);
    color: white;
}

.cart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    min-width: 20px;
    text-align: center;
    display: none;
}

.cart-count:not(:empty) {
    display: flex;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-height: calc(100vh - 200px);
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.cart-empty-text {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
}

.cart-item:hover {
    border-color: rgb(46, 169, 226);
    box-shadow: 0 2px 8px rgba(46, 169, 226, 0.1);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 5px;
    font-size: 1rem;
    line-height: 1.3;
}

.cart-item-price {
    font-weight: 700;
    color: rgb(46, 169, 226);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #6c757d;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quantity-btn:hover {
    border-color: rgb(46, 169, 226);
    background: rgb(46, 169, 226);
    color: white;
}

.quantity-input {
    width: 50px;
    height: 30px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
}

.quantity-input:focus {
    outline: none;
    border-color: rgb(46, 169, 226);
}

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

.cart-item-remove:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.cart-total-label {
    font-weight: 600;
    color: #6c757d;
}

.cart-total-amount {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.2rem;
}

.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
    z-index: 10;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, rgb(46, 169, 226) 0%, #04c3d8 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    display: none;
    z-index: 100;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(46, 169, 226, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.cart-badge:not(:empty) {
    display: flex;
    animation: none;
}

@keyframes badgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cart-icon-wrapper .cart-badge {
    display: flex !important;
    visibility: visible !important;
}

.icon.cart {
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1;
}

.cart-checkout {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, rgb(46, 169, 226) 0%, #04c3d8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.cart-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(181, 232, 255, 0.3);
}

.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.checkout-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.checkout-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
}

.checkout-modal-header h3 {
    margin: 0;
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #1a1a1a;
}

.checkout-modal-body {
    padding: 30px;
}

.order-summary {
    background: rgba(46, 169, 226, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.order-summary h4 {
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 1.2rem;
    font-weight: 600;
}

.order-totals {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #6c757d;
}

.total-row.final {
    border-top: 2px solid rgb(46, 169, 226);
    margin-top: 10px;
    padding-top: 15px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.checkout-form {
    margin-top: 20px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #1a1a1a;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgb(46, 169, 226);
}

.payment-info {
    background: linear-gradient(135deg, rgba(46, 169, 226, 0.1) 0%, rgba(4, 195, 216, 0.1) 100%);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(46, 169, 226, 0.2);
}

.payment-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #495057;
    line-height: 1.6;
}

.payment-notice i {
    color: rgb(46, 169, 226);
    margin-top: 2px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-secondary {
    padding: 12px 24px;
    background: #f8f9fa;
    color: #6c757d;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, rgb(46, 169, 226) 0%, #04c3d8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 169, 226, 0.3);
}

@keyframes slideUp {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}

.modal-order-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
border-bottom: 1px solid #f8f9fa;
}

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

.modal-item-info {
flex: 1;
color: #495057;
font-size: 0.9rem;
line-height: 1.4;
}

.modal-item-info h5 {
margin: 0 0 5px 0;
color: #1a1a1a;
font-size: 1rem;
font-weight: 600;
}

.modal-item-info p {
margin: 0;
color: #6c757d;
font-size: 0.8rem;
}

.modal-item-price {
font-weight: 600;
color: rgb(46, 169, 226);
font-size: 1.1rem;
text-align: right;
}

.cart-page-item {
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 20px;
margin-bottom: 15px;
background: white;
transition: all 0.2s ease;
    background: white;
    transition: all 0.2s ease;
}

.cart-page-item:hover {
    border-color: rgb(46, 169, 226);
    box-shadow: 0 4px 12px rgba(46, 169, 226, 0.1);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    margin-top: 10px;
}

.remove-item-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Notification Styles */
.cart-notification {
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(46, 169, 226, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-container {
        width: 100%;
        right: -100%;
    }
    
    .cart-container.active {
        right: 0;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .cart-item-image {
        width: 100%;
        height: 200px;
    }
    
    .quantity-controls {
        justify-content: center;
    }
}

/* Loading States */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid rgb(46, 169, 226);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility Improvements */
.quantity-btn:focus,
.quantity-input:focus,
.cart-item-remove:focus,
.cart-checkout:focus {
    outline: 2px solid rgb(46, 169, 226);
    outline-offset: 2px;
}

/* Smooth Transitions */
.cart-item,
.cart-footer,
.cart-checkout {
    transition: all 0.2s ease;
}
