/* Responsivo */

/* Hamburger Menu - Hidden by default */
.hamburger-menu {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10001; /* above overlay */
    background: linear-gradient(90deg, rgb(68 55 40) 0%, rgb(65 38 7) 35%, rgb(137 92 24) 100%);
    color: white;
    border: 1px solid #5e3100;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0px 0px 11px #000000;
}

.hamburger-menu:hover {
    background: linear-gradient(90deg, rgb(78 65 50) 0%, rgb(75 48 17) 35%, rgb(147 102 34) 100%);
}

.hamburger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    margin: 4px 0;
}

/* Mobile Sidebar Overlay */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    will-change: opacity;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    transform: translateX(-100%) translateZ(0);
    transition: transform 0.2s ease;
    overflow-y: auto;
    border-right: 2px solid #5e3100;
    will-change: transform;
    /* Aceleração por hardware combinada com translateX */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-sidebar.active {
    transform: translateX(0) translateZ(0);
}

.mobile-sidebar-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
}

.mobile-menu-content {
    padding: 70px 10px 20px 10px;
}

.mobile-menu-content .sidebar-module {
    margin-bottom: 10px;
}

/* Hide elements on mobile */
.NotOnMobile {
    display: inline;
}

@media screen and (max-width: 1024px) {
    .page-wrapper {
        max-width: 100%;
        padding: 0 10px;
    }

    
    .menu-header {
        font-size: 10px;
        height: 30px;
        padding: 0 8px;
    }
    
    .menu-icon {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }
    
    .site-logo {
        max-height: 150px;
    }
    
    .top-navigation {
        height: 60px;
        padding: 0 10px;
    }
    
    .nav-left, .nav-right {
        gap: 5px;
    }
    
    .nav-item img {
        max-height: 30px;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .hamburger-menu {
        display: block;
    }
    
    .main-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sidebar-left, .sidebar-right {
        display: none;
    }
    
    /* Garantir que mobile-sidebar esteja escondido por padrão */
    .mobile-sidebar:not(.active) {
        transform: translateX(-100%) translateZ(0) !important;
    }
    
    .site-header {
        margin-top: 60px;
    }
    
    .logo-row {
        justify-content: center;
    }
    
    .site-logo {
        max-height: 120px;
    }
    
    .top-navigation {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    
    .nav-left, .nav-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-item img {
        max-height: 25px;
    }
    
    .online-status {
        order: -1;
        margin-bottom: 10px;
    }
    
    .info-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .NotOnMobile {
        display: none;
    }
    
    .content-area {
        padding: 0px;
    }
}

@media screen and (max-width: 480px) {
    .site-logo {
        max-height: 100px;
    }
    
    .nav-item img {
        max-height: 20px;
    }
    
    .content-area {
        padding: 0px;
    }
    
    /* Fix: do not shift sidebar with left:-100%; we use transform for animation */
    .mobile-sidebar {
        width: 100%;
        left: 0; /* ensure aligned to viewport */
    }
    
    .hamburger-menu {
        top: 10px;
        left: 10px;
        padding: 8px;
        font-size: 16px;
    }
}

/* Landscape phones */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .site-header {
        margin-top: 70px;
    }
    
    .site-logo {
        max-height: 80px;
    }
    
    .top-navigation {
        height: 50px;
        padding: 5px;
    }
}

/* Mobile menu - final overrides (IDs) - REMOVIDO CONFLITO */
/* Desktop: manter fechado apenas quando NÃO estiver ativo */
@media (min-width: 769px) {
  .mobile-sidebar-overlay:not(.active) { opacity: 0; visibility: hidden; pointer-events: none; }
  .mobile-sidebar:not(.active) { transform: translateX(-100%); }
  .hamburger-menu { display: none !important; }
}
