/* Mobile Responsive Styles for Header, WhatsApp, and Social Icons - FIXED VERSION */

/* Global mobile fixes */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Header Section Adjustments - FIXED */
@media (max-width: 768px) {
    .header {
        position: absolute !important;
        height: 180px;
        top: 0;
        width: 100%;
        max-width: 100%;
        z-index: 1000;
        background: var(--white);
        box-shadow: var(--shadow);
    
        overflow: hidden; /* Prevent content overflow */
    }

    .navbar {
        padding: 0.6rem 1rem;
        display: flex;
        flex-wrap: wrap;
        margin-top: -100px;
        align-items: center;
        justify-content: space-between;
        position: relative;
        max-width: 100%;
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .logo {
        flex: 0 0 auto;
        order: 1;
        max-width: 50%;
    }

    .logo-image {
        max-width: 140px;
        width: 100%;
        height: auto;
        margin: 0.5rem 0;
        display: block;
    }

        .mobile-toggle {
        display: block;
        order: 3;
        background: var(--primary-color-1);
        color: white;
        border-radius: 6px;
        padding: 0.5rem;
        font-size: 1.2rem;
        line-height: 1;
        min-height: 40px;
        min-width: 40px;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
        flex: 0 0 auto;
        margin-top: -20px;
      
    }

    .language-toggle {
        order: 2;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border-radius: 20px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0.5rem 0;
        flex: 0 0 auto;
        max-width: 80px;
    }

    .nav-links {
        position: fixed;
        top: 80px; /* تبدأ بعد الهيدر مباشرة */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.85); /* خلفية شبه شفافة */
        backdrop-filter: blur(1.5px); /* تأثير الضبابية الزجاجية */
        -webkit-backdrop-filter: blur(12px); /* للتأكد من التوافق مع سفاري */
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.27);
        border-radius: 0 0 16px 16px;
        z-index: 999;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-top: 0;
        border: 1px solid rgba(255, 255, 255, 0.3); /* حدود شفافة */        
        display: flex;
        opacity: 0;
        visibility: hidden;
      
    }

    .nav-links.active {
      
         opacity: 1;
        visibility: visible;
       
    }

    .nav-links a {
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        text-align: center;
        border-radius: 8px;
        margin-bottom: 0.5rem;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.15); /* خلفية شبه شفافة لكل عنصر */
        color: #333;
        font-weight: 600;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links a:hover {
        background: rgba(13, 111, 179, 0.2);
        color: var(--primary-color-1);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    

    .nav-links a:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
}

/* Extra small screens adjustments */
@media (max-width: 480px) {
    
    .navbar {
        padding: 0.5rem 0.8rem;
        
    }

    .logo-image {
        max-width: 110px;
        margin: 0.4rem 0;
    }

    .mobile-toggle {
        padding: 0.4rem;
        font-size: 1.1rem;
        min-height: 36px;
        min-width: 36px;
    }

    .nav-links a {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .language-toggle {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-height: 36px;
        max-width: 70px;
    }
}

/* WhatsApp Float Adjustments */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        -webkit-tap-highlight-color: transparent;
        z-index: 1001;
    }

    .whatsapp-float:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 12px;
        right: 12px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Social Sidebar Adjustments */
@media (max-width: 768px) {
    .social-sidebar {
        position: fixed;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 1rem;
        z-index: 1000;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .social-link:hover {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .social-sidebar {
        flex-direction: column;
        gap: 0.6rem;
        left: 12px;
    }

    .social-link {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Ensure proper spacing for content */
@media (max-width: 768px) {
    .section {
        padding-top: 5rem;
        padding-bottom: 4rem;
        padding-left: 1rem;
        padding-right: 1rem;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix hero section spacing */
    .hero {
        margin-top: 0;
        padding-top: 80px; /* Account for fixed header */
        min-height: calc(100vh - 80px);
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .hero-content {
        max-width: 100%;
        padding: 1rem;
        box-sizing: border-box;
    }
}

/* Animation for nav-links */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Additional fixes for container widths */
@media (max-width: 768px) {
    .container,
    .container-fluid {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }
    
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .col-lg-6,
    .col-md-6,
    .col-lg-4,
    .col-md-4,
    .col-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Prevent horizontal scroll issues */
@media (max-width: 768px) {
    body {
        position: relative;
        overflow-x: hidden;
    }
    
    
    
    .hero,
    .section {
        position: relative;
        overflow-x: hidden;
    }
}

