/* 
 * Simple Mobile Navigation
 * A clean, logical mobile navigation sidebar
 */

/* Additional fix for sidebar-close-btn */
.sidebar-close-btn {
    position: absolute !important;
    right: 15px !important; /* Use right instead of left for RTL layout */
    top: 15px !important;
    left: auto !important; /* Ensure left is not set */
    width: 36px !important;
    height: 36px !important;
    z-index: 1002 !important;
}

/* Global rule to hide sidebar close buttons on desktop */
@media (min-width: 992px) {
    .sidebar-close-btn,
    button[aria-label="Close menu"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: 0 !important; /* Changed from -9999px to prevent horizontal scrolling */
        top: 0 !important; /* Changed from -9999px to prevent vertical scrolling */
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
}

/* Fix horizontal scrolling issues */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
    position: relative;
    width: 100%;
}

/* Ensure all elements stay within viewport width */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix container width issues */
.container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

/* Fix row overflow issues */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
}

/* Fix specific issues on about.html page */
.about-section,
.mission-vision-section,
.goals-section,
.company-description-section,
.values-section,
.stats-section {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Basic navbar styling */
.navbar {
    padding: 12px  0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    height: 40px;
}

/* Custom toggle button */
.mobile-toggle {
    border: none;
    background: transparent;
    padding: 10px;
    cursor: pointer;
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 15px;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile navigation */
@media (max-width: 991.98px) {
    /* Show mobile toggle */
    .mobile-toggle {
        display: block;
    }
    
    /* Hide Bootstrap navbar elements on mobile but don't remove them */
    .navbar-collapse {
        visibility: hidden;
        height: 0;
        overflow: hidden;
        width: 0;
        padding: 0;
        margin: 0;
    }
    
    .navbar-toggler {
        display: none !important;
    }
    
    /* Hide desktop navbar items */
    .navbar .navbar-nav {
        visibility: hidden;
        height: 0;
        overflow: hidden;
    }
    
    /* Hide desktop contact button */
    .navbar .d-flex.align-items-center {
        visibility: hidden;
        height: 0;
        overflow: hidden;
    }
}

/* Desktop navbar styles */
@media (min-width: 992px) {
    /* Hide mobile toggle on desktop */
    .mobile-toggle {
        display: none !important;
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu, 
    .menu-overlay,
    .mobile-menu *,
    .menu-header,
    .menu-content,
    .menu-footer {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Hide mobile close button on desktop */
    .menu-close,
    button[data-mobile-only="true"],
    .menu-header button,
    .mobile-menu button,
    .sidebar-close-btn,
    button[aria-label="Close menu"],
    button[type="button"][aria-label="Close menu"] {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        left: 0 !important; /* Changed from -9999px to prevent horizontal scrolling */
        top: 0 !important; /* Changed from -9999px to prevent vertical scrolling */
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Show desktop navbar items */
    .navbar .navbar-nav {
        display: flex !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Show desktop contact button */
    .navbar .d-flex.align-items-center {
        display: flex !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Ensure Bootstrap's navbar-collapse is visible */
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        visibility: visible !important;
        height: auto !important;
        width: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Make sure navbar-nav items are visible */
    .navbar-nav .nav-item {
        display: block !important;
    }
    
    .navbar-nav .nav-link {
        display: block !important;
        padding: 0.5rem 1rem;
    }
}
    
    /* Body styling when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Mobile sidebar */
    .mobile-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #fff;
        z-index: 9999;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-menu.active {
        left: 0;
    }
    
    /* Menu header */
    .menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px;
        border-bottom: 1px solid #eee;
    }
    
    .menu-header .logo img {
        height: 35px;
    }
    
    .menu-close {
        background: transparent;
        border: none;
        font-size: 24px;
        color: #666;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s ease;
    }
    
    .menu-close:hover {
        background-color: #f5f5f5;
        color: #333;
    }
    
    /* Menu content */
    .menu-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px 0;
        /* Hide scrollbar */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .menu-content::-webkit-scrollbar {
        display: none;
    }
    
    /* Navigation links */
    .mobile-nav {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .mobile-nav li {
        margin-bottom: 5px;
        width: 100%;
    }
    
    .mobile-nav a {
        display: block;
        padding: 12px 20px;
        color: #333;
        text-decoration: none;
        font-size: 16px;
        transition: all 0.2s ease;
        width: 100%;
        text-align: right;
    }
    
    .mobile-nav a:hover,
    .mobile-nav a.active {
        background-color: #f5f5f5;
    }
    
    /* Contact buttons */
    .menu-footer {
        padding: 20px;
        border-top: 1px solid #eee;
    }
    
    .contact-buttons .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 4px;
        font-weight: 500;
    }
    
    .contact-buttons .btn:last-child {
        margin-bottom: 0;
    }
    
    .contact-buttons .btn i {
        margin-left: 8px;
        font-size: 18px;
    }
    
    /* WhatsApp button */
    .btn-whatsapp {
        background-color: #25D366;
        border-color: #25D366;
        color: white;
    }
    
    .btn-whatsapp:hover {
        background-color: #128C7E;
        border-color: #128C7E;
        color: white;
    }
    
    /* Overlay */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0);
        z-index: 9998;
        display: none;
    }
    
    .menu-overlay.active {
        display: block;
    }
} 