/* ===== أنماط المكونات الأساسية ===== */

/* ===== نظام الإشعارات ===== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 300ms ease;
    pointer-events: auto;
    max-width: 100%;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.notification-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.notification-warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.notification-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}


/* ===== السلة العائمة ===== */
.floating-cart {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.floating-cart.show {
    transform: translateX(0);
    opacity: 1;
}

.cart-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.cart-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart-close:hover {
    background: #f5f5f5;
    color: #333;
}

.cart-items {
    padding: 16px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-details h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #0070f3;
    margin-bottom: 8px;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    background: #f5f5f5;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #e0e0e0;
}

.quantity-value {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.remove-item-btn:hover {
    background: #fdf2f2;
}

.cart-footer {
    padding: 16px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    gap: 8px;
}

.cart-actions button {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-cart-btn {
    background: #f5f5f5;
    color: #333;
}

.view-cart-btn:hover {
    background: #e0e0e0;
}

.checkout-btn {
    background: #0070f3;
    color: white;
}

.checkout-btn:hover {
    background: #0056b3;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* ===== النوافذ المنبثقة ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* ===== نافذة العرض السريع ===== */
.quick-view-modal .modal-content {
    width: 800px;
    max-width: 90vw;
}

.quick-view-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 32px;
}


/* ===== عداد السلة ===== */
.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.cart-toggle {
    position: relative;
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.cart-toggle:hover {
    background: #f5f5f5;
}

/* ===== عداد قائمة الرغبات ===== */
.wishlist-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}



/* ===== التحميل ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0070f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== التجاوب ===== */
@media (max-width: 768px) {
    .floating-cart {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
    
    .quick-view-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    

    

    
    .notification-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cart-item-quantity {
        align-self: flex-end;
    }
    
} 