/* ============================================
   MOBILE HEADER
   ============================================ */


/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-button {
    background: none;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 27px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.mobile-menu-button .icon-bar {
    display: block;
    width: 24px;
    height: 3px;
    background: #FF8C00;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ============================================
   MOBILE MENU DRAWER
   ============================================ */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: #FFFFFF;
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-drawer.active {
    left: 0;
}

/* Header do Drawer */
.mobile-menu-header {
    background: #4A5F7F;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-account {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
}
.mobile-menu-account a {
    color: white;
    text-decoration: underline;
}

.mobile-menu-account svg {
    flex-shrink: 0;
    margin-right:.8rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menu Nav */
.mobile-menu-nav {
    padding: 20px 0;
}

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

.mobile-menu-item {
    border-bottom: 1px solid #E0E0E0;
}
.mobile-menu-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #7C7C7C !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: background 0.3s ease;
}

.mobile-menu-link span {
    flex: 1;
}

/* Botão de expandir/recolher */
.mobile-submenu-toggle {
    background: none;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-submenu-toggle .icon-chevron {
    transition: transform 0.3s ease;
}

.mobile-submenu-toggle.active .icon-chevron {
    transform: rotate(90deg);
}

/* ============================================
   SUBMENU (Nível 2)
   ============================================ */

.mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #F5F5F5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.active {
    max-height: 2000px; /* Valor alto para acomodar conteúdo */
}

.mobile-submenu-item {
    border-bottom: 1px solid #E0E0E0;
}

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

.mobile-submenu-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-submenu-link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 14px 20px 14px 40px; /* Indent para mostrar hierarquia */
    color: #555555;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.3s ease;
}

.mobile-submenu-link:hover {
    background: #EEEEEE;
}

/* ============================================
   SUB-SUBMENU (Nível 3)
   ============================================ */

.mobile-sub-submenu-toggle {
    background: none;
    border: none;
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.mobile-sub-submenu-toggle .icon-chevron-small {
    transition: transform 0.3s ease;
}

.mobile-sub-submenu-toggle.active .icon-chevron-small {
    transform: rotate(90deg);
}



/* Níveis deslizam horizontalmente */
.mobile-menu-level.mobile-menu-level-2 {
    margin: 1rem 0;
    transform: translateX(100%);
    position: absolute;
    background: white;
    z-index: 1;
    opacity: 0;
    transition: .4s ease;
    width: 100%;
    top: 0;
    height: 80vh;
}

.mobile-menu-level.active {
    transform: translateX(0);
    opacity: 1;
}

.mobile-menu-back>button {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    grid-gap: .5rem;
    padding: 1.5rem 1.5rem;
    border-radius: 0;
}

/* Accordion Level 3 */
.mobile-menu-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left:20px;
}

.mobile-menu-list .mobile-menu-submenu span {
    color: #4A5C7A;
    font-weight: 400;
}

.mobile-menu-submenu.active {
    max-height: 1000px;
}

.mobile-sub-submenu-item {
    border-bottom: 1px solid #E0E0E0;
}

.mobile-sub-submenu-item:last-child {
    border-bottom: none;
}

.mobile-sub-submenu-link {
    display: block;
    padding: 12px 20px 12px 60px; /* Mais indent */
    color: #666666;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.mobile-sub-submenu-link:hover {
    background: #E5E5E5;
}

.mobile-menu-btn-navigate {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.5rem 2rem;
}
.mobile-menu-btn-navigate span {
    color: #7C7C7C;
    font-weight: 700;
    font-size: 16px;
}

.mobile-menu-levels {
    position: relative
}

.mobile-menu-btn-toggle {
    background: transparent;
    border: none;
    line-height: 0;
}
.mobile-menu-list .mobile-menu-item {
    margin: 0;
}

.mobile-menu-btn-toggle svg.icon-plus {
    transition: .4s ease;
}

.mobile-menu-btn-toggle.active svg.icon-plus {
    transform: rotate(45deg);
}

/* ============================================
   MOBILE MENU ACCOUNT
   ============================================ */

.mobile-menu-account-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

/* ============================================
   MOBILE MENU FOOTER
   ============================================ */

.mobile-menu-footer-faq {
    background: #FF8C00 !important;
    color: #FFFFFF !important;
    padding: 14px 16px !important;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 600;
}

.mobile-menu-footer-faq svg path {
    stroke: #FFFFFF !important;
}

/* Estado vazio */
.mobile-menu-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999999;
    font-style: italic;
}

/* ============================================
   HEADER SEARCH MOBILE
   ============================================ */

.header-search-mobile {
    display: none;
    padding: 12px 20px;
    background: #FFFFFF;
    border-top: 1px solid #E0E0E0;
}

.search-mobile-wrapper {
    width: 100%;
}

.search-mobile-wrapper .field.search {
    margin: 0;
}

.search-mobile-wrapper .control {
    position: relative;
}

.search-mobile-wrapper input {
    width: 100%;
    padding: 6px 40px 7px 16px;
    border: 1px solid #4A5C7A;
    border-radius: 20px;
    font-size: 13px;
    height: 36px;
}
.header-search-mobile button {
    position: absolute;
    right: 0;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 1.2rem;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

@media (max-width: 1024px) {
    /* Esconder elementos desktop */
    .desktop-only {
        display: none !important;
    }
    
    /* Mostrar elementos mobile */
    .mobile-only {
        display: block !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .header-search-mobile {
        display: block;
        padding: 0 16px;
        position: relative;
        border:none;
    }
    
    /* Ajustar header middle */
    .header-middle .header-wrapper {
        padding: 12px 20px;
    }
    
    /* Logo centralizada */
    .header-logo {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .header-logo img {
        max-height: 32px;
    }
    
    /* Icons */
    .header-icons {
        gap: 8px;
    }
    
    .header-icons .custom-account {
        display: none; /* Esconder conta no header mobile */
    }
    
    /* Menu desktop escondido */
    .header-bottom {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .mobile-menu-drawer {
        width: 330px;
        left: -330px;
    }
    
    .header-middle .header-wrapper {
        padding: 10px 16px;
    }    
    .header-icons .header-account,
    .topbar-right {
        display: none;
    }
    .topbar-left {
        max-width: 100%;
    }
    .mobile-menu-footer {
        padding: 0 16px;
    }
    .mobile-menu-footer a {
        margin: .5rem 0;
    }
    .faq-menu-mobile {
        display: block;
        text-align: center;
        padding: .8rem 0;
        background: #FF7E00;
        color: white;
        font-weight: 500;
        border-radius: 20px;
    }
    .mobile-menu-footer a:not(:first-child) {
        display: flex;
        align-items: center;
        grid-gap: 1rem;
        color: #4A5C7A;
        font-weight: 600;
        margin-top: 1.5rem;
    }
    .header-middle {
        padding-bottom: .9rem;
        box-shadow: 0px 0px 8px rgba(0, 0, 0, .15);
        z-index:1
    }
    .header-icons {
        gap: 8px;
        margin-top: .3rem;
    }
    .header-icons svg {
        max-width: 26px;
        max-height: 22px;
    }
    #topbar .swiper-button-next, #topbar .swiper-button-prev {
        width: 11px;
    }
}

/* ============================================
   BODY LOCK (quando menu aberto)
   ============================================ */

body.mobile-menu-open {
    overflow: hidden;
}