/* ============================================
   OTIMIZAÇÕES MOBILE - LOJA PÚBLICA
   Layout Premium para Dispositivos Móveis
   ============================================ */

/* ============================================
   AJUSTES GERAIS MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Container com padding otimizado */
    .container {
        padding: 0 12px;
    }
    
    /* Main content sem espaçamentos excessivos */
    .main-content {
        padding-top: 0;
    }
    
    /* ============================================
       BANNER - OTIMIZADO
       ============================================ */
    
    .banner {
        height: auto !important;
        min-height: 180px !important;
        max-height: 250px !important;
        margin: 10px 0 15px 0 !important; /* Reduzido drasticamente */
        background-size: cover !important;
        background-position: center !important;
        border-radius: 8px !important;
        overflow: hidden;
    }
    
    .banner-content {
        padding: 15px 12px !important;
        width: 95% !important;
        max-width: none !important;
    }
    
    .banner-titulo {
        font-size: 1.3rem !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
    }
    
    .banner-texto {
        font-size: 0.9rem !important;
        margin-bottom: 12px !important;
        line-height: 1.4 !important;
    }
    
    /* ============================================
       SEÇÕES - ESPAÇAMENTO REDUZIDO
       ============================================ */
    
    .secao {
        margin: 20px 0 !important; /* Reduzido de 3rem */
        padding: 0 !important;
    }
    
    .categoria-secao {
        margin-bottom: 25px !important;
    }
    
    .secao-titulo {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }
    
    .categoria-header {
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
    }
    
    .categoria-titulo {
        font-size: 1.3rem !important;
    }
    
    /* ============================================
       PRODUTOS GRID - OTIMIZADO MOBILE
       ============================================ */
    
    .produtos-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important; /* Reduzido de 2rem */
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* ============================================
       CARDS DE PRODUTOS - COMPACTOS
       ============================================ */
    
    .produto-card {
        margin-bottom: 0 !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .produto-card:hover {
        transform: translateY(-3px) !important;
    }
    
    .produto-img {
        height: 160px !important; /* Reduzido de 200px */
        object-fit: cover;
    }
    
    .produto-info {
        padding: 12px !important; /* Reduzido de 1.5rem */
    }
    
    .produto-titulo {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
        min-height: 2.2rem !important;
        max-height: 3.3rem !important;
        line-height: 1.25 !important;
    }
    
    .produto-categoria {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
    }
    
    .produto-preco {
        font-size: 1.1rem !important; /* Reduzido de 1.25rem */
        margin-bottom: 10px !important;
        font-weight: 700;
    }
    
    /* ============================================
       BOTÕES DE PRODUTOS - OTIMIZADOS
       ============================================ */
    
    .produto-acoes {
        padding: 0 12px 12px 12px !important;
        gap: 8px !important;
    }
    
    .btn-comprar {
        height: 42px !important; /* Touch-friendly */
        font-size: 0.85rem !important;
        padding: 0 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
    }
    
    .btn-carrinho {
        height: 42px !important;
        width: 42px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 6px !important;
    }
}

/* ============================================
   MENU MOBILE MELHORADO
   ============================================ */

@media (max-width: 992px) {
    /* Botão Hamburger Moderno */
    .novo-menu-mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 8px;
        padding: 0 !important;
        margin: 8px;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .novo-menu-mobile-toggle:hover {
        background: rgba(0, 0, 0, 0.1);
    }
    
    .novo-menu-mobile-toggle:active {
        transform: scale(0.95);
    }
    
    .novo-menu-mobile-toggle i {
        font-size: 22px;
        color: #333;
        transition: all 0.3s ease;
    }
    
    /* Animação do ícone quando menu está aberto */
    .novo-menu-list.active ~ .novo-menu-mobile-toggle i {
        transform: rotate(90deg);
    }
    
    /* Menu Container */
    .novo-menu {
        padding: 0 !important;
    }
    
    .novo-menu .container {
        padding: 0 !important;
    }
    
    /* Lista do Menu */
    .novo-menu-list {
        background: #ffffff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .novo-menu-list.active {
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Itens do Menu */
    .novo-menu-item {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .novo-menu-item:last-child {
        border-bottom: none;
    }
    
    .novo-menu-link {
        padding: 14px 16px !important;
        font-size: 15px !important;
        font-weight: 500;
        color: #333;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .novo-menu-link:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    /* Indicador de subcategorias */
    .toggle-indicator {
        font-size: 12px;
        margin-left: auto;
        transition: transform 0.3s ease;
        color: #666;
    }
    
    .novo-menu-item.active .toggle-indicator {
        transform: rotate(180deg);
        color: var(--cor-primaria, #4a6adb);
    }
    
    /* Dropdown de subcategorias */
    .novo-dropdown {
        background: #f8f9fa !important;
        border-top: 1px solid #e9ecef;
    }
    
    .novo-dropdown-link {
        padding: 12px 16px 12px 32px !important;
        font-size: 14px !important;
        color: #555;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
    }
    
    .novo-dropdown-link:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .novo-dropdown-link::before {
        content: '→';
        position: absolute;
        left: 16px;
        color: var(--cor-primaria, #4a6adb);
        font-weight: bold;
    }
}

/* ============================================
   MOBILE PEQUENO (≤ 576px)
   ============================================ */

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .banner {
        min-height: 150px !important;
        max-height: 200px !important;
        margin: 8px 0 12px 0 !important;
    }
    
    .produtos-grid {
        gap: 10px !important;
    }
    
    .produto-card {
        border-radius: 6px !important;
    }
    
    .produto-img {
        height: 140px !important;
    }
    
    .produto-info {
        padding: 10px !important;
    }
    
    .produto-titulo {
        font-size: 0.8rem !important;
        min-height: 2rem !important;
        max-height: 3rem !important;
    }
    
    .produto-preco {
        font-size: 1rem !important;
    }
    
    .btn-comprar {
        height: 38px !important;
        font-size: 0.8rem !important;
    }
    
    .btn-carrinho {
        height: 38px !important;
        width: 38px !important;
    }
    
    .categoria-titulo {
        font-size: 1.2rem !important;
    }
    
    .ver-mais {
        font-size: 0.85rem !important;
    }
}

/* ============================================
   MOBILE EXTRA PEQUENO (≤ 375px)
   ============================================ */

@media (max-width: 375px) {
    .produtos-grid {
        gap: 8px !important;
    }
    
    .produto-img {
        height: 130px !important;
    }
    
    .produto-info {
        padding: 8px !important;
    }
    
    .produto-titulo {
        font-size: 0.75rem !important;
    }
    
    .produto-preco {
        font-size: 0.95rem !important;
    }
    
    .produto-acoes {
        padding: 0 8px 8px 8px !important;
    }
}

/* ============================================
   MELHORIAS DE SCROLL SUAVE
   ============================================ */

@media (max-width: 768px) {
    /* Smooth scroll */
    html {
        scroll-behavior: smooth;
    }
    
    /* Otimização de scroll em listas */
    .novo-menu-list {
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }
    
    .novo-menu-list::-webkit-scrollbar {
        width: 4px;
    }
    
    .novo-menu-list::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .novo-menu-list::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }
}

/* ============================================
   TRANSIÇÕES SUAVES
   ============================================ */

@media (max-width: 768px) {
    .produto-card,
    .btn-comprar,
    .btn-carrinho,
    .novo-menu-link,
    .novo-dropdown-link {
        transition: all 0.2s ease;
    }
}

/* ============================================
   PREVENÇÃO DE TAP HIGHLIGHT (iOS)
   ============================================ */

@media (max-width: 768px) {
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    button,
    a {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   INFO LOJA - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .info-loja {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-top: 20px !important;
        padding: 0 !important;
    }
    
    .info-loja-card {
        padding: 15px !important;
        border-radius: 8px !important;
    }
}

/* ============================================
   FOOTER - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .footer {
        padding: 20px 0 15px !important;
    }
    
    .footer-container {
        gap: 20px !important;
    }
}

/* ============================================
   ACESSIBILIDADE MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Touch targets mínimos de 44x44px */
    button,
    a.btn,
    .btn-comprar,
    .btn-carrinho,
    .novo-menu-link,
    .novo-dropdown-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Focus visible para navegação por teclado */
    *:focus {
        outline: 2px solid var(--cor-primaria, #4a6adb);
        outline-offset: 2px;
    }
}

/* ============================================
   PERFORMANCE - ANIMAÇÕES LEVES NO MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Desabilitar animações complexas em dispositivos lentos */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

