@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px 0;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-title, .hero-title {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    font-size: 3rem !important;
    font-weight: 900 !important;
    background: linear-gradient(45deg, #333, #555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5) !important;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.search-input {
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1.1rem;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.search-btn {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(254,202,87,0.4);
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(254,202,87,0.6);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 35px 70px rgba(0,0,0,0.2);
}

.product-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-image img:hover {
    transform: scale(1.05);
}

.product-content {
    padding: 20px;
    text-align: center;
}

.product-name {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: #222 !important;
    margin-bottom: 20px !important;
    line-height: 1.3;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2) !important;
}

.rating-sales-section {
    border-radius: 15px !important;
}

.rating-display i {
    margin-left: 0.3rem !important;
    transition: color 0.3s ease;
}

.sales-text {
    font-size: 1.4rem !important;
}

.price-section {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.original-price {
    font-size: 1.2rem;
    color: #666;
    text-decoration: line-through;
}

.discounted-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e74c3c;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.discount-badge {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.stock-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.stock-info span {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.in-stock {
    background: #2ecc71;
    color: white;
}

.add-to-cart-section {
    margin-top: 20px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.3);
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(46, 204, 113, 0.4);
}

.add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    margin-top: 10px;
    padding: 10px;
    background: rgba(46, 204, 113, 0.2);
    border-radius: 10px;
    color: #2ecc71;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px 15px 0 0;
}

.no-products {
    text-align: center;
    padding: 80px 20px;
    color: white;
    font-size: 1.3rem;
}

.action-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    padding: 18px 40px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102,126,234,0.4);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .search-container {
        margin: 0 0 30px 0;
        padding: 15px;
    }
    
    .search-input {
        width: 100%;
        margin-bottom: 15px;
    }
}
