/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #10b981, #059669); /* Green */
    --primary-gradient-hover: linear-gradient(135deg, #059669, #047857);
    --secondary-gradient: linear-gradient(135deg, #22c55e, #16a34a);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    min-height: 100vh;
    color: var(--text-primary);
    /* تحديد اتجاه القراءة لكل العناصر لتجنب المشاكل */
    direction: rtl; 
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #059669, #047857);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cart-button {
    padding: 0.75rem;
    position: relative;
    border-radius: 9999px;
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
}

.cart-button:hover {
    background: #f3f4f6;
}

.cart-icon {
    color: #4b5563;
    transition: var(--transition);
}

.cart-button:hover .cart-icon {
    color: #059669;
}

.cart-count {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 0.75rem;
    border-radius: 9999px;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 5rem 1rem;
    overflow: hidden;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%);
    z-index: 1;
}

/* Hero Image Slider */
.hero-slider {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-slider-track {
    display: flex;
    width: 400%; /* 4 slides */
    height: 100%;
    animation: slideHero 20s infinite;
}

.hero-slide {
    width: 25%;
    height: 100%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 896px;
    margin: 0 auto;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-title span {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #d1d5db;
    max-width: 512px;
    margin-left: auto;
    margin-right: auto;
}

/* Slider Section (Features) */
.slider-container {
    max-width: 1280px;
    margin: 0 auto 4rem;
    padding: 0 1rem;
}

.slider {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    direction: ltr; /* Animation direction must be LTR */
}

.slider-track {
    display: flex;
    animation: slide 20s linear infinite;
}

.slider-item {
    min-width: 250px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-right: 1px solid #e5e7eb;
    direction: rtl; /* Content direction is RTL */
}

.slider-item:last-child {
    border-right: none;
}

.slider-icon {
    width: 3rem;
    height: 3rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.slider-content h3 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.slider-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Products Section */
.section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-divider {
    width: 6rem;
    height: 0.25rem;
    background: var(--primary-gradient);
    margin: 0 auto 4rem;
    border-radius: 9999px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-0.5rem);
    box-shadow: var(--shadow-xl);
}

.product-image {
    height: 16rem;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-content {
    padding: 1.5rem;
}

.rating {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.star {
    color: #f59e0b;
    fill: #f59e0b;
    font-size: 0.875rem;
}

.star-empty {
    color: #d1d5db;
    fill: none;
}

.rating-text {
    margin-right: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.product-card:hover .product-name {
    color: #059669;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
}

.add-to-cart-btn {
    background: var(--secondary-gradient);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: scale(1.05);
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: none;
}

.cart-overlay.active {
    display: block;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    left: 0; /* يبدأ من اليسار لأن اللغة RTL */
    height: 100vh;
    width: 100%;
    max-width: 32rem;
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 51;
    transform: translateX(-100%); /* يخفي العربة إلى اليسار */
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.cart-overlay.active .cart-sidebar {
    transform: translateX(0); /* يُظهر العربة */
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.cart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-title i {
    color: #059669;
}

.close-cart {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.close-cart:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.cart-content {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-cart-icon {
    width: 6rem;
    height: 6rem;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #9ca3af;
}

.empty-cart-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-cart-text {
    color: var(--text-secondary);
}

.cart-item {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    align-items: center;
}

.cart-item-image {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    object-fit: cover;
}

.cart-item-info {
    margin-right: 1rem;
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.cart-item-price {
    font-weight: 700;
    color: #059669;
    font-size: 1.125rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 9999px;
    padding: 0.25rem;
    flex-shrink: 0;
}

.quantity-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.quantity-btn:hover {
    background: #f3f4f6;
}

.quantity-value {
    width: 2rem;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
}

.remove-item {
    margin-right: 1rem;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
}

.cart-item:hover .remove-item {
    opacity: 1;
}

.remove-item:hover {
    background: #fee2e2;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(249, 250, 251, 0.5);
    flex-shrink: 0;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.cart-total-value {
    color: #059669;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-label i {
    color: #059669;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: var(--transition);
    direction: rtl; /* For input fields in RTL language */
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-textarea {
    resize: none;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.submit-btn:hover {
    background: var(--primary-gradient-hover);
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.success-message {
    text-align: center;
    padding: 1.5rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #16a34a;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.5rem;
}

.success-text {
    color: var(--text-secondary);
}

/* Floating WhatsApp Button */
.floating-whatsapp {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    background: var(--primary-gradient);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    z-index: 40;
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.whatsapp-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1f2937, #111827);
    color: white;
    padding: 3rem 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e, #86efac);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.footer-text {
    color: #9ca3af;
    max-width: 512px;
    margin: 0 auto 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.footer-link:hover {
    color: white;
}

.footer-copyright {
    color: #6b7280;
    padding-top: 2rem;
    border-top: 1px solid #374151;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-modal:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.modal-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-content p {
    margin-bottom: 1rem;
}

.modal-content p:last-child {
    margin-bottom: 0;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slide {
    /* يُحرك شريط الميزات لليسار بمقدار نصف محتواه لتكرار سلس */
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes slideHero {
    /* تحريك صور الهيرو كل 5 ثواني */
    0%, 20% { transform: translateX(0); }
    25%, 45% { transform: translateX(-25%); }
    50%, 70% { transform: translateX(-50%); }
    75%, 95% { transform: translateX(-75%); }
    100% { transform: translateX(-75%); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        height: 500px;
    }
    
    .hero-title {
        font-size: 1.875rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    .section {
        padding: 2rem 1rem;
    }
    
    .section-title {
        font-size: 1.875rem;
    }
    
    .products-grid {
        /* عمود واحد في الشاشات الصغيرة */
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cart-sidebar {
        /* ملء الشاشة عرضياً في الجوال */
        width: 100%;
        max-width: 100%;
    }
    
    .slider-item {
        min-width: 200px;
        padding: 1rem;
    }
    
    .modal {
        width: 95%;
        padding: 1.5rem;
    }
}