/* ======================================
   MELHORIAS DO MENU - APENAS DESKTOP
   ====================================== */

/* ======================================
   ESTILOS GERAIS - APENAS DESKTOP
   ====================================== */

@media (min-width: 992px) {
    /* Fundo semi-transparente PRETO para o header ficar visível sobre imagens */
    .page_header,
    .header_absolute .page_header {
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
        position: relative;
        z-index: 100;
    }

    /* Quando rolar a página, fundo mais transparente */
    .page_header.affix,
    .header_absolute .page_header.affix {
        background: rgba(0, 0, 0, 0.7) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }

    /* Logo no header - oculta por padrão */
    .header-logo-scroll {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .header-scroll-logo {
        height: 70px !important;
        width: auto !important;
        max-height: none !important;
        display: block !important;
    }

    /* Quando affix, aumenta o padding da barra para acomodar a logo */
    .page_header.affix .row,
    .header_absolute .page_header.affix .row {
        min-height: 80px;
    }

    /* Mostra a logo quando o menu está fixo (com scroll) */
    .page_header.affix .header-logo-scroll,
    .header_absolute .page_header.affix .header-logo-scroll {
        opacity: 1;
        visibility: visible;
    }


    /* Remove qualquer outline/borda indesejada */
    .top-nav *,
    .top-nav *:focus,
    .top-nav *:active {
        outline: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}

/* ======================================
   DESKTOP - Melhorias visuais
   ====================================== */

@media (min-width: 992px) {

    /* Texto do menu BRANCO */
    .top-nav > ul > li > a {
        color: #ffffff !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
        padding: 25px 18px;
        font-weight: 500;
        letter-spacing: 0.5px;
        transition: all 0.3s ease;
        background: transparent !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Ícones do menu principal */
    .top-nav > ul > li > a i {
        font-size: 16px;
        color: #3b82f6 !important;
        transition: transform 0.3s ease;
    }

    .top-nav > ul > li > a span {
        color: #ffffff !important;
    }

    .top-nav > ul > li:hover > a i {
        color: #ffffff !important;
        transform: scale(1.1);
    }

    /* Menu item com border-radius */
    .top-nav > ul > li {
        transition: all 0.3s ease;
        border-radius: 6px;
    }

    /* Fundo azul no hover */
    .top-nav > ul > li:hover,
    .top-nav > ul > li.active {
        background: #3b82f6 !important;
    }

    .top-nav > ul > li:hover > a,
    .top-nav > ul > li.active > a {
        background: transparent !important;
        color: #ffffff !important;
    }

    /* Submenu dropdown */
    .top-nav ul ul {
        min-width: 280px;
        background: #ffffff !important;
        border: 1px solid #e5e7eb;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        border-radius: 8px;
        overflow: hidden;
        margin-top: 10px;
    }

    .top-nav ul ul li {
        border-bottom: 1px solid #f3f4f6 !important;
        background: #ffffff !important;
    }

    .top-nav ul ul li:last-child {
        border-bottom: none;
    }

    .top-nav ul ul li:hover {
        background: #3b82f6 !important;
    }

    .top-nav ul ul a {
        color: #1f2937 !important;
        font-weight: 500 !important;
        padding: 14px 20px !important;
        background: transparent !important;
        transition: background 0.3s ease, transform 0.3s ease;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .top-nav ul ul a i {
        font-size: 14px;
        color: #3b82f6 !important;
        min-width: 20px;
        text-align: center;
    }

    .top-nav ul ul a span {
        color: #1f2937 !important;
    }

    .top-nav ul ul li:hover a {
        background: transparent !important;
        color: #ffffff !important;
    }

    .top-nav ul ul li:hover a i,
    .top-nav ul ul li:hover a span {
        color: #ffffff !important;
    }

    /* Efeito sutil apenas no ícone */
    .top-nav ul ul li:hover a i {
        transform: translateX(3px);
    }
}

/* ======================================
   SIDEBAR - Melhorias visuais
   ====================================== */

@media (min-width: 992px) {

    .page_header_side {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    }

    .side_header_inner {
        padding-left: 25px !important;
        padding-right: 25px !important;
    }

    .mainmenu_side_wrapper ul li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
    }

    .mainmenu_side_wrapper ul li a {
        color: #ffffff !important;
        font-weight: 500;
        transition: all 0.3s ease;
        padding: 18px 25px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mainmenu_side_wrapper ul li a i {
        color: #3b82f6 !important;
        transition: all 0.3s ease;
        font-size: 18px;
        flex-shrink: 0;
    }

    /* Texto dentro de span para aplicar fundo apenas nele */
    .mainmenu_side_wrapper ul li a span {
        color: #ffffff !important;
        transition: all 0.3s ease;
        padding: 4px 8px;
        border-radius: 4px;
    }

    .mainmenu_side_wrapper ul li:hover a {
        color: #ffffff !important;
    }

    .mainmenu_side_wrapper ul li:hover a span {
        background: rgba(59, 130, 246, 0.2);
    }

    .mainmenu_side_wrapper ul li:hover a i {
        transform: scale(1.15);
        color: #60a5fa !important;
    }

    /* WhatsApp button */
    .facebook-messeger {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .facebook-messeger:hover {
        background: linear-gradient(135deg, #128C7E 0%, #075E54 100%) !important;
    }

    .facebook-messeger img {
        transition: transform 0.3s ease;
        filter: brightness(0) invert(1);
    }

    .facebook-messeger a {
        color: #ffffff !important;
    }

    .facebook-messeger:hover img {
        transform: scale(1.1);
    }

    .facebook-messeger:hover a {
        color: #ffffff !important;
    }

    /* Toggle button do sidebar */
    .toggle_menu_side {
        background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
        transition: all 0.3s ease;
    }

    .toggle_menu_side:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* ======================================
   NOVO MENU MOBILE PERSONALIZADO
   ====================================== */

/* Botão hamburger customizado - apenas mobile */
.custom-mobile-trigger {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

.custom-mobile-trigger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.custom-mobile-trigger:active {
    transform: scale(0.95);
}

@media (max-width: 991px) {
    .custom-mobile-trigger {
        display: flex;
    }

    /* Esconde o menu desktop em mobile */
    .nav-wrap {
        display: none !important;
    }

    /* Esconde toggle antigo */
    .page_header .toggle_menu {
        display: none !important;
    }

    /* Desabilita o sistema de menu antigo completamente */
    .mobile-active .top-nav {
        display: none !important;
    }

    .mobile-active .sf-menu {
        display: none !important;
    }
}

/* Menu mobile container */
.custom-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;
    pointer-events: none;
    visibility: visible !important;
    display: block !important;
}

.custom-mobile-menu.active {
    pointer-events: all;
}

/* DEBUG - Força visibilidade */
.custom-mobile-menu,
.custom-mobile-menu-overlay,
.custom-mobile-menu-content {
    visibility: visible !important;
    display: block !important;
}

/* Overlay */
.custom-mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    z-index: 10000 !important;
}

.custom-mobile-menu.active .custom-mobile-menu-overlay {
    opacity: 1 !important;
}

/* Conteúdo do menu */
.custom-mobile-menu-content {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 85% !important;
    max-width: 350px !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5) !important;
    overflow-y: auto !important;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10001 !important;
}

.custom-mobile-menu.active .custom-mobile-menu-content {
    right: 0 !important;
}

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

.custom-mobile-logo {
    height: 40px;
    width: auto;
}

.custom-mobile-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
    width: auto;
    height: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    pointer-events: all !important;
    touch-action: manipulation !important;
}

.custom-mobile-close i {
    pointer-events: none;
    font-size: 24px;
}

.custom-mobile-close:hover,
.custom-mobile-close:active {
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

/* Navegação */
.custom-mobile-nav {
    padding: 10px 0;
}

.custom-mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.custom-mobile-nav > ul > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-mobile-nav a {
    display: flex;
    align-items: center;
    padding: 18px 25px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.custom-mobile-nav a i:first-child {
    color: #3b82f6;
    font-size: 18px;
    margin-right: 15px;
    min-width: 20px;
    transition: all 0.3s ease;
}

.custom-mobile-nav a span {
    flex: 1;
}

.custom-mobile-nav a:active {
    background: rgba(59, 130, 246, 0.15);
    padding-left: 30px;
}

.custom-mobile-nav a:active i:first-child {
    color: #60a5fa;
    transform: scale(1.2);
}

/* Seta do submenu */
.submenu-arrow {
    margin-left: auto !important;
    font-size: 14px !important;
    color: #94a3b8 !important;
    transition: transform 0.3s ease !important;
}

.has-submenu.open > a .submenu-arrow {
    transform: rotate(180deg);
    color: #3b82f6 !important;
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #3b82f6;
}

.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.submenu li:last-child {
    border-bottom: none;
}

.submenu a {
    padding: 14px 25px 14px 50px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #cbd5e1 !important;
}

.submenu a i {
    color: #64748b !important;
    font-size: 15px !important;
}

.submenu a:active {
    background: rgba(59, 130, 246, 0.2) !important;
    padding-left: 55px !important;
    color: #ffffff !important;
}

.submenu a:active i {
    color: #3b82f6 !important;
}

/* Scrollbar customizada */
.custom-mobile-menu-content::-webkit-scrollbar {
    width: 6px;
}

.custom-mobile-menu-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.custom-mobile-menu-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.custom-mobile-menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* Esconde o botão hamburger quando menu está aberto */
.custom-mobile-trigger.menu-open {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ======================================
   PÁGINA DE CONTATO - APENAS DESKTOP
   ====================================== */

@media (min-width: 992px) {
    /* Fundo preto sólido no header da página de contato */
    body.contato-page .page_header,
    body.contato-page .header_absolute .page_header {
        background: #000 !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Header relativo ao invés de absoluto */
    body.contato-page .header_absolute {
        position: relative !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Page header também precisa ser relativo */
    body.contato-page .header_absolute .page_header,
    body.contato-page .header_absolute .page_header_wrapper {
        position: relative !important;
        left: auto !important;
        right: auto !important;
    }

    /* Remove altura fixa do wrapper */
    body.contato-page .page_header_wrapper {
        height: auto !important;
        min-height: 0 !important;
    }

    /* Quando rolar a página, menu fica fixo */
    body.contato-page .header_absolute .page_header.affix {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1002 !important;
    }

    /* Mapa colado ao menu - remove todos os espaçamentos */
    body.contato-page .page_map {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove espaçamento do section */
    body.contato-page section.page_map {
        margin: 0 !important;
        padding: 0 !important;
    }
}
