* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 1s ease;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    color: transparent; /* كدعم احتياطي */
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    height: 30px;
    margin-bottom: 10px;
}

.cart-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #3498db;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: all 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
    background: #2980b9;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    transition: all 0.4s ease;
    padding: 20px;
    overflow-y: auto;
}

.cart-sidebar.open {
    left: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-title {
    font-size: 1.5rem;
    color: #2c3e50;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.cart-items {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-left: 10px;
}

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: bold;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cart-actions {
    display: flex;
    gap: 10px;
}

.checkout-btn {
    flex: 2;
    padding: 12px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exit-cart-btn {
    flex: 1;
    padding: 12px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.exit-cart-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.order-success {
    text-align: center;
    padding: 30px 20px;
    display: none;
}

.success-icon {
    font-size: 4rem;
    color: #2ecc71;
    margin-bottom: 20px;
    animation: bounce 1s ease;
}

.success-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.success-message {
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.continue-shopping {
    padding: 12px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    background: #3498db;
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
    animation: pulse 2s infinite;
}

.product-info {
    padding: 25px;
    position: relative;
}

.product-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 12px;
    background: linear-gradient(45deg, #3498db, #2c3e50);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    color: #3498db; 
    
  
    max-height: 65px;
    overflow: hidden;
    line-height: 1.4;
}
.product-category {
    display: inline-block;
    background: linear-gradient(45deg, #3498db, #2c3e50);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.product-description {
    color: #666;
    margin-bottom: 20px;
    max-height: 80px;
    overflow: hidden;
    line-height: 1.5;
    position: relative;
}

.product-description::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 1.5em;
    background: linear-gradient(to top, white, transparent);
    pointer-events: none;
}

.product-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-price::before {
    content: "$";
    font-size: 1.2rem;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.rating-stars {
    color: #f39c12;
    margin-left: 5px;
    font-size: 1.1rem;
}

.rating-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.special-offer {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 10px;
    display: inline-block;
    animation: bounce 2s infinite;
}

.out-of-stock {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-offer {
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 10px;
    display: inline-block;
}

.mens-clothing {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.electronics {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
}

.jewelery {
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    color: white;
}

.womens-clothing {
    background: linear-gradient(45deg, #e91e63, #c2185b);
    color: white;
}

.other-category {
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    color: #333;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2ecc71;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.5s ease;
}

.cart-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.5rem;
    color: #3498db;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

/* Modal للتفاصيل */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    overflow: hidden;
    animation: modalFadeIn 0.5s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-body {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.modal-image {
    flex: 1;
    max-width: 300px;
    border-radius: 10px;
    overflow: hidden;
}

.modal-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.modal-details {
    flex: 2;
}

.modal-price {
    font-size: 2rem;
    color: #e74c3c;
    margin: 10px 0;
}

.modal-description {
    line-height: 1.8;
    margin: 15px 0;
}

.modal-rating {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 80%;
    }
    
    .cart-sidebar {
        width: 300px;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-image {
        max-width: 100%;
    }
    
    .cart-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .cart-sidebar {
        width: 100%;
        left: -100%;
    }
}