/* 
  mobile.css - SEMA GRUPO 
  Dedicated styles for screens <= 768px
*/

/* Reset basic layout for mobile */
body {
    overflow-y: auto; /* Allow body scrolling if app-container isn't fixed */
    height: auto;
}

.app-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
}

/* Oculta Sidebar no Mobile */
.sidebar, .admin-sidebar {
    display: none !important;
}

/* Novo Botão Hambúrguer */
.btn-hamburger {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

/* Barra de Status do Usuário no Mobile (Vitrine) */
/* Barra de Status do Usuário no Mobile (Vitrine) - Removido por duplicata consolidada no style.css */

.mobile-user-info, .mobile-robot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.mobile-user-info i {
    color: var(--primary);
    font-size: 1.2rem;
}

.mobile-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-robot-status i {
    color: #f97316;
    font-size: 1rem;
}

/* Logo Centralizada no Mobile */
.mobile-logo-central {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo-central span {
    color: var(--primary);
}

/* Menu Lateral (Drawer) */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #0f172a;
    z-index: 10001;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
    display: flex !important;
    flex-direction: column;
}

.mobile-menu-drawer.hidden {
    transform: translateX(-100%);
    display: flex !important; /* Mantém no DOM para animação */
    pointer-events: none;
}

.drawer-header {
    padding: 20px;
    background: rgba(255,255,255,0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

#btn-close-drawer, #btn-close-admin-drawer {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
}

.drawer-nav {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-nav button {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 15px;
    text-align: left;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
}

.drawer-nav button i {
    width: 20px;
    color: var(--primary);
}

.drawer-nav button:active {
    background: rgba(255,255,255,0.05);
}

.drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 10px 0;
}

.btn-drawer-logout {
    color: #ef4444 !important;
    font-weight: bold;
    margin-top: 20px;
}

.btn-admin-only {
    background: rgba(249, 115, 22, 0.1) !important;
    color: #f97316 !important;
    font-weight: bold !important;
    border: 1px solid rgba(249, 115, 22, 0.2) !important;
}

.btn-admin-only i {
    color: #f97316 !important;
}

.btn-admin-only.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    /* Controle de Categorias (Trazido do index.html para limpar) */
    .category-pills {
        display: none !important;
    }
    /* Controle de Categorias - Removido por duplicata consolidada no style.css */
    /* Redirecionado para style.css */

    /* Trava de scroll lateral definitiva */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
}

.sidebar nav button i {
    font-size: 1.2rem;
}

.sidebar nav button span {
    display: block;
}

.sidebar nav button.active {
    background: transparent;
    color: var(--primary);
}

/* Main Content Adjustments */
main {
    padding: 15px;
    padding-top: 80px; /* Space for mobile-top-bar */
    padding-bottom: 90px; /* Space for bottom nav */
    height: auto;
    overflow: visible;
}

.tab-content {
    animation: none;
}

.content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.content-header h1 {
    font-size: 1.3rem;
}

/* Barra Superior Mobile - Só aparece se logado */
.mobile-top-bar {
    display: none !important;
}

.is-logged-in .mobile-top-bar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 70px !important;
    background: #0f172a !important; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 10000 !important; 
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 15px !important;
}

/* Landing Page Fixes in mobile.css */
.is-logged-out .lp-nav {
    display: flex !important;
    background: #0f172a !important;
    padding: 10px 15px !important;
}

.is-logged-out .lp-hero-visual {
    max-width: 100% !important;
    margin-top: 20px;
}

.is-logged-out .carousel-wrapper {
    max-width: 100% !important;
    height: auto !important;
}

.mobile-top-bar h1 {
    font-size: 0.9rem;
    font-weight: 800;
    color: white;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon-only {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-icon-only:hover {
    color: var(--danger);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.status-dot.conectado { background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.status-dot.desconectado { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.status-dot.aguardando { background: #ffc107; box-shadow: 0 0 10px #ffc107; }

/* Engine Status on Mobile Top Bar */
#mobile-engine-status.on {
    background: rgba(0, 168, 132, 0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
}

#mobile-engine-status.off {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

#mobile-engine-status.outside {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
}

/* Grid Stacking - Alterado para 2 Colunas */
.stats-grid, .stats-dashboard, .admin-content-grid, .offers-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

/* Grid Stacking - Removido por duplicata consolidada no style.css */

/* Modals Optimization */
.modal-content {
    width: 95% !important;
    padding: 20px !important;
    border-radius: 16px !important;
}

.modal-actions {
    flex-direction: column;
}

.modal-actions button {
    width: 100%;
}

/* Garante que o app não tenha scroll horizontal */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

.app-container {
    max-width: 100vw;
}
