/* =========================================
   7. RESPONSIVE STYLES (Mobile & Tablet)
   ========================================= */

/* -------------------------------------------
   Global Fixes (إصلاحات عامة)
------------------------------------------- */
html, body {
    overflow-x: hidden;
    margin-top: 0 !important;
}

/* -------------------------------------------
   Tablet Devices (بين 768px و 1024px)
------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-section {
        padding-top: 120px;
        justify-content: center !important;
    }
    .hero-glass-card {
        padding: 3rem 2rem;
        width: 80%;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

/* -------------------------------------------
   Mobile Devices (أقل من 768px)
------------------------------------------- */
@media (max-width: 768px) {
    
    /* 1. ضبط الهيدر (Header) */
    .site-header {
        position: absolute !important;
        top: 0 !important;
        left: 0;
        width: 100%;
        padding: 10px 0;
        background-color: transparent;
        z-index: 999;
    }
    /* إصلاح انزياح شريط الأدمن */
    body.admin-bar .site-header { top: 32px !important; }
    @media screen and (max-width: 600px) {
        body.admin-bar .site-header { top: 46px !important; }
        body.admin-bar { margin-top: -46px !important; padding-top: 46px !important; }
    }

    /* 2. ضبط قسم الهيرو (Hero Section) */
    .hero-section {
        background-attachment: scroll !important;
        background-position: center center !important;
        min-height: 100vh;
        height: auto;
        padding-top: 140px !important; 
        padding-bottom: 40px;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }

    /* المربع الزجاجي */
    .hero-glass-card {
        margin: 0 auto !important;
        width: 94% !important;       
        max-width: 500px !important;
        padding: 2rem 1rem !important; 
        border-width: 1px !important;
        border-radius: 10px !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
    }

    .hero-desc {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
        padding: 0 5px;
        opacity: 0.95;
    }

    .hero-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100% !important;
        max-width: 100% !important; 
        padding: 12px !important;
        font-size: 1rem !important;
        min-height: 45px !important;
    }

    .scroll-down-indicator { display: none !important; }

    /* 3. قسم CTA */
    .cta-section {
        padding: 60px 0 !important;
    }
    .cta-title {
        font-size: 1.8rem !important;
        margin-bottom: 30px !important;
    }
    .cta-main-actions, .cta-custom-links {
        flex-direction: column;
        gap: 15px !important;
        width: 100%;
        padding: 0 20px;
    }
    .btn-cta-contact, .btn-cta-outline {
        width: 100%;
        justify-content: center;
        display: flex;
        margin-bottom: 10px;
    }

    /* 4. شبكة المشاريع (Projects Grid) */
    .projects-grid {
        grid-template-columns: 1fr !important; 
        display: grid !important;
        gap: 20px !important;
        padding: 0 5px !important;
        margin-bottom: 30px !important;
    }
    .project-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
    .projects-filter {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 25px !important;
    }
    .filter-btn {
        font-size: 0.85rem !important;
        padding: 6px 15px !important;
    }

    /* 5. صفحة المشروع المفردة */
    .hero-container {
        flex-direction: column !important;
        gap: 30px;
        text-align: center;
    }
    .hero-text-side { order: 2; text-align: center; }
    .hero-img-side { width: 100%; order: 1; margin-bottom: 10px; }
    .project-layout-grid { grid-template-columns: 1fr !important; gap: 40px; }
    .project-content { order: 1; }
    .project-sidebar { order: 2; }
    .project-details-card { position: static; margin-top: 20px; }

    /* 6. الميزات (Features) - عمودين */
    .features-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
    .feature-card { padding: 25px 15px !important; }
    .feature-card .icon { font-size: 2rem !important; margin-bottom: 15px !important; }
    .feature-title { font-size: 1.1rem !important; margin-bottom: 10px !important; }
    .feature-text { font-size: 0.85rem !important; line-height: 1.5 !important; }

    /* 7. معرض الصور (Gallery) */
    .gallery-item {
        flex: 0 0 100% !important; 
        margin: 0 !important;
    }
    .albitar-gallery-wrapper {
        padding: 20px 0;
    }
    .gallery-nav {
        background: rgba(0,0,0,0.6);
        border: none;
        color: #fff;
        width: 35px; height: 35px;
    }
    .gallery-nav.prev { right: 10px; }
    .gallery-nav.next { left: 10px; }

    /* 8. آراء العملاء (Testimonials) */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important; 
    }
    .testi-card {
        padding: 15px 10px !important; 
        display: flex;      
        flex-direction: column;
        justify-content: center;
    }
    .testi-icon {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    .testi-text {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
        display: -webkit-box;         
        -webkit-line-clamp: 4;         
        -webkit-box-orient: vertical; 
        overflow: hidden;             
        text-overflow: ellipsis;      
    }
    .testi-name {
        font-size: 0.85rem !important;
        margin-top: auto;
    }
/* =========================================
       FAQ Section Mobile
       ========================================= */
    .faq-grid {
        /* إجبارها على أن تكون عموداً واحداً في الموبايل */
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .faq-header {
        padding: 15px !important;
        font-size: 1rem !important;
    }

    .faq-content {
        padding: 0 15px 15px !important;
    }
    /* =========================================
       Contact Section Mobile
       ========================================= */
    .contact-overlap-wrapper {
        display: flex !important;
        flex-direction: column-reverse; /* وضع الخريطة في الأسفل والنموذج في الأعلى */
        gap: 0;
    }

    /* الخريطة في الموبايل */
    .contact-map-box {
        width: 100% !important;
        height: 300px !important;
        border-radius: 0 0 10px 10px !important; /* حواف سفلية فقط */
        margin-top: -20px; /* تداخل بسيط عكسي */
    }

    /* البطاقة في الموبايل */
    .contact-form-card {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 10px 10px 0 0 !important;
        padding: 30px 20px !important;
        box-shadow: none !important; /* تخفيف الظل */
        border: 1px solid rgba(255,255,255,0.1) !important;
    }

    /* جعل حقول الإدخال مريحة للموبايل */
    .wpcf7-form-control {
        font-size: 16px !important; /* يمنع الزووم التلقائي في آيفون */
    }
    /* =========================================
       Partners Mobile
       ========================================= */
    .partner-logo {
        width: 100px !important; /* شعارات أصغر في الموبايل */
        height: 70px !important;
    }
    
    .partners-track {
        gap: 30px !important; /* تقليل المسافة */
        animation-duration: 20s !important; /* تسريع الحركة قليلاً لتبدو طبيعية */
    }
    /* صفحة من نحن (موبايل) */
    .overlap-hero-header {
        /* في الموبايل الهيدر أصغر، لذا مسافة 120 تكفي */
        padding-top: 120px !important; 
        padding-bottom: 60px !important;
    }

    .hero-flex-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 30px !important;
    }
    
    .hero-text-col, .hero-image-col {
        text-align: center; width: 100%; justify-content: center;
    }
    
    .overlap-page-title { font-size: 2.5rem !important; }
    
    .overlap-featured-image {
        height: 250px !important; width: 100% !important;
    }

    .overlap-content-grid { grid-template-columns: 1fr !important; }
    /* الصفحات العادية (موبايل) */
    .standard-page-hero {
        height: 250px !important;
    }
    .standard-page-title {
        font-size: 2rem !important;
    }
    .page-content-card {
        padding: 25px 15px !important; /* تقليل الحشوة */
    }
    }
/* تنسيق أيقونات التواصل داخل قائمة الجوال (Overlay) */
.mobile-menu-socials {
    display: flex;
    justify-content: center; /* توسيط الأزرار */
    gap: 15px;
    margin-top: 25px; /* مسافة بين معلومات الاتصال والأزرار */
    padding-top: 20px;
    border-top: 1px solid rgba(150, 150, 150, 0.2); /* خط فاصل خفيف وأنيق */
}

/* في حال كانت خلفية القائمة داكنة، يمكننا جعل الأزرار بيضاء */
.mobile-menu-overlay .albitar-social-icons a {
    color: inherit; /* سيأخذ لون النص الافتراضي للقائمة */
    border-color: currentColor;
}

.mobile-menu-overlay .albitar-social-icons a:hover {
    background-color: var(--primary-color, #007bff);
    color: #fff;
    border-color: var(--primary-color, #007bff);
}