:root {
    --azul-site: #049ee5;
    --vermelho-site: #cc0000;
    --branco: #ffffff;
    --fundo-claro: #fafafa;
    --texto-escuro: #333333;
    --texto-mutado: #666666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--fundo-claro);
    color: var(--texto-escuro);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================
   CABEÇALHO, LOGO E LINHAS DECORATIVAS
========================================== */

.combo-navegacao {
    background-color: var(--azul-site);
    height: 90px;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center; 
}

.container-menu-flex {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start; 
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10; 
}

.logo-img {
    height: 90px;        
    width: auto;        
    object-fit: contain;
    display: block;
}

.linha-decorativa-branca {
    height: 5px;
    background-color: var(--branco);
    width: 100%;
    position: absolute;
    bottom: 11.6px;        
    left: 0;
    z-index: 1;         
    display: block;
}

/* ==========================================
   CONTEÚDO PRINCIPAL E RODAPÉ
========================================== */

.container-principal {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

.rodape-principal {
    background-color: #f1f5f9;
    padding: 30px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.container-rodape {
    max-width: 1200px;
    margin: 0 auto;
}

.anvisa-bloco {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.anvisa-logo-img {
    height: 40px;
}

.copyright-bloco {
    text-align: center;
    font-size: 0.85rem;
    color: var(--texto-mutado);
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #cbd5e1;
}

/* ==========================================================================
   ESTILIZAÇÃO DO MODAL GLOBAL (CONTROLO EXCLUSIVO VIA JS/LOJAS.JS)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Fundo escuro semitransparente */
    display: none;                        /* Escondido por padrão */
    justify-content: center;
    align-items: center;
    z-index: 99999;                       /* Máxima prioridade (à frente de menus e abas) */
    padding: 20px;
}

/* Classe dinâmica injetada exclusivamente pelo js/lojas.js para exibir o modal */
.modal.aberto {
    display: flex;
    animation: abrirModalSuave 0.2s ease-out;
}

.modal-content {
    background-color: var(--branco, #ffffff);
    width: 100%;
    max-width: 750px;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background-color: var(--azul-site, #049ce5); /* Mantém o azul padrão da Drogaquinze */
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Botão de fechar (O ouvinte do clique está mapeado nesta classe no lojas.js) */
.btn-fechar-modal {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-fechar-modal:hover {
    transform: scale(1.2);
}

/* Área interna onde o iframe do Google Maps vai renderizar */
#modal-corpo {
    flex: 1;
    background-color: #f8fafc;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Animação suave ao abrir */
@keyframes abrirModalSuave {
    from { 
        opacity: 0; 
        transform: scale(0.96); 
    }
    to { 
        opacity: 1; 
        transform: scale(1); 
    }
}

/* ==========================================
   RESPONSIVIDADE (MOBILE)
========================================== */
@media (max-width: 768px) {
    .combo-navegacao {
        height: 60px;
    }

    .container-menu-flex {
        justify-content: flex-start; 
    }

    .logo-img {
        height: 60px; 
    }

    .linha-decorativa-branca {
        height: 3px;
        bottom: 8px;
    }

    /* --- AJUSTE FORÇADO PARA AS ABAS NO CENTRO E PEQUENAS --- */
    .abas-container-meio {
        display: flex !important;
        flex-direction: column !important; /* Força a ficar lado a lado em vez de empilhar */
        flex-wrap: wrap !important;       /* Quebra a linha de forma elegante se o ecrã for muito estreito */
        justify-content: center !important;/* Coloca todas as abas centralizadas */
        gap: 8px !important;
        margin: 0 auto 25px auto !important;
        width: 50% !important;
    }

    .abas-container-meio .btn-aba {
        width: auto !important;          /* Remove de vez o 100% que estava a esticar os botões */
        flex: none !important;           /* Impede o botão de tentar preencher o ecrã */
        font-size: 0.8rem !important;    /* Texto ligeiramente menor para caber melhor */
        padding: 8px 12px !important;    /* Espaçamento interno reduzido e compacto */
        height: auto !important;         /* Remove alturas fixas de 50px antigas */
        justify-content: center !important;
    }
}