/* Header Responsivo Moderno - MaxxDelivery */

/* Variáveis para o header responsivo */
:root {
    --header-height: 80px;
    --header-height-mobile: 90px;
    --mobile-menu-width: 280px;
    --z-header: 1100;
    --z-mobile-menu: 1101;
    --animation-speed: 0.3s;
    --animation-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Garantir que o header fique acima do carousel */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all var(--animation-speed) var(--animation-ease);
}

/* Reset do header existente para mobile */
@media (max-width: 968px) {
    .header {
        height: var(--header-height-mobile);
        padding: 0;
    }
    
    .header-content {
        padding: 12px 0;
        position: relative;
    }
    
    /* Logo responsivo */
    .logo-img {
        height: 65px;
        width: auto;
        transition: var(--transition);
    }
    
    /* Esconder navegação desktop em mobile */
    .nav {
        display: none;
    }
    
    /* Esconder botão de ação principal em mobile */
    .header-actions .btn {
        display: none;
    }
    
    /* Mostrar botão mobile */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 50px;
        height: 50px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: var(--z-mobile-menu);
        transition: var(--transition);
    }
    
    .mobile-menu-btn:hover {
        background: rgba(255, 102, 0, 0.1);
        border-radius: 8px;
    }
    
    .mobile-menu-btn span {
        width: 30px;
        height: 4px;
        background: var(--primary-color);
        border-radius: 2px;
        transition: var(--animation-speed) var(--animation-ease);
        transform-origin: center;
        margin: 2px 0;
    }
    
    /* Animação do botão hambúrguer */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
        transform: scale(0);
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* Menu Mobile */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--mobile-menu-width);
    height: 100vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 102, 0, 0.1);
    z-index: var(--z-mobile-menu);
    transition: right var(--animation-speed) var(--animation-ease);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    right: 0;
}

/* Overlay do menu mobile */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-mobile-menu) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--animation-speed) var(--animation-ease);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Header do menu mobile */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 102, 0, 0.1);
    background: rgba(255, 102, 0, 0.05);
}

.mobile-menu-logo {
    height: 30px;
    width: auto;
}

.mobile-menu-close {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
    color: var(--primary-color);
    font-size: 20px;
}

.mobile-menu-close:hover {
    background: rgba(255, 102, 0, 0.1);
}

/* Navegação do menu mobile */
.mobile-menu-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--gray-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
    background: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.mobile-menu-nav a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Ações do menu mobile */
.mobile-menu-actions {
    padding: 20px;
    border-top: 1px solid rgba(255, 102, 0, 0.1);
    background: rgba(255, 102, 0, 0.02);
}

.mobile-menu-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}

.mobile-menu-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 102, 0, 0.4);
}

/* Animações de entrada dos itens do menu */
.mobile-menu.active .mobile-menu-nav a {
    animation: slideInRight 0.4s var(--animation-ease) forwards;
    opacity: 0;
    transform: translateX(30px);
}

.mobile-menu.active .mobile-menu-nav a:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.active .mobile-menu-nav a:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.active .mobile-menu-nav a:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.active .mobile-menu-nav a:nth-child(4) { animation-delay: 0.25s; }

.mobile-menu.active .mobile-menu-actions {
    animation: slideInRight 0.4s var(--animation-ease) 0.3s forwards;
    opacity: 0;
    transform: translateX(30px);
}

@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Melhorias para tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav {
        gap: 20px;
    }
    
    .nav a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .header-actions .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .logo-img {
        height: 48px;
    }
}

/* Melhorias para telas muito pequenas */
@media (max-width: 480px) {
    :root {
        --mobile-menu-width: 100vw;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        padding: 10px 0;
    }
    
    .logo-img {
        height: 42px;
    }
    
    .mobile-menu-btn {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-btn span {
        width: 20px;
        height: 2px;
    }
}

/* Estados de foco para acessibilidade */
.mobile-menu-btn:focus,
.mobile-menu-close:focus,
.mobile-menu-nav a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Prevenção de scroll quando menu está aberto */
body.mobile-menu-open {
    overflow: hidden;
}

/* Animação suave para mudanças de orientação */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-menu {
        padding-top: 10px;
    }
    
    .mobile-menu-nav {
        padding: 10px 0;
    }
    
    .mobile-menu-nav a {
        padding: 12px 20px;
    }
}



@media (max-width: 968px) {
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 12px 20px; /* Adiciona padding horizontal para evitar que o conteúdo cole nas bordas */
    }

    .logo {
        flex-shrink: 0; /* Impede que o logo encolha */
    }

    .logo-img {
        max-width: 150px; /* Define uma largura máxima para o logo em mobile */
        height: auto;
    }

    .mobile-menu-btn {
        margin-left: auto; /* Empurra o botão do menu para a direita */
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 10px 15px; /* Ajusta o padding para telas menores */
    }

    .logo-img {
        max-width: 120px; /* Ajusta o tamanho do logo para telas muito pequenas */
    }
}

