/* ===== SUBMENU COM SCROLL - VERSÃO CORRIGIDA ===== */

/* Overlay */
.submenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
}

.submenu-overlay.active {
    display: block;
}

/* Submenu Principal - MAIOR */
.cidades-submenu {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1002;
    transition: bottom 0.3s ease;
    
    /* ALTURA MAIOR */
    height: 500px; /* Aumentei de 400px para 500px */
    max-height: 80vh; /* Aumentei de 70vh para 80vh */
}

.cidades-submenu.active {
    bottom: 0;
}

/* Header Fixo */
.submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: white;
    border-radius: 20px 20px 0 0;
    
    /* FIXO - não rola */
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.submenu-header span {
    font-weight: bold;
    font-size: 18px; /* Aumentei a fonte do título */
    color: #333;
}

.close-submenu {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
}

/* Área de Scroll - CORRIGIDO PADDING */
.cidades-list-container {
    height: calc(100% - 70px); /* Altura total menos header */
    overflow-y: auto; /* SCROLL INTERNO */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* iOS */
    
    /* PADDING NA ÁREA DE SCROLL PARA NÃO CORTAR */
    padding-bottom: 20px; /* Adicionei padding na parte inferior */
}

.cidades-list {
    padding: 0;
    margin: 0;
}

/* ===== TÍTULOS DAS REGIÕES ===== */
.regiao-titulo {
    background: #f8f9fa;
    color: #0b5394;
    font-weight: bold;
    font-size: 14px;
    padding: 12px 20px;
    border-bottom: 2px solid #0b5394;
    margin-top: 5px;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Primeiro título não precisa de margem superior */
.regiao-titulo:first-child {
    margin-top: 0;
}

/* FONTE MAIOR E PADDING CORRIGIDO */
.cidade-item {
    display: block;
    padding: 18px 25px; /* Aumentei o padding */
    color: #333;
    text-decoration: none;
    font-size: 16px; /* Corrigi de 50px para 16px (era muito grande) */
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-weight: 500; /* Deixei mais legível */
}

.cidade-item:hover {
    background: #0b5394;
    color: white;
}

.cidade-item:last-child {
    border-bottom: none;
    /* Garantir que a última cidade não seja cortada */
    margin-bottom: 0;
}

/* Bloquear scroll da página */
body.submenu-open {
    overflow: hidden !important;
}

/* ===== MENU PRINCIPAL ===== */
.footer-menu-container {
    display: none;
}

.footer-menu-container.mobile-fixed-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #e3e3e3;
    padding: 10px 0;
    z-index: 1000;
    display: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer-menu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.footer-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #444;
    font-size: 10px;
    padding: 5px;
    flex: 1;
    max-width: 70px;
}

.footer-menu-item i {
    font-size: 16px;
    margin-bottom: 2px;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .footer-menu-container.mobile-fixed-bottom {
        display: block !important;
    }
    
    body:not(.submenu-open) {
        padding-bottom: 70px !important;
    }
    
    /* Ajuste de altura para mobile - MAIOR */
    .cidades-submenu {
        height: 450px; /* Aumentei de 350px para 450px */
        max-height: 75vh; /* Um pouco menor que desktop */
    }
    
    .cidade-item {
        padding: 16px 20px; /* Padding um pouco menor no mobile */
        font-size: 15px;
    }
    
    /* Ajuste dos títulos no mobile */
    .regiao-titulo {
        font-size: 13px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .cidades-submenu {
        height: 400px; /* Aumentei de 300px para 400px */
        max-height: 70vh;
    }
    
    .submenu-header {
        padding: 15px 20px;
    }
    
    .submenu-header span {
        font-size: 16px;
    }
    
    .cidade-item {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .cidades-list-container {
        padding-bottom: 15px; /* Padding menor em mobile pequeno */
    }
    
    .regiao-titulo {
        font-size: 12px;
        padding: 8px 15px;
    }
}

/* Tablet - ajuste opcional */
@media (min-width: 769px) and (max-width: 1024px) {
    .footer-menu-container.mobile-fixed-bottom {
        display: none !important;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .footer-menu-container.mobile-fixed-bottom {
        display: none !important;
    }
}