/* =========================================================================
   CORREÇÕES DE RESPONSIVIDADE - ASPARA SAÚDE
   Adicione este arquivo após o style.css no base.html
   ========================================================================= */

/* =========================================================================
   GLOBAL: Remove Focus Outline em todos os elementos
   ========================================================================= */
*:focus,
*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.btn:focus,
.btn:focus-visible,
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.dropdown-item:focus,
.dropdown-item:focus-visible,
.nav-link:focus,
.nav-link:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

/* Remover box-shadow do Bootstrap em todos os estados */
.btn:active,
.btn.active,
.btn:focus,
.btn:focus-visible,
.btn-primary:focus,
.btn-primary:focus-visible,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* Remover efeitos de focus em form controls */
.form-control:focus,
.form-select:focus {
    border-color: inherit !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Remover efeitos de focus no navbar */
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:focus-visible,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    color: inherit !important;
}

/* =========================================================================
   1. CORREÇÕES DO MENU DE NAVEGAÇÃO (NAVBAR)
   ========================================================================= */

/* Reset dos estilos problemáticos do navbar */
.navbar .container-fluid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
}

/* Logo sempre visível */
.navbar .navbar-brand {
    order: 1 !important;
    flex-shrink: 0 !important;
}

/* Botão toggle sempre à direita em mobile */
.navbar .navbar-toggler {
    order: 3 !important;
    margin-left: auto !important;
}

/* Menu collapse */
.navbar .navbar-collapse {
    order: 2 !important;
    flex-basis: 100% !important;
}

/* Contatos sociais */
.navbar .list-inline {
    order: 4 !important;
    margin: 0 !important;
}

/* =========================================================================
   DESKTOP (992px+) - Menu centralizado
   ========================================================================= */
@media (min-width: 992px) {
    .navbar .container-fluid {
        flex-wrap: nowrap !important;
    }

    .navbar .navbar-collapse {
        flex-basis: auto !important;
        flex-grow: 1 !important;
        position: static !important;
        transform: none !important;
        left: auto !important;
    }

    .navbar .navbar-nav {
        margin: 0 auto !important;
        flex-direction: row !important;
        justify-content: center !important;
    }

    #navbar-navlist .nav-item {
        margin-left: 15px;
        margin-right: 15px;
    }

    .navbar .list-inline {
        display: flex !important;
        margin-left: auto !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    .navbar .list-inline-item {
        white-space: nowrap;
        margin-left: 15px !important;
    }
}

/* =========================================================================
   TABLET (768px - 991px)
   ========================================================================= */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar .navbar-collapse {
        flex-basis: 100% !important;
    }

    .navbar .navbar-nav {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    #navbar-navlist .nav-item {
        margin: 5px 10px !important;
    }

    .navbar .list-inline {
        flex-basis: 100% !important;
        justify-content: center !important;
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .navbar .list-inline-item {
        margin: 0 10px !important;
        font-size: 14px !important;
    }

    /* Oculta textos dos contatos, mantém apenas ícones */
    .navbar .list-inline-item span {
        display: none !important;
    }
}

/* =========================================================================
   MOBILE (até 767px)
   ========================================================================= */
@media (max-width: 767px) {
    /* Navbar compacta */
    .navbar {
        padding: 10px 0 !important;
    }

    .navbar .container-fluid {
        padding: 0 15px !important;
    }

    /* Logo menor em mobile */
    .navbar-brand img {
        height: 45px !important;
    }

    /* Menu collapse ocupa toda largura */
    .navbar .navbar-collapse {
        width: 100% !important;
        margin-top: 15px !important;
    }

    /* Itens do menu em coluna */
    .navbar .navbar-nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    #navbar-navlist .nav-item {
        width: 100% !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .navbar .navbar-nav .nav-item > .nav-link {
        padding: 12px 15px !important;
        width: 100% !important;
    }

    /* Dropdown menu */
    .navbar .navbar-nav .nav-item.dropdown .dropdown-menu {
        width: 100% !important;
        border: none !important;
        box-shadow: none !important;
        padding-left: 30px !important;
        background-color: #f8f9fa !important;
    }

    /* Contatos sociais em mobile */
    .navbar .list-inline {
        flex-basis: 100% !important;
        justify-content: center !important;
        padding: 15px 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        flex-wrap: wrap !important;
    }

    /* Ensure contacts inside the collapse look good and menu uses full width */
    .navbar .collapse .list-inline {
        display: flex !important;
        justify-content: center !important;
        gap: 12px !important;
        padding-top: 8px !important;
        flex-wrap: wrap !important;
    }

    .navbar .collapse .list-inline .list-inline-item a {
        padding: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .navbar .list-inline-item {
        margin: 5px 8px !important;
        font-size: 13px !important;
    }

    /* Oculta textos, mantém ícones */
    .navbar .list-inline-item span {
        display: none !important;
    }

    /* Aumenta área de toque dos ícones */
    .navbar .list-inline-item a {
        padding: 8px !important;
        display: inline-block !important;
    }

    /* Use offcanvas as the exclusive mobile menu: hide collapsed navbar on small screens */
    .navbar .navbar-collapse {
        display: none !important;
    }

    /* Hide the desktop icon strip on mobile since icons are available in the offcanvas menu */
    .navbar .list-inline {
        display: none !important;
    }

    /* Make offcanvas full width on small devices for a dedicated mobile menu experience */
    .offcanvas.offcanvas-start {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Add extra top spacing on small screens so the navbar bottom border doesn't overlap content */
@media (max-width: 767px) {
    body {
        padding-top: 80px !important; /* Slightly larger gap for mobile */
    }

    .main-content-wrapper {
        margin-top: 0 !important; /* keep layout consistent; body padding handles the gap */
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 88px !important; /* More room for very small phones */
    }
}

/* For tablet sizes, also use offcanvas to provide closed-by-default mobile-like menu */
@media (min-width: 768px) and (max-width: 991px) {
    .navbar .navbar-collapse {
        display: none !important;
    }

    .offcanvas.offcanvas-start {
        width: 320px !important;
        max-width: 85% !important;
    }
}

/* =========================================================================
   MOBILE PEQUENO (até 480px)
   ========================================================================= */
@media (max-width: 480px) {
    .navbar-brand img {
        height: 40px !important;
    }

    .navbar .navbar-toggler {
        padding: 5px 8px !important;
        font-size: 20px !important;
    }

    .navbar .list-inline-item {
        margin: 3px 5px !important;
        font-size: 12px !important;
    }
}

/* =========================================================================
   2. CORREÇÕES DO RODAPÉ (FOOTER)
   ========================================================================= */

/* Footer base */
footer.footer-bg {
    background: #00346D !important;
    padding: 40px 0 20px 0 !important;
}

/* Estrutura do footer */
footer .row {
    margin: 0 !important;
}

footer .d-flex {
    gap: 20px !important;
}

/* =========================================================================
   DESKTOP (992px+)
   ========================================================================= */
@media (min-width: 992px) {
    footer .d-flex {
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
    }

    footer .d-flex > div {
        flex: 0 0 auto !important;
        min-width: 180px !important;
    }
}

/* =========================================================================
   TABLET (768px - 991px)
   ========================================================================= */
@media (min-width: 768px) and (max-width: 991px) {
    footer .d-flex {
        flex-wrap: wrap !important;
        justify-content: space-around !important;
    }

    footer .d-flex > div {
        flex: 0 0 45% !important;
        margin-bottom: 30px !important;
        text-align: center !important;
    }

    footer .d-flex > div h5 {
        text-align: center !important;
    }

    footer .d-flex > div p,
    footer .d-flex > div ul {
        text-align: center !important;
    }

    /* Remove text-nowrap em tablet */
    footer .text-nowrap {
        white-space: normal !important;
    }
}

/* =========================================================================
   MOBILE (até 767px)
   ========================================================================= */
@media (max-width: 767px) {
    footer.footer-bg {
        padding: 30px 15px 15px 15px !important;
    }

    /* Seções em coluna */
    footer .d-flex {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 25px !important;
    }

    footer .d-flex > div {
        width: 100% !important;
        max-width: 400px !important;
        text-align: center !important;
    }

    /* Títulos centralizados */
    footer .d-flex > div h5 {
        text-align: center !important;
        margin-bottom: 15px !important;
    }

    /* Conteúdo centralizado */
    footer .d-flex > div p,
    footer .d-flex > div ul {
        text-align: center !important;
    }

    /* Remove text-nowrap em mobile */
    footer .text-nowrap {
        white-space: normal !important;
    }

    /* Logos dos parceiros */
    footer .justify-content-center img {
        margin: 5px 10px !important;
        height: 35px !important;
    }

    /* Links das listas */
    footer ul.list-unstyled {
        padding-left: 0 !important;
    }

    /* Copyright */
    footer .border-top {
        margin-top: 20px !important;
        padding-top: 15px !important;
    }

    footer .border-top .col-12 {
        font-size: 12px !important;
    }
}

/* =========================================================================
   MOBILE PEQUENO (até 480px)
   ========================================================================= */
@media (max-width: 480px) {
    footer.footer-bg {
        padding: 20px 10px 10px 10px !important;
    }

    footer .d-flex > div h5 {
        font-size: 1.1rem !important;
    }

    footer .d-flex > div p,
    footer .d-flex > div a {
        font-size: 13px !important;
    }

    footer .justify-content-center img {
        height: 30px !important;
    }
}

/* =========================================================================
   3. CORREÇÕES GERAIS DE RESPONSIVIDADE
   ========================================================================= */

/* Padding top do body para navbar fixa */
body {
    padding-top: 70px !important;
}

@media (max-width: 991px) {
    body {
        padding-top: 60px !important;
    }
}

/* Botão WhatsApp flutuante */
.whatsapp-float {
    bottom: 20px !important;
    right: 20px !important;
}

@media (max-width: 767px) {
    .whatsapp-float {
        bottom: 15px !important;
        right: 15px !important;
    }

    .whatsapp-icon {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Containers */
@media (max-width: 767px) {
    .container,
    .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Títulos de página */
.page-title,
.home-title {
    font-size: 1.8rem !important;
    min-width: auto !important;
    width: 100% !important;
}

@media (max-width: 767px) {
    .page-title,
    .home-title {
        font-size: 1.5rem !important;
        padding: 8px 20px 8px 20px !important;
    }
}

@media (max-width: 480px) {
    .page-title,
    .home-title {
        font-size: 1.3rem !important;
    }
}

/* Cards home-box */
@media (max-width: 767px) {
    .home-box {
        padding: 25px 20px !important;
    }
}

/* Seções */
.section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
}

@media (max-width: 767px) {
    .section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* =========================================================================
   4. MELHORIAS DE ACESSIBILIDADE E USABILIDADE
   ========================================================================= */

/* Área de toque mínima em mobile (44x44px) */
@media (max-width: 767px) {
    .navbar .nav-link,
    .navbar .navbar-toggler,
    button,
    a {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Exceções para textos */
    p a,
    li a {
        min-height: auto !important;
        min-width: auto !important;
        display: inline !important;
    }
}

/* Scroll suave */
html {
    scroll-behavior: smooth !important;
}

/* Foco visível para teclado */
a:focus,
button:focus,
.nav-link:focus {
    outline: 2px solid #0D6DFF !important;
    outline-offset: 2px !important;
}

/* =========================================================================
   5. CORREÇÕES ESPECÍFICAS DO HOME.HTML
   ========================================================================= */

/* Grid de cards */
@media (max-width: 991px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 576px) {
    .cards-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .nav-card {
        height: 180px !important;
    }
}

/* Info card */
@media (max-width: 767px) {
    .info-card {
        padding: 25px 20px !important;
    }

    .hero-title {
        font-size: 1.8rem !important;
    }

    .specialties-list li {
        padding-left: 35px !important;
        font-size: 14px !important;
    }

    .contact-box {
        padding: 20px !important;
        font-size: 14px !important;
    }
}

/* Hero section */
@media (max-width: 991px) {
    .hero-section {
        padding: 40px 0 !important;
    }

    .hero-section .row {
        gap: 30px !important;
    }
}

/* =========================================================================
   FIM DAS CORREÇÕES
   ========================================================================= */