/* ==========================================================================
   DESKTOP SIDEBAR - Menu fixo para telas >= 1024px
   Mantém o comportamento de hamburger slide em mobile (<1024px)
   ========================================================================== */

/* Esconder elementos desktop no mobile */
.menu-siga-home-desktop {
    display: none;
}
.menu-destinos-desktop {
    display: none;
}

/* ---- Mobile: flex layout para footer fixo no iOS ---- */
#menu-mobile.ativo {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
#menu-mobile.ativo > .content-menu-mobile {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#menu-mobile.ativo > .fale-agora-whatsapp {
    flex-shrink: 0;
}
#menu-mobile.ativo > .header-menu-mobile {
    flex-shrink: 0;
}
#menu-mobile.ativo > .menu-home {
    flex-shrink: 0;
}
#menu-mobile .fale-agora-whatsapp {
    display: none;
}

.sidebar-footer-desktop {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #000A54;
    border-top: 1px solid #001192;
    padding: 10px 15px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    min-height: 56px;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-footer-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 500;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.sidebar-footer-item:active {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-footer-item img {
    width: 22px;
    height: 22px;
}

.sidebar-footer-item .carrinho-container {
    position: relative;
}

.sidebar-footer-item .carrinho-container img {
    width: 22px;
    height: 22px;
}

.sidebar-footer-item .contador-carrinho {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #FFCC00;
    color: #000A54;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Dashboard link no menu mobile */
.menu-siga-dashboard {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #273284;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
}

.menu-siga-dashboard img {
    width: 18px;
    height: 18px;
}

/* Destinos list — mobile only (hidden on desktop, shown on mobile for order_manager) */
.menu-destinos-mobile {
    display: block;
}

.menu-destinos-mobile h3 {
    color: #FFCC00;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.menu-destinos-mobile ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-destinos-mobile ul li a {
    display: block;
    padding: 8px 0;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-edge-tab {
    display: none;
}
.sidebar-edge-tab-collapsed {
    display: none;
}

.siga-label {
    display: none;
}

@media only screen and (min-width: 1024px) {

    /* --- CSS Variable for sidebar width --- */
    :root {
        --sidebar-width: 320px;
    }

    /* =======================================================
       1. SIDEBAR: #menu-mobile sempre visível como sidebar fixo
       ======================================================= */
    #menu-mobile {
        left: 0 !important;
        width: var(--sidebar-width);
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 9999;
        transition: transform 0.3s ease;
        overflow: hidden;
        transform: translateX(0);
        display: flex !important;
        flex-direction: column;
    }

    #menu-mobile > .content-menu-mobile {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* =======================================================
       2. HEADER DO SIDEBAR: Logo GROU | SIGA com fundo farol (compacto)
       ======================================================= */
    .header-menu-mobile {
        display: flex !important;
        position: relative !important;
        width: 100% !important;
        height: 80px;
        min-height: 80px;
        padding: 0 15px !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: url(images/mobile/header-menu.jpg) no-repeat center center;
        background-size: cover;
        overflow: hidden;
    }

    .header-menu-mobile .overlay-menu {
        opacity: 0.75;
    }

    /* Esconder título "Menu" e botões mobile no desktop */
    .header-menu-mobile .titulo-menu {
        display: none;
    }

    .header-menu-mobile .container-botoes-mobile,
    .header-menu-mobile .bcontainer-botoes-mobile {
        display: none !important;
    }

    /* Logo com | SIGA */
    .header-menu-mobile .menu-marca {
        display: flex;
        align-items: center;
        z-index: 2;
        margin-top: 0;
    }

    .logo-sidebar-desktop {
        display: flex !important;
        align-items: baseline;
        text-decoration: none;
    }

    .logo-sidebar-desktop #grou-menu-mobile {
        height: 32px;
        width: auto;
        margin-bottom: 0;
    }

    .logo-sidebar-desktop .siga-label {
        color: #FFFFFF;
        font-size: 22px;
        font-weight: 700;
        margin-left: 4px;
        font-family: Roboto, sans-serif;
        position: relative;
        top: -13px;
        left: -3px;
        display: inline-block;
    }

    /* =======================================================
       3. EDGE TAB: botão de colapsar no canto direito do header
       ======================================================= */
    .sidebar-edge-tab {
        display: flex !important;
        position: relative;
        z-index: 2;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s ease;
        backdrop-filter: blur(4px);
    }

    .sidebar-edge-tab:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .edge-tab-icon {
        color: #FFFFFF;
        font-size: 41px;
        line-height: 1;
        font-weight: bold;
        position: relative;
        top: -4px;
    }

    /* =======================================================
       3b. EDGE TAB COLAPSADO: botão flutuante na borda esquerda
       ======================================================= */
    .sidebar-edge-tab-collapsed {
        display: none;
        position: fixed;
        left: 0;
        top: 83px;
        z-index: 10000;
        background: #000A54;
        border: none;
        border-radius: 0 8px 8px 0;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
        transition: background 0.2s ease;
    }

    .sidebar-edge-tab-collapsed:hover {
        background: #001192;
    }

    .sidebar-edge-tab-collapsed .edge-tab-expand-icon {
        color: #FFFFFF;
        font-size: 41px;
        line-height: 1;
        font-weight: bold;
        position: relative;
        top: -3px;
    }

    body.sidebar-collapsed .sidebar-edge-tab-collapsed {
        display: flex !important;
    }

    /* =======================================================
       4. CONTEÚDO SCROLLÁVEL DO MENU
       ======================================================= */
    .content-menu-mobile {
        padding: 0 20px;
        flex: 1;
        overflow-y: auto;
        padding-bottom: 10px;
    }

    .content-menu-mobile a {
        font-size: 14px;
        line-height: 20px;
        padding: 7px 0;
    }

    .content-menu-mobile h3 {
        font-size: 11px;
        line-height: 18px;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-top: 20px;
        margin-bottom: 6px;
        padding: 8px 0 6px;
        color: #FFCC00;
        font-weight: 700;
    }

    .content-menu-mobile h3:first-child {
        border-top: none;
        margin-top: 8px;
    }

    .content-menu-mobile img {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    /* Esconder ícones em todas as seções exceto Minha conta (último ul) */
    .content-menu-mobile ul img {
        display: none;
    }
    .content-menu-mobile ul:last-of-type img {
        display: inline-block;
    }

    .content-menu-mobile a:after {
        top: 14px;
        display: none;
    }

    /* Página inicial / Destinos no sidebar */
    .menu-home.menu-home-menu {
        padding: 10px 20px;
        margin-top: 0;
    }

    /* No desktop: esconder botão amarelo Destinos, mostrar link Página inicial */
    .menu-siga-destinos {
        display: none !important;
    }

    .menu-siga-home-desktop {
        display: flex !important;
        align-items: center;
        font-size: 14px;
        line-height: 20px;
        color: #FFFFFF;
        padding: 7px 0;
        border-bottom: 1px solid #001192;
        font-weight: 500;
    }

    .menu-siga-home-desktop img {
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    .menu-siga-home-desktop:hover {
        background: rgba(255, 255, 255, 0.08);
        transition: all 0.15s ease;
    }

    /* Seção Destinos no sidebar desktop */
    .menu-destinos-desktop {
        display: block;
    }

    /* =======================================================
       5. SIDEBAR FOOTER: Home, Carrinho, Logout fixo na base
       ======================================================= */
    .sidebar-footer-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Hide mobile-only destinos list on desktop */
    .menu-destinos-mobile {
        display: none !important;
    }

    /* Hide Dashboard button on desktop (already has Home in footer) */
    /* .menu-dashboard-link {
        display: none !important;
    } */

    /* WhatsApp CTA no sidebar */
    #menu-mobile .fale-agora-whatsapp {
        margin: 15px 20px;
        font-size: 14px;
        padding: 10px;
        display: none;
    }

    /* =======================================================
       6. TOP BAR: esconder header principal no desktop
       ======================================================= */
    header#header-mobile {
        display: none !important;
    }

    .espacamento-mobile-header {
        display: none !important;
    }

    /* =======================================================
       7. BODY e CONTEÚDO: empurrar tudo para a direita
       ======================================================= */
    body {
        margin-left: var(--sidebar-width);
        width: calc(100vw - var(--sidebar-width));
        overflow-x: hidden;
        transition: margin-left 0.3s ease, width 0.3s ease;
    }

    /* =======================================================
       8. FIX: Todos os elementos que usam 100vw no mobile
       ======================================================= */
    html, html body {
        width: auto;
    }

    .espacamento-mobile-header,
    .idioma-oculto,
    #hero-mobile,
    .parent-pageid-97 #topo-cidade,
    #topo-cidade,
    #full-single-mobile,
    #full-single-mobile.transfer-laranja-in,
    #topo-single,
    .meta-mobile,
    .modal-conta .fechar-modal {
        width: 100% !important;
    }

    .page-id-7 .cart_totals.calculated_shipping,
    .page-id-7 .cart_totals {
        width: 100% !important;
    }

    .container-carrossel-mobile .owl-stage-outer,
    .container-carrossel-mobile .owl-stage,
    .container-carrossel-mobile .owl-item {
        max-width: 100%;
    }

    .reveal,
    .reveal-overlay {
        max-width: calc(100vw - var(--sidebar-width)) !important;
    }

    footer.footer-grou {
        width: 100%;
    }

    .container {
        min-width: auto;
        width: 100%;
    }

    .container-relatorio-desktop {
        min-width: auto;
        width: 100%;
    }

    /* =======================================================
       9. AJUSTES UX para desktop 
       ======================================================= */
    .content-menu-mobile a:hover {
        background: rgba(255, 255, 255, 0.08);
        transition: all 0.15s ease;
    }

    /* Scrollbar estilizada no sidebar */
    #menu-mobile .content-menu-mobile::-webkit-scrollbar {
        width: 4px;
    }

    #menu-mobile .content-menu-mobile::-webkit-scrollbar-track {
        background: transparent;
    }

    #menu-mobile .content-menu-mobile::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 4px;
    }

    #menu-mobile .content-menu-mobile::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }

    /* =======================================================
       10. ESTADO COLAPSADO: body.sidebar-collapsed
       ======================================================= */
    body.sidebar-collapsed {
        margin-left: 0;
        width: 100vw;
    }

    body.sidebar-collapsed #menu-mobile {
        transform: translateX(calc(var(--sidebar-width) * -1));
    }

    body.sidebar-collapsed .reveal,
    body.sidebar-collapsed .reveal-overlay {
        max-width: 100vw !important;
    }
}
