/* ========================================
   MENU FLUTUANTE INFERIOR ESTILO APP
   ======================================== */

.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #e5e7eb;
    z-index: 9998; /* REDUZIDO para ficar abaixo dos botões flutuantes */
    padding: 8px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 70px;
    transition: transform 0.3s ease;
}

/* Efeito de slide ao carregar */
.app-bottom-nav.loaded {
    animation: slideUpNav 0.5s ease-out;
}

@keyframes slideUpNav {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Container de cada item do menu */
.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 12px;
    min-width: 70px;
    cursor: pointer;
    position: relative;
}

.app-nav-item:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

.app-nav-item.active {
    color: #4a6bff;
}

.app-nav-item.active .app-nav-icon {
    background: linear-gradient(135deg, #4a6bff 0%, #2c50ff 100%);
    transform: scale(1.1);
}

/* Ícone do menu */
.app-nav-icon {
    width: 32px;
    height: 32px;
    background: #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.app-nav-item:hover .app-nav-icon {
    background: #d1d5db;
}

.app-nav-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Texto do menu */
.app-nav-label {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.app-nav-item.active .app-nav-label {
    color: #4a6bff;
}

/* Indicador visual de ativo */
.app-nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #4a6bff 0%, #2c50ff 100%);
    border-radius: 0 0 3px 3px;
}

/* Efeito de ripple ao clicar */
.app-nav-item::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: rgba(74, 107, 255, 0.2);
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s ease;
}

.app-nav-item:active::after {
    opacity: 1;
    transform: scale(1);
    transition: 0s;
}

/* Ajustes para desktop */
@media screen and (min-width: 769px) {
    .app-bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        bottom: 0;
    }
    
    .app-nav-item {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .app-nav-icon {
        width: 36px;
        height: 36px;
    }
    
    .app-nav-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .app-nav-label {
        font-size: 12px;
    }
}

/* Ajustes para mobile pequeno */
@media screen and (max-width: 380px) {
    .app-nav-item {
        min-width: 60px;
        padding: 6px 8px;
    }
    
    .app-nav-icon {
        width: 28px;
        height: 28px;
    }
    
    .app-nav-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .app-nav-label {
        font-size: 10px;
    }
}

/* Espaço no final do conteúdo para não ser coberto pelo menu */
body.has-app-nav {
    padding-bottom: 80px !important;
}

/* Ajuste para containers principais */
body.has-app-nav .lista-supermercado-container,
body.has-app-nav .wrap,
body.has-app-nav main {
    padding-bottom: 100px;
}

/* Ajustar posição dos botões flutuantes quando o app nav estiver ativo */
body.has-app-nav .floating-menu-container {
    bottom: 80px !important;
    z-index: 10000 !important; /* Acima do menu app */
}

body.has-app-nav #floating-add-btn {
    bottom: 150px !important;
    z-index: 10000 !important; /* Acima do menu app */
}

/* Garantir que o botão + seja sempre visível */
#floating-add-btn {
    z-index: 10000 !important;
}

/* Animação de pulso para indicar ativo */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.app-nav-item.active .app-nav-icon {
    animation: pulse 2s infinite;
}

/* Efeito de desfoque no conteúdo ao rolar */
.app-bottom-nav.scrolled {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    .app-bottom-nav {
        background: rgba(31, 41, 55, 0.95);
        border-top-color: #374151;
    }
    
    .app-nav-item {
        color: #9ca3af;
    }
    
    .app-nav-item.active {
        color: #60a5fa;
    }
    
    .app-nav-icon {
        background: #374151;
    }
    
    .app-nav-item:hover {
        background: #374151;
    }
    
    .app-nav-item:hover .app-nav-icon {
        background: #4b5563;
    }
}

/* Acessibilidade */
.app-nav-item:focus {
    outline: 2px solid #4a6bff;
    outline-offset: 2px;
}

.app-nav-item:focus:not(:focus-visible) {
    outline: none;
}

/* Loading state */
.app-bottom-nav.loading {
    opacity: 0.6;
    pointer-events: none;
}