/**
 * GREEN SOLARTECH - Mobile Menu Fix
 * Enhanced mobile menu styles for better functionality
 */

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Side Widget Mobile Menu */
.side-widget {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 85%;
    height: 100vh;
    background: #fff;
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
}

.side-widget.active {
    left: 0;
}

.side-widget .inner {
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Mobile Menu Visibility */
.side-widget .show-mobile {
    display: block !important;
}

.side-widget .hide-mobile {
    display: none !important;
}

/* Mobile Menu Items */
.side-widget .site-menu {
    margin: 20px 0;
}

.side-widget .site-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-widget .site-menu ul li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
}

.side-widget .site-menu ul li:last-child {
    border-bottom: none;
}

.side-widget .site-menu ul li a {
    display: block;
    padding: 15px 10px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.side-widget .site-menu ul li a:hover {
    color: #2d8a3e;
    padding-left: 20px;
    background: #f8f8f8;
}

.side-widget .site-menu ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: #2d8a3e;
    transition: width 0.3s ease;
}

.side-widget .site-menu ul li a:hover::before {
    width: 10px;
}

/* Widget Title */
.side-widget .widget-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d8a3e;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* Contact Info in Mobile Menu */
.side-widget .address {
    margin: 20px 0;
}

.side-widget .address p {
    margin: 10px 0;
    line-height: 1.8;
}

.side-widget .address a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.side-widget .address a:hover {
    color: #2d8a3e;
}

/* Copyright in Mobile Menu */
.side-widget small {
    margin-top: auto;
    padding-top: 20px;
    color: #999;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

/* Hamburger Menu Animation */
.hamburger-menu {
    display: none;
    position: relative;
    width: 30px;
    height: 24px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.hamburger-menu span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: #333;
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: all 0.3s ease;
}

.hamburger-menu span:nth-child(1) {
    top: 0;
}

.hamburger-menu span:nth-child(2) {
    top: 10px;
}

.hamburger-menu span:nth-child(3) {
    top: 20px;
}

/* Hamburger Open State */
.hamburger-menu.open span:nth-child(1) {
    top: 10px;
    transform: rotate(135deg);
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.hamburger-menu.open span:nth-child(3) {
    top: 10px;
    transform: rotate(-135deg);
}

/* Body when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
    .hamburger-menu {
        display: block;
    }
    
    .navbar .site-menu {
        display: none;
    }
    
    .side-widget .show-mobile {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .hamburger-menu {
        display: none !important;
    }
    
    .side-widget {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        display:none
    }
    
    .side-widget.active {
        left: auto;
    }
    
    .menu-overlay {
        display: none !important;
    }
    
    .side-widget .show-mobile {
        display: none !important;
    }
    
    .side-widget .hide-mobile {
        display: block !important;
    }
}

/* Smooth Scrolling for Mobile Menu */
.side-widget {
    -webkit-overflow-scrolling: touch;
}

/* Close Button (Optional) */
.side-widget .close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: none;
}

@media (max-width: 991px) {
    .side-widget .close-menu {
        display: block;
    }
}

.side-widget .close-menu::before,
.side-widget .close-menu::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

.side-widget .close-menu::before {
    transform: translateY(-50%) rotate(45deg);
}

.side-widget .close-menu::after {
    transform: translateY(-50%) rotate(-45deg);
}

.side-widget .close-menu:hover::before,
.side-widget .close-menu:hover::after {
    background: #2d8a3e;
}

/* Animation for menu items */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.side-widget.active .site-menu ul li {
    animation: slideInLeft 0.3s ease forwards;
}

.side-widget.active .site-menu ul li:nth-child(1) { animation-delay: 0.1s; }
.side-widget.active .site-menu ul li:nth-child(2) { animation-delay: 0.15s; }
.side-widget.active .site-menu ul li:nth-child(3) { animation-delay: 0.2s; }
.side-widget.active .site-menu ul li:nth-child(4) { animation-delay: 0.25s; }
.side-widget.active .site-menu ul li:nth-child(5) { animation-delay: 0.3s; }
.side-widget.active .site-menu ul li:nth-child(6) { animation-delay: 0.35s; }
.side-widget.active .site-menu ul li:nth-child(7) { animation-delay: 0.4s; }
