/* ============================================
   AIRI CART SYSTEM STYLES
   ============================================ */

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background: white;
    z-index: 9999;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-sidebar-overlay.active {
    opacity: 1;
   
}

.cart-sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cart-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cart-sidebar-header h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.cart-count-badge {
    background: #f76b6a;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-left: 8px;
}

.cart-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    color: #666;
    transition: color 0.2s;
}

.cart-close-btn:hover {
    color: #333;
}

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

/* Cart Items */
.cart-items {
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-exit {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-20px);
        height: 0;
        margin: 0;
        padding: 0;
        border: none;
    }
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 8px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.cart-item-attributes {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.cart-item-price {
    font-weight: 600;
    color: #f76b6a;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e9ecef;
    color: #333;
}

.qty-input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 0.9rem;
    color: #333;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s;
}

.remove-item:hover {
    color: #c82333;
}

/* Cart Totals */
.cart-totals {
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.total-label {
    color: #666;
}

.total-value {
    font-weight: 500;
    color: #333;
}

.total-row.grand-total {
    border-top: 2px solid #eee;
    padding-top: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-top: 10px;
}

/* Cart Buttons */
.cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-btn {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.cart-btn.view-cart {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.cart-btn.view-cart:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.cart-btn.checkout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cart-btn.checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Empty Cart State */
.empty-cart-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-cart-icon {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-cart-state h4 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-cart-state p {
    color: #666;
    margin-bottom: 25px;
}

.shop-now-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shop-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

/* Toast Notifications */
.airi-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.airi-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.airi-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.airi-toast.success {
    border-left: 4px solid #28a745;
}

.airi-toast.error {
    border-left: 4px solid #dc3545;
}

.airi-toast.warning {
    border-left: 4px solid #ffc107;
}

.airi-toast.info {
    border-left: 4px solid #17a2b8;
}

.toast-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.95rem;
}

.toast-message {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 10px;
    color: #999;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

/* Mini Cart Count */
.mini-cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f76b6a;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.mini-cart-count.active {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Responsive Design */
@media (max-width: 576px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .airi-toast {
        min-width: calc(100% - 40px);
        width: auto;
    }
    
    .cart-item {
        flex-direction: column;
    }
    
    .cart-item-image {
        width: 100%;
        height: 120px;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Body when cart is open */
body.sidebar-open {
    overflow: hidden;
}