/* custom-mobile-header.css */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    padding-top: 60px; /* Adjust as needed to prevent content from being hidden */
    transition: padding-top 0.3s ease; /* Smooth transition when padding changes */
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 999; /* Just below the mobile menu */
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Header Styles */
header#mobile-header {
    background-color: #fff;
    padding: 15px 0; /* Increased top and bottom padding */
    width: 100%;
    position: fixed; /* Fixed at the top */
    top: 0;
    left: 0;
    z-index: 1001; /* Higher than desktop-header to ensure it's on top */
    transition: padding 0.3s ease;
    display: none; /* Hidden by default, shown via media queries */
}

/* Show Mobile Header on Smaller Screens */
@media (max-width: 768px) {
    header#mobile-header {
        display: flex; /* Display as flex for alignment */
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Adjust the container to stack items vertically */
    header#mobile-header .container {
        display: flex;
        flex-direction: column; /* Stack vertically */
        align-items: center;    /* Center items horizontally */
        justify-content: center;
        width: 100%;
        max-width: 1000px; /* Adjust as needed */
        margin: 0 auto;
        padding: 0 5vw;
    }

    /* Add spacing between logo and hamburger menu */
    .logo-wrapper {
        margin-bottom: 15px; /* Increased spacing */
    }
}

header#mobile-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1000px; /* Adjust as needed */
    margin: 0 auto;
    padding: 0 5vw;
}

/* Logo */
.logo-wrapper img {
    max-height: 40px;
    height: auto;
    width: auto;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 50px; /* Increased width for better touch area */
    height: 40px; /* Increased height for better touch area */
    cursor: pointer;
    z-index: 1002; /* Ensure it's above the menu */
    transition: transform 0.3s ease;
    padding: 10px; /* Added padding for a larger clickable area */
    background: transparent; /* Ensure no background color affects layout */
    border: none; /* Remove default button borders */
    outline: none; /* Remove default button outline */
}

/* Remove Focus Outline from Hamburger Menu */
.menu-toggle:focus {
    outline: none; /* Removes the default focus outline */
    box-shadow: none; /* Removes any box-shadow that might appear */
}

/* Alternatively, for accessibility, add a subtle custom focus indicator */
/*
.menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(254, 122, 32, 0.6);
}
*/

/* Hamburger Lines */
.menu-toggle span {
    display: block;
    width: 100%;
    height: 4px; /* Slightly thicker lines */
    background-color: #000;
    transition: all 0.3s ease;
    border-radius: 2px; /* Rounded edges for better aesthetics */
}

/* Animation for when the menu is active (hamburger to "X") */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Collapsible Mobile Menu */
nav#mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    z-index: 1000;
    padding: 25px; /* Increased padding */
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Show Menu When Active */
nav#mobile-menu.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    animation: slideDown 0.3s ease forwards;
}

/* Style for Active Menu Item */
nav#mobile-menu li a.active {
    background-color: #FE7A20; /* Highlight the active page in orange */
    color: #fff; /* White text for the active item */
    border-radius: 4px; /* Optional rounded corners */
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Menu Items */
nav#mobile-menu ul {
    list-style: none;
    padding: 0;
    width: 100%;
}

nav#mobile-menu li {
    font-size: 18px;
    color: #BDBDBD;
    margin: 0; /* Remove vertical margin */
    width: 100%;
    border-bottom: 1px solid #e0e0e0; /* Divider line */
}

nav#mobile-menu li:last-child {
    border-bottom: none; /* Remove divider from the last item */
}

nav#mobile-menu li a {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    padding: 15px 10px; /* Increased padding */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Remove Blue Border from Menu Items Focus */
nav#mobile-menu li a:focus {
    outline: none; /* Removes the default focus outline */
    box-shadow: none; /* Removes any box-shadow that might appear */
}

/* Alternatively, for accessibility, add a custom focus style */
/*
nav#mobile-menu li a:focus {
    outline: none;
    background-color: #FE7A20;
    color: #fff;
    border-radius: 4px;
}
*/

/* Hover and Active States for Menu Items */
nav#mobile-menu li a:hover,
nav#mobile-menu li a:active {
    background-color: #FE7A20; /* Changes background to orange on hover and active */
    color: #fff; /* Ensures text is readable on colored background */
    border-radius: 4px; /* Slightly rounded corners */
}

/* Style for Active Menu Item */
nav#mobile-menu ul li a.active {
    background-color: #FE7A20 !important; /* Orange background */
    color: #fff !important; /* White text */
    border-radius: 4px !important; /* Slightly rounded corners */
}

/* Responsive Adjustments (Optional) */
@media (max-width: 480px) {
    .menu-toggle {
        width: 45px; /* Slight adjustment if needed */
        height: 35px;
    }

    nav#mobile-menu li {
        font-size: 16px;
    }

    nav#mobile-menu li a {
        padding: 20px 15px; /* Increased padding for touch targets */
    }
}

/* Hide Mobile Header on Larger Screens */
@media (min-width: 769px) {
    header#mobile-header {
        display: none; /* Ensure mobile header is hidden on desktop and larger screens */
    }

    /* Ensure overlay is hidden on larger screens */
    .overlay {
        display: none;
    }
}
