/* Mobile Sidebar Navigation Fixes */
/* This file fixes mobile sidebar issues including close button and layout */

/* Close button for mobile sidebar */
.sidenav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1003;
    display: none; /* Hidden by default - only show on mobile */
    align-items: center;
    justify-content: center;
}

.sidenav-close span {
    position: absolute;
    width: 20px;
    height: 2px;
    background-color: var(--light-color);
    transition: all 0.3s ease;
}

.sidenav-close span:first-child {
    transform: rotate(45deg);
}

.sidenav-close span:last-child {
    transform: rotate(-45deg);
}

.sidenav-close:hover span {
    background-color: #ccc;
}

/* Fix mobile sidebar layout */
@media only screen and (max-width: 768px) {
    /* Prevent body scroll when sidebar is open */
    body.nav-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* Show close button only on mobile */
    .sidenav-close {
        display: flex !important;
    }
    
    .sidenav {
        padding-top: 80px !important; /* Adjust for mobile navbar height */
        height: 100vh !important;
        overflow-y: auto !important; /* Allow scrolling within sidebar if needed */
        padding-bottom: 30px !important; /* More bottom padding to prevent cutoff */
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* Changed from space-between to flex-start */
    }
    
    .nav-links {
        padding: 0 30px !important;
        margin-bottom: 30px !important; /* Reduced from 40px to give more space */
        flex-shrink: 0 !important; /* Prevent shrinking */
    }
    
    .nav-links a {
        font-size: 1.1rem !important;
        padding: 12px 0 !important; /* Slightly reduced padding */
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        display: block !important;
        width: 100% !important;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    /* Fix contact info layout - FORCE proper display */
    .sidenav-contact {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        margin-top: 20px !important; /* Changed from auto to 20px to prevent pushing to bottom */
        flex-shrink: 0 !important;
    }
    
    .sidenav-contact-info {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        padding: 0 30px !important;
        margin-bottom: 30px !important;
    }
    
    .contact-phone,
    .contact-email {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        color: var(--light-color) !important;
        font-size: 0.9rem !important;
        text-decoration: none !important;
        padding: 10px 0 !important;
        width: 100% !important;
    }
    
    .contact-phone:before {
        content: "📞" !important;
        font-size: 1rem !important;
        width: 20px !important;
        display: inline-block !important;
    }
    
    .contact-email:before {
        content: "✉️" !important;
        font-size: 1rem !important;
        width: 20px !important;
        display: inline-block !important;
    }
    
    /* Fix social media icons layout - FORCE proper alignment */
    .sidenav-social {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 0 30px !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }
    
    .sidenav-social-item {
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidenav-social .social-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        background-color: rgba(255, 255, 255, 0.1) !important;
        transition: all 0.3s ease !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .sidenav-social .social-icon:hover {
        background-color: rgba(255, 255, 255, 0.2) !important;
        transform: translateY(-2px) !important;
    }
    
    .sidenav-social .social-logo {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Customer login button */
    .customer-login-btn {
        display: block !important;
        width: calc(100% - 60px) !important;
        margin: 20px 30px !important;
        padding: 12px 20px !important;
        background-color: var(--secondary-color) !important;
        color: var(--light-color) !important;
        text-align: center !important;
        text-decoration: none !important;
        border-radius: 5px !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
    }
    
    .customer-login-btn:hover {
        background-color: var(--accent-color) !important;
        transform: translateY(-1px) !important;
    }
}

/* IMPORTANT: Hide close button on desktop to prevent double buttons */
@media only screen and (min-width: 769px) {
    .sidenav-close {
        display: none !important;
    }
}
