/* =========================================================
   Clube dos Cruzeiros — Correções Urgentes
   Versão: Corrige funcionalidade sem mudar cores/visual
   ========================================================= */

/* =======================
   1. FIX MENU MOBILE
   ======================= */

/* Garante que o menu mobile funcione */
@media (max-width: 991.98px) {
    /* Menu começa fechado */
    .navbar-collapse {
        display: none;
    }
    
    /* Menu quando aberto */
    .navbar-collapse.show {
        display: block !important;
        position: absolute;
        width: 100%;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 9999;
        /* Usa a cor de fundo existente do site, não azul */
        background-color: inherit;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 1rem;
    }
    
    /* Botão hamburguer */
    .navbar-toggler {
        border: 1px solid currentColor !important;
        padding: 0.25rem 0.5rem !important;
        font-size: 1.25rem !important;
        line-height: 1 !important;
        background-color: transparent !important;
        position: relative !important;
        z-index: 10000 !important;
    }
    
    /* Remove outline azul do Bootstrap */
    .navbar-toggler:focus {
        text-decoration: none;
        outline: 0;
        box-shadow: none !important;
    }
    
    /* Garante que os links do menu sejam clicáveis */
    .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-item {
        padding: 0.5rem 0;
    }
}

/* =======================
   2. FIX BUSCADOR
   ======================= */

/* Corrige sobreposição do buscador */
.busca-cruzeiros,
.busca-rapida,
.busca-form,
.search-form,
[class*="busca"] {
    /* Adiciona espaçamento */
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    
    /* Garante que não flutue sobre outros elementos */
    position: relative !important;
    z-index: 1 !important;
    clear: both !important;
}

/* Espaçamento do conteúdo principal para não ser coberto */
main,
.main-content,
#content,
.site-content {
    /* Adiciona padding superior */
    padding-top: 20px !important;
    position: relative;
}

/* Garante que títulos não sejam cobertos */
h1, h2, h3, h4, h5, h6 {
    position: relative;
    z-index: 2;
    /* Pequeno padding para garantir espaço */
    padding-top: 5px;
    margin-top: 10px;
}

/* =======================
   3. FIX LOGO
   ======================= */

/* Garante que o logo nunca seja ocultado */
.navbar-brand,
.logo,
.site-logo,
[class*="logo"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
}

/* Logo em mobile */
@media (max-width: 991.98px) {
    .navbar-brand img,
    .logo img {
        max-height: 40px !important;
        width: auto !important;
    }
}

/* =======================
   4. HIERARQUIA Z-INDEX
   ======================= */

/* Define camadas corretas */
.navbar {
    position: relative;
    z-index: 1000;
}

.navbar.sticky-top,
.navbar.fixed-top {
    z-index: 1030 !important;
}

/* =======================
   5. CORREÇÕES GERAIS
   ======================= */

/* Remove margens negativas que possam causar sobreposição */
* {
    margin-top: initial;
}

/* Garante que containers tenham largura correta */
.container,
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* Reset de listas no menu */
.navbar ul,
.navbar-nav {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
}

/* =======================
   6. WHATSAPP FLOAT
   ======================= */

.whatsapp-float,
.floating-whatsapp,
[class*="whatsapp-btn"] {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 999 !important;
    /* Mantém a cor original do botão */
}

/* =======================
   7. FORMULÁRIOS
   ======================= */

/* Corrige selects e inputs */
select.form-select,
select.form-control,
.busca-form select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

/* =======================
   8. RESPONSIVIDADE ADICIONAL
   ======================= */

/* Tablets */
@media (max-width: 768px) {
    .busca-form .row {
        margin: 0;
    }
    
    .busca-form [class*="col-"] {
        padding: 5px;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .navbar-brand {
        max-width: 60%;
    }
    
    .busca-form button {
        width: 100%;
        margin-top: 10px;
    }
}

/* =======================
   9. PRINTS/DEBUG
   ======================= */

/* Remover bordas de debug se existirem */
* {
    border-color: initial !important;
}

/* Remove qualquer borda vermelha de teste */
.navbar-toggler {
    border-color: currentColor !important;
}