/**
 * Site-Wide Mobile Menu
 * Styles for mobile menu that appears on all pages in mobile view
 * Completely isolated from the site's desktop menu
 */

/* Hide the old mobile menu button immediately */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        z-index: -1 !important;
    }
}

/* Only show on mobile devices */
@media (min-width: 769px) {
    .site-mobile-btn,
    .site-mobile-menu,
    .site-menu-overlay {
        display: none !important;
    }
}

/* Menu button styles */
.site-mobile-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    background-color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    overflow: visible;
    aspect-ratio: 1/1;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/* Hamburger icon - simple 3-line version */
.site-hamburger {
    width: 24px;
    height: 18px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Ensure each line is properly positioned */
.site-hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    left: 0;
}

/* Remove the positioning for the standard 3-line hamburger */
.site-hamburger span:nth-child(1),
.site-hamburger span:nth-child(2),
.site-hamburger span:nth-child(3) {
    position: static;
}

/* Hamburger animation */
.site-mobile-btn.open .site-hamburger span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.site-mobile-btn.open .site-hamburger span:nth-child(2) {
    opacity: 0;
}

.site-mobile-btn.open .site-hamburger span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Menu panel styles */
.site-mobile-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: left 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    color: #333333;
}

/* Critical selectors to ensure menu items are visible */
.site-mobile-menu * {
    visibility: visible !important;
    display: block !important;
    opacity: 1 !important;
}

.site-mobile-menu .fas,
.site-mobile-menu .fa-home,
.site-mobile-menu .fa-cogs,
.site-mobile-menu .fa-th-large,
.site-mobile-menu .fa-info-circle,
.site-mobile-menu .fa-envelope,
.site-mobile-menu .fa-seedling,
.site-mobile-menu .fa-apple-alt,
.site-mobile-menu .fa-leaf,
.site-mobile-menu .fa-tint,
.site-mobile-menu .fa-phone {
    display: inline-block !important;
}

/* Ensure menu items are visible */
.site-mobile-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0 0 20px;
}

.nav-list {
    margin: 0 0 15px;
    padding: 0;
    list-style: none;
    display: block !important;
}

.nav-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: block !important;
}

.nav-list a {
    display: block !important;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    position: relative;
}

.nav-list a.active {
    color: #4CAF50;
    font-weight: 700;
    border-left: 3px solid #4CAF50;
    background-color: rgba(76, 175, 80, 0.1);
}

/* Navigation category headers */
.nav-category {
    padding: 5px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-top: 15px;
    font-weight: 600;
    background-color: rgba(0,0,0,0.03);
    display: block !important;
}

/* CTA button */
.cta-button {
    display: block !important;
    margin: 20px;
    padding: 12px;
    background-color: #4CAF50;
    color: white !important;
    text-align: center;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

.cta-button:hover {
    background-color: #3c9f40;
}

/* Menu open state */
.site-mobile-menu.open {
    left: 0;
}

/* Logo section */
.site-menu-logo {
    text-align: center;
    margin-bottom: 15px;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: block !important;
}

.site-menu-logo img {
    max-width: 150px;
    height: auto;
    display: inline-block !important;
}

/* Close button */
.site-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #4CAF50;
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: rgba(0,0,0,0.05);
    border-radius: 50%;
    z-index: 10001;
}

/* Overlay styles */
.site-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.site-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when menu is open */
body.site-menu-open {
    overflow: hidden;
}

/* Font Awesome icons in menu */
.site-mobile-nav .fas {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #4CAF50;
    display: inline-block !important;
}

/* Explicitly override any hidden classes */
.site-mobile-menu .hidden,
.site-mobile-menu .d-none,
.site-mobile-menu [hidden],
.site-mobile-menu [style*="display: none"],
.site-mobile-menu [style*="visibility: hidden"],
.site-mobile-menu [style*="opacity: 0"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide the default mobile menu button on all pages in mobile view */
@media (max-width: 768px) {
    /* HIDE the default mobile menu button */
    .mobile-menu-btn {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important; /* Prevent any clicks */
    }
    
    /* Hide the navigation menu itself */
    header nav.mobile-active {
        display: none !important;
    }
    
    /* Fix the white space between header and content */
    header {
        overflow: visible !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* Hide any overlay from the old menu */
    #mobile-menu-overlay {
        display: none !important;
    }
} 