* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #faf8f6;
    color: #2c2c2c;
    padding-bottom: 80px;
    padding-top: 0;           /* إزالة أي مسافة علوية */
}

/* ===== Navbar Desktop ===== */
.navbar-desktop {
    background: #ffffff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 0;         /* إزالة أي مسافة سفلية */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #b5838d;
    font-size: 1.8rem;
    font-weight: 800;
}

.logo i {
    color: #e5989b;
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-family: 'Tajawal', sans-serif;
    background: #f9f9f9;
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #4a4a4a;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #b5838d;
}

.nav-icons {
    display: flex;
    gap: 1.5rem;
    font-size: 1.3rem;
    color: #4a4a4a;
    cursor: pointer;
}

/* ===== Mobile Navbar ===== */
.navbar-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 10px 20px;
    justify-content: space-around;
    z-index: 1000;
    border-top: 1px solid #eee;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: #888;
    cursor: pointer;
    transition: 0.3s;
}

.mobile-nav-item i {
    font-size: 1.3rem;
}

.mobile-nav-item.active {
    color: #b5838d;
}

/* ===== سلايدر الإعلانات (تم تعديله لتحسين الصور والمسافات) ===== */
.ads-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
    margin: 0;                /* إزالة أي هامش علوي */
    padding: 0;
}

.ads-slider {
    position: relative;
    width: 100%;
    height: auto;
}

.ads-slider .ad-slide {
    width: 100%;
    display: none;
}

.ads-slider .ad-slide.active {
    display: block;
}

/* تحسين عرض الصور: استخدام contain مع max-height */
.ad-slide img {
    width: 100%;
    max-width: 1200px;        /* الحد الأقصى للعرض */
    height: auto;             /* ارتفاع تلقائي يحافظ على النسبة */
    max-height: 450px;        /* الحد الأقصى للارتفاع (يمكنك تعديله) */
    object-fit: contain;      /* إظهار الصورة كاملة بدون قص */
    display: block;
    margin: 0 auto;           /* توسيط الصورة */
    background: #f5f5f5;
}

.ad-text {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 20px;
    border-radius: 40px;
    z-index: 15;
    font-size: 1rem;
    max-width: 80%;
    text-align: center;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
}

.slider-btn.prev {
    right: 10px;
}

.slider-btn.next {
    left: 10px;
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 10;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: white;
}

/* ===== شبكة الفئات ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.category-card {
    background: white;
    border-radius: 20px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.category-card h4 {
    font-size: 0.9rem;
    color: #4a4a4a;
}

/* ===== نافذة المنتجات ===== */
.products-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    z-index: 1100;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5989b;
}

.close-products {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #b5838d;
}

.scroll-products {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem 0.5rem;
    scroll-behavior: smooth;
}

.scroll-products::-webkit-scrollbar {
    height: 6px;
}

.scroll-products::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scroll-products::-webkit-scrollbar-thumb {
    background: #e5989b;
    border-radius: 10px;
}

.product-card {
    min-width: 180px;
    width: 180px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: 0.3s;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.product-info {
    padding: 0.7rem;
}

.product-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.product-price {
    color: #e5989b;
    font-weight: 600;
}

.product-oldprice {
    text-decoration: line-through;
    font-size: 0.7rem;
    color: #aaa;
    margin-right: 0.5rem;
}

.product-desc {
    font-size: 0.7rem;
    color: #777;
    margin-top: 0.3rem;
}

/* ===== نافذة تفاصيل المنتج ===== */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    direction: rtl;
}

.product-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 30px;
    padding: 1.5rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    left: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #b5838d;
}

.payment-options {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.whatsapp-btn,
.qrcode-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-btn {
    background: #25d366;
    color: white;
}

.qrcode-btn {
    background: #b5838d;
    color: white;
}

#qrcodeContainer {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 20px;
    text-align: center;
}

/* ===== مودال التواصل ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content a {
    color: #b5838d;
    text-decoration: none;
}

.close {
    float: left;
    font-size: 28px;
    cursor: pointer;
}

/* ===== فوتر ===== */
.footer {
    background: #2c2c2c;
    color: #ccc;
    margin-top: 2rem;
    direction: rtl;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: #e5989b;
    margin-bottom: 1rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-section a:hover {
    color: #e5989b;
}

.footer-section i {
    margin-left: 8px;
    color: #e5989b;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.social-icons a {
    color: #ccc;
    font-size: 1.3rem;
    transition: 0.3s;
}

.social-icons a:hover {
    color: #e5989b;
}

.footer-bottom {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #444;
    font-size: 0.75rem;
}

.footer-bottom strong {
    color: #e5989b;
}

/* ===== استجابة للشاشات ===== */
@media (max-width: 1200px) {
    .ad-slide img {
        max-height: 350px;
    }
}

@media (max-width: 992px) {
    .ad-slide img {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .navbar-desktop {
        display: none;
    }

    .navbar-mobile {
        display: flex;
    }

    .ad-slide img {
        max-height: 200px;
    }

    .ad-text {
        top: 10px;
        font-size: 0.7rem;
        padding: 4px 12px;
        max-width: 90%;
        .slider-dots{
            bottom: 5px;
        }
    }

    .slider-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .category-card img {
        width: 55px;
        height: 55px;
    }

    .category-card h4 {
        font-size: 0.75rem;
    }

    .product-card {
        min-width: 150px;
        width: 150px;
    }

    .product-img {
        height: 140px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .payment-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* إضافة أنماط شريط البحث للجوال */
.mobile-search-bar {
    display: none;
    padding: 10px 15px;
    background: white;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 999;
}

.mobile-search-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9f9f9;
    border-radius: 50px;
    border: 1px solid #ddd;
    padding: 5px 15px;
}

.mobile-search-container i {
    color: #aaa;
    font-size: 1rem;
}

.mobile-search-container input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 5px;
    display: none;
}

.clear-search-btn:hover {
    color: #e5989b;
}

.mobile-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 5px;
    display: none;
}

/* للشاشات الصغيرة */
@media (max-width: 768px) {
    .navbar-desktop {
        display: none;
    }
    .mobile-search-bar {
        display: block;
    }
    .navbar-mobile {
        display: flex;
    }
    /* شريط علوي للجوال (بدون sticky) */
.mobile-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background-color: white;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.mobile-logo a {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #b5838d;
    padding: 6px 12px;
    border-radius: 40px;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
    transition: 0.3s;
}

.mobile-logo a:hover {
    background-color: #9e6f7a;
}

.mobile-logo i {
    font-size: 1rem;
}

.mobile-search-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 50px;
    padding: 5px 15px;
}

.mobile-search-container i {
    color: #aaa;
    font-size: 0.9rem;
}

.mobile-search-container input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 0.9rem;
    font-family: 'Tajawal', sans-serif;
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 5px;
    display: none;
}

.clear-search-btn:hover {
    color: #e5989b;
}

/* صناديق الاقتراحات */
.mobile-suggestions {
    background: white;
    border: 1px solid #ddd;
    border-radius: 15px;
    margin: 5px 15px 0 15px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* إخفاء هذا الشريط على الشاشات الكبيرة */

    /* تعديلات أخرى موجودة سابقاً */
}

/* باقي الأنماط (الإعلانات، الفئات، المنتجات، إلخ) تبقى كما هي دون تغيير */
/* تأكد من نسخ باقي الـ CSS من ملفك القديم الذي يعمل بشكل جيد */

/* تحسين شكل الاقتراحات */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 8px;
    border: 1px solid #eee;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #333;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f9f9f9;
    padding-right: 20px; /* حركة بسيطة عند المرور */
}

/* للجوال */
.mobile-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
    display: none;
    border: 1px solid #eee;
}
@media (min-width: 769px) {
    .mobile-header {
        display: none;
    }
}