/* إعدادات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B4513;
    --secondary-color: #FF6B35;
    --whatsapp-color: #25D366;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #F5F5DC;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --gradient-primary: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    --gradient-secondary: linear-gradient(135deg, #FF6B35 0%, #E55A2B 50%, #D44A1A 100%);
    --gradient-whatsapp: linear-gradient(135deg, #25D366 0%, #128C7E 50%, #0D6B5A 100%);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-search: linear-gradient(135deg, #F5F5DC 0%, #F0E68C 50%, #DDA0DD 100%);
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--gradient-bg);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الهيدر */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 25px 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 2;
}

.logo {
    text-align: center;
    flex: 1;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
    line-height: 1.3;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.whatsapp-btn {
    background: var(--gradient-whatsapp);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    letter-spacing: 0.3px;
    font-family: 'Cairo', sans-serif;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128C7E, #0D6B5A);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.min-order {
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.cart-btn {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    letter-spacing: 0.3px;
    font-family: 'Cairo', sans-serif;
}

.cart-btn:hover {
    background: linear-gradient(135deg, #E55A2B, #D44A1A);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

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

/* قسم البحث */
.search-section {
    background: var(--gradient-search);
    padding: 40px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(139,69,19,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
    opacity: 0.3;
}

.search-content {
    position: relative;
    z-index: 2;
}

.search-content h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
    line-height: 1.2;
    font-family: 'Cairo', sans-serif;
}

.search-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    font-weight: 500;
    line-height: 1.4;
    font-family: 'Cairo', sans-serif;
}

.search-bar {
    display: flex;
    max-width: 550px;
    margin: 0 auto 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2);
    transform: translateY(-2px);
}

.search-bar input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-dark);
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
}

.search-bar input::placeholder {
    color: var(--text-light);
    font-style: italic;
}

.search-bar button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.search-bar button:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    transform: scale(1.05);
}

.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.2);
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.category-btn:hover::before {
    left: 100%;
}

.category-btn:hover,
.category-btn.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.4);
}

/* المنتجات */
.main-content {
    padding: 50px 0;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.9) 0%, rgba(233, 236, 239, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.05), rgba(160, 82, 45, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.product-image {
    height: 180px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.1), rgba(160, 82, 45, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-card:hover .product-image::before {
    opacity: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    position: relative;
    z-index: 2;
}

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

.product-info {
    padding: 18px;
    position: relative;
    z-index: 2;
}

.product-info h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    line-height: 1.3;
    font-family: 'Cairo', sans-serif;
}

.product-info p {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    font-family: 'Cairo', sans-serif;
}

.product-price {
    margin-bottom: 15px;
    text-align: center;
}

.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    position: relative;
    font-family: 'Cairo', sans-serif;
}

.price::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 1px;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
}

.add-to-cart-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.add-to-cart-btn:hover::before {
    left: 100%;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #E55A2B, #D44A1A);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* سلة التسوق */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.cart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: white;
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.cart.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #8B4513;
    color: white;
}

.cart-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

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

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #FF6B35;
    font-weight: 600;
}

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

.quantity-btn {
    background: #8B4513;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.quantity-btn:hover {
    background: #A0522D;
}

.quantity {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.remove-item {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.remove-item:hover {
    background: #c82333;
}

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

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.whatsapp-order-btn {
    width: 100%;
    background: #25D366;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.whatsapp-order-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.continue-shopping-btn {
    width: 100%;
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    background: #5a6268;
}

/* نافذة تفاصيل الطلب */
.order-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #8B4513;
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8B4513;
}

.order-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.order-summary h4 {
    margin-bottom: 10px;
    color: #8B4513;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #5a6268;
}

.confirm-order-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.confirm-order-btn:hover {
    background: #128C7E;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .whatsapp-btn,
    .cart-btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-content h2 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .cart {
        width: 100%;
        right: -100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .cancel-btn,
    .confirm-order-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .search-content h2 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .categories {
        flex-direction: column;
        align-items: center;
    }
    
    .category-btn {
        width: 200px;
    }
}
