/* Mobile menu backdrop for Happy Pets website */
.menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Base hamburger styles - always applied */
.hamburger {
  display: none !important;
}

.bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 2px 0;
    background-color: #333;
    transition: all 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Improved mobile menu styles */
@media (max-width: 768px) {
    .header {
        position: relative;
    }
    
    /* Show hamburger menu on mobile */
    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        width: 30px !important;
        height: 24px !important;
        padding: 0 !important;
        margin: 10px !important;
        z-index: 1000 !important;
        position: relative !important;
        cursor: pointer !important;
        background: transparent !important;
    }
    
    .hamburger span {
    display: block !important;
    width: 100% !important;
    height: 4px !important;
    background-color: #333 !important;
    border-radius: 3px !important;
    position: relative !important;
    z-index: 1001 !important;
    margin: 4px 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}
    
    /* Override for menu positioning */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #101010;
        flex-direction: column;
        padding: 80px 20px 20px;
        transition: all 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 99;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        padding-left: 0;
    }
    
    .nav-item {
        margin: 12px 0;
        margin-left: 0;
        width: 100%;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        padding-bottom: 12px;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        font-size: 16px;
        padding: 8px 0;
        width: 100%;
    }
    
    .social-nav {
        margin-top: 30px;
        margin-left: 0;
        display: flex;
        justify-content: center;
    }
      .social-icon {
        margin: 0 10px;
    }
    
    /* Fix for hamburger button */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 24px;
        cursor: pointer;
        z-index: 1000;
    }
    
    .bar {
        width: 25px;
        height: 3px;
        background-color: var(--dark-color);
        transition: all 0.3s ease;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .nav-menu {
        width: 85%;
        padding-top: 60px;
    }
    
    .logo img {
        height: 40px; /* Smaller logo on mobile */
    }
    
    .hamburger {
        padding: 8px;
    }
    
    .bar {
        width: 22px;
        height: 2px;
    }
    
    /* Improve touch targets for mobile */
    .nav-link {
        padding: 12px 0;
        font-size: 18px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
}

/* Landscape mode fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        padding-top: 50px;
        overflow-y: auto;
    }
    
    .nav-item {
        margin: 5px 0;
        padding-bottom: 5px;
    }
    
    .nav-link {
        padding: 5px 0;
        font-size: 16px;
    }
    
    .social-nav {
        margin-top: 15px;
    }
}
