/**
 * Mobile Menu Fix CSS
 * Last Updated: 2024-12-28
 * Author: GaryH
 * 
 * Simple mobile menu enhancement that works with existing Edify template
 */

/* Ensure mobile menu button is always visible on small screens */
@media (max-width: 1199px) {
    /* Force show the menu button */
    #cssmenu #menu-button {
        display: block !important;
        background: #15a0cb;
        color: white;
        padding: 12px 15px;
        cursor: pointer;
        font-weight: bold;
        text-align: center;
        border-radius: 4px;
        margin: 10px;
        transition: background 0.3s ease;
    }
    
    #cssmenu #menu-button:hover {
        background: #505050;
    }
    
    /* Ensure the menu is properly styled */
    #cssmenu.small-screen {
        width: 100%;
    }
    
    #cssmenu.small-screen > ul {
        display: none;
        background: #f8f9fa;
        width: 100%;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        border-radius: 4px;
        margin: 10px;
        max-height: 400px;
        overflow-y: auto;
    }
    
    #cssmenu.small-screen > ul.open {
        display: block !important;
    }
    
    #cssmenu.small-screen ul li {
        width: 100%;
        border-bottom: 1px solid #e9ecef;
    }
    
    #cssmenu.small-screen ul li a {
        display: block;
        padding: 12px 15px;
        color: #333;
        text-decoration: none;
        transition: background 0.2s ease;
    }
    
    #cssmenu.small-screen ul li a:hover {
        background: #e9ecef;
        color: #15a0cb;
    }
    
    /* Submenu styling */
    #cssmenu.small-screen .submenu-button {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        background: #15a0cb;
        color: white;
        border: none;
        border-radius: 3px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #cssmenu.small-screen .submenu-button:after {
        content: '+';
        font-size: 16px;
        font-weight: bold;
    }
    
    #cssmenu.small-screen .submenu-button.submenu-opened:after {
        content: '-';
    }
    
    /* Submenu items */
    #cssmenu.small-screen ul ul {
        position: relative;
        left: 0;
        width: 100%;
        background: #f1f3f4;
        display: none;
    }
    
    #cssmenu.small-screen ul ul.open {
        display: block !important;
    }
    
    #cssmenu.small-screen ul ul li a {
        padding-left: 30px;
        font-size: 14px;
        background: #f8f9fa;
    }
    
    #cssmenu.small-screen ul ul li a:hover {
        background: #e9ecef;
    }
}

/* Desktop - hide mobile elements */
@media (min-width: 1200px) {
    #cssmenu #menu-button {
        display: none !important;
    }
    
    #cssmenu > ul {
        display: flex !important;
    }
}

/* Ensure header elements are properly sized on mobile */
@media (max-width: 768px) {
    /* Override any fixed widths so logo scales naturally */
    .header .logo img,
    .header-content .logo img,
    .header-content-center .logo img,
    .sticky-header-content .logo img,
    .header-container .logo img {
        max-height: 50px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .header-container .search-form input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .header-container .header-actions a {
        padding: 8px 10px;
        font-size: 12px;
    }
}
