/********** Template CSS - Versão Red & White (Lord Pedro) **********/
:root {
    /* -- MUDANÇA: Tons de Vermelho -- */
    --primary: #D61C22;   /* Vermelho Principal Vibrante */
    --secondary: #A80F15; /* Vermelho Mais Escuro / Sangue */
    --tertiary: #555555;  /* Cinza neutro (Texto) */
    
    /* -- MUDANÇA: Tons de Branco/Claro -- */
    --light: #F8F9FA;     /* Branco Sujo / Cinza muito claro (substitui o azul claro) */
    
    /* -- MUDANÇA: Tons Escuros -- */
    --dark: #0F0F0F;      /* Preto Quase Total (substitui o azul escuro) */
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

h1,
.h1,
h2,
.h2,
.fw-bold {
    font-weight: 700 !important;
}

h3,
.h3,
h4,
.h4,
.fw-medium {
    font-weight: 600 !important;
}

h5,
.h5,
h6,
.h6,
.fw-semi-bold {
    font-weight: 500 !important;
}


/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}


/*** Button ***/
.btn {
    transition: .5s;
    font-weight: 500;
}

.btn-primary,
.btn-outline-primary:hover {
    color: #FFFFFF; /* Garante texto branco no botão vermelho */
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}


/*** Navbar ***/
.fixed-top {
    transition: .5s;
}

.top-bar {
    height: 45px;
    /* MUDANÇA: Ajuste da cor da borda para um tom avermelhado subtil */
    border-bottom: 1px solid rgba(214, 28, 34, .07); 
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    vertical-align: middle;
    margin-left: 8px;
}

.navbar .navbar-nav .nav-link {
    padding: 25px 15px;
    color: var(--tertiary);
    font-weight: 500;
    outline: none;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        margin-top: 10px;
        border-top: 1px solid rgba(0, 0, 0, .07);
        background: #FFFFFF;
    }

    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        transition: .5s;
        opacity: 0;
    }

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Header ***/
.carousel-caption {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: start;
    z-index: 1;
}

.carousel-control-prev,
.carousel-control-next {
    width: 3rem;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--primary);
    border: 10px solid var(--primary);
}

.carousel-control-prev-icon {
    border-radius: 0 3rem 3rem 0;
}

.carousel-control-next-icon {
    border-radius: 3rem 0 0 3rem;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    padding-top: 12rem;
    padding-bottom: 6rem;
    background: url(../img/header.jpg) top left no-repeat;
    background-size: cover;
}

.page-header .breadcrumb-item,
.page-header .breadcrumb-item a {
    font-weight: 500;
}

.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: var(--tertiary);
}


/*** Facts ***/
.facts {
    /* MUDANÇA: Gradiente Vermelho (RGB: 214, 28, 34) */
    background: linear-gradient(rgba(214, 28, 34, .95), rgba(214, 28, 34, .95)), url(../img/bg.png);
}


/*** Callback ***/
.callback {
    position: relative;
}

.callback::before {
    position: absolute;
    content: "";
    width: 100%;
    height: 50%;
    top: 0;
    left: 0;
    /* MUDANÇA: Gradiente Vermelho (RGB: 214, 28, 34) */
    background: linear-gradient(rgba(214, 28, 34, .95), rgba(214, 28, 34, .95)), url(../img/bg.png);
    z-index: -1;
}


/*** Feature ***/
.feature .feature-box,
.feature .feature-box * {
    transition: .5s;
}

.feature .feature-box:hover {
    background: var(--primary);
    border-color: var(--primary) !important;
}

.feature .feature-box:hover * {
    color: #FFFFFF !important;
}


/*** Service ***/
.service .nav .nav-link {
    transition: .5s;
}

.service .nav .nav-link.active {
    border-color: var(--primary) !important;
    background: var(--primary);
}

.service .nav .nav-link.active h5 {
    color: #FFFFFF !important;
}

.service .nav .nav-link.active h5 i {
    color: #FFFFFF !important;
}


/*** Project ***/
.project-item,
.project-item .project-img {
    position: relative;
}

.project-item .project-img a {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    opacity: 0;
    transition: .5s;
}

.project-item:hover .project-img a {
    opacity: 1;
}

.project-item .project-title {
    position: absolute;
    top: 3rem;
    right: 0;
    bottom: 0;
    left: 3rem;
    border: 1px solid var(--light);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    z-index: -1;
    transition: .5s;
}

.project-item:hover .project-title {
    background: var(--primary);
    border-color: var(--primary);
}

.project-item .project-title h4 {
    transition: .5s;
}

.project-item:hover .project-title h4 {
    color: #FFFFFF;
}

.project-carousel .owl-nav {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.project-carousel .owl-nav .owl-prev,
.project-carousel .owl-nav .owl-next {
    margin: 0 12px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--light);
    border-radius: 45px;
    font-size: 22px;
    transition: .5s;
}

.project-carousel .owl-nav .owl-prev:hover,
.project-carousel .owl-nav .owl-next:hover {
    background: var(--primary);
    color: var(--light); /* Texto branco ao passar o rato */
}


/*** Team ***/
.team-item {
    position: relative;
    padding: 4rem 0;
}

.team-item img {
    position: relative;
    z-index: 2;
}

.team-item .team-text {
    position: absolute;
    top: 0;
    right: 3rem;
    bottom: 0;
    left: 3rem;
    padding: 15px;
    border: 1px solid var(--light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: .5s;
    z-index: 1;
}

.team-item:hover .team-text {
    background: var(--primary);
    border-color: var(--primary);
}

.team-item .team-text h4 {
    transition: .5s;
}

.team-item:hover .team-text h4 {
    color: #FFFFFF;
}

.team-item .team-social .btn {
    background: var(--light);
    color: var(--primary);
}

.team-item:hover .team-social .btn {
    background: #FFFFFF;
}

.team-item .team-social .btn:hover {
    background: var(--primary);
    color: #FFFFFF; /* Texto branco no hover */
}


/*** Testimonial ***/
.testimonial-item {
    position: relative;
    text-align: center;
    padding-top: 30px;
}

.testimonial-item .testimonial-text {
    position: relative;
    text-align: center;
}

.testimonial-item .testimonial-text .btn-square {
    position: absolute;
    width: 60px;
    height: 60px;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

.testimonial-item .testimonial-text::before {
    position: absolute;
    content: "";
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    border: 30px solid;
    border-color: var(--light) transparent transparent transparent;
}

.testimonial-item .testimonial-text::after {
    position: absolute;
    content: "";
    bottom: -59px;
    left: 50%;
    transform: translateX(-50%);
    border: 30px solid;
    border-color: #FFFFFF transparent transparent transparent;
}

.testimonial-carousel .owl-item img {
    margin: 0 auto;
    width: 100px;
    height: 100px;
}

.testimonial-carousel .owl-dots {
    margin-top: 25px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--light);
    border-radius: 30px;
    transition: .5s;
}

.testimonial-carousel .owl-dot::after {
    position: absolute;
    content: "";
    width: 16px;
    height: 16px;
    top: 6px;
    left: 6px;
    border-radius: 16px;
    background: var(--light);
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    border-color: var(--primary);
}

.testimonial-carousel .owl-dot.active::after {
    background: var(--primary);
}


/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: var(--light);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--primary);
    letter-spacing: 1px;
    box-shadow: none;
}

.copyright {
    color: var(--light);
    background: #000000; /* Preto Total ou use var(--dark) */
}

.copyright a {
    color: var(--light);
}

.copyright a:hover {
    color: var(--primary);
}

/********** CORREÇÃO DE CORES (AZUL PARA VERMELHO) **********/

/* Forçar texto vermelho onde o Bootstrap usa azul */
.text-primary {
    color: var(--primary) !important;
}

/* Forçar botões vermelhos */
.btn-primary {
    color: #FFFFFF;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-primary:hover {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}

/* Forçar botões de contorno (outline) */
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary) !important;
    color: #FFFFFF !important;
}

/* Forçar fundos vermelhos */
.bg-primary {
    background-color: var(--primary) !important;
}

/* Links padrão */
a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--secondary);
}

/* Paginação e outros elementos ativos */
.page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Accordion (perguntas frequentes, se houver) */
.accordion-button:not(.collapsed) {
    color: var(--primary) !important;
    background-color: rgba(214, 28, 34, 0.1) !important; /* Vermelho claro */
}

/* Ícones sociais no topo e rodapé quando hover */
.btn-light:hover {
    color: var(--primary) !important;
}


/* 1. Fundo do Rodapé Principal (Substitui o Azul Escuro) */
.footer.bg-dark {
    /* Usamos o seu vermelho secundário (mais escuro) para o fundo */
    background-color: var(--secondary) !important; 
    
    /* (Opcional) Gradiente subtil para dar um aspeto mais "premium" */
    background: linear-gradient(to bottom, #A80F15, #8a0c11) !important;
}

/* 2. Fundo da Área de Copyright (Substitui o Preto) */
.copyright {
    /* Um tom de vermelho muito escuro (Bordeaux) para a base */
    background-color: #5c070b !important; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Linha fina para separar */
}

/* 3. Garantir que os textos e links ficam legíveis (Branco/Claro) */
.footer .text-white,
.footer .mb-2 {
    color: #ffffff !important;
}

.footer .btn.btn-link {
    color: rgba(255, 255, 255, 0.8) !important; /* Branco com ligeira transparência */
}

.footer .btn.btn-link:hover,
.footer .btn.btn-link:focus {
    color: #ffffff !important; /* Branco total ao passar o rato */
    letter-spacing: 1px;
    box-shadow: none;
}

/* Ícones de redes sociais no rodapé (Contorno branco, fundo vermelho ao passar o rato) */
.footer .btn-square {
    border-color: rgba(255,255,255,0.5) !important;
    color: #ffffff !important;
}

.footer .btn-square:hover {
    background-color: #ffffff !important;
    color: var(--primary) !important; /* Ícone fica vermelho, fundo branco */
    border-color: #ffffff !important;
}


/********** CONFIGURAÇÃO E TROCA DE LOGO (CORRIGIDO) **********/

/* Ajuste da área da marca para alinhar verticalmente */
.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    height: 100%;
}

/* Configuração das imagens dos logos */
.navbar-brand img {
    max-height: 80px; /* Altura máxima para não estragar o menu */
    width: auto;
    transition: all 0.3s ease;
}

/* --- ESTADO INICIAL (Topo - Fundo Transparente) --- */
.logo-topo {
    display: block;
}

.logo-scroll {
    display: none;
}

/* --- ESTADO SCROLL (Quando a barra fixa ganha fundo branco) --- */
/* O template adiciona 'bg-white' ou 'shadow' ao div .fixed-top */

.fixed-top.bg-white .logo-topo,
.fixed-top.shadow .logo-topo,
.fixed-top.shadow-sm .logo-topo,
.navbar.bg-white .logo-topo {
    display: none !important;
}

.fixed-top.bg-white .logo-scroll,
.fixed-top.shadow .logo-scroll,
.fixed-top.shadow-sm .logo-scroll,
.navbar.bg-white .logo-scroll {
    display: block !important;
}


/********** CORREÇÃO DEFINITIVA DE CONTRASTE **********/

/* --- 1. Barra de Topo (Top Bar) --- */

/* Lado ESQUERDO (Sobre o Vermelho) -> Texto Branco */
.top-bar .text-start small, 
.top-bar .text-start small i {
    color: #FFFFFF !important;
    text-shadow: none !important;
}

/* Lado DIREITO (Sobre o Branco) -> Texto Vermelho */
.top-bar .text-end small, 
.top-bar .text-end small a,
.top-bar .text-end small i {
    color: var(--secondary) !important; /* Vermelho escuro para leitura perfeita */
    text-shadow: none !important;
    font-weight: 600; /* Um pouco mais grosso para destacar */
}


/* --- 2. Etiqueta "Apoio à Gestão" / "Bem-vindo" --- */

/* Transformamos o texto solto num "Botão/Etiqueta" sólida */
.carousel-caption p.d-inline-block {
    background-color: var(--primary) !important; /* Fundo Vermelho */
    color: #FFFFFF !important;                   /* Texto Branco */
    border-color: var(--primary) !important;     /* Borda Vermelha */
    
    /* Remover sombras de texto anteriores para ficar limpo */
    text-shadow: none !important;
    
    /* Adicionar sombra na caixa para dar destaque 3D */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3); 
    
    /* Garantir opacidade total */
    opacity: 1 !important;
}

/* --- 3. Ajuste fino do Título Grande --- */
/* Garantir que o título tem sombra suficiente caso passe para a zona branca */
.carousel-caption h1 {
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.5) !important;
}


/********** CORREÇÃO AUTOMÁTICA PARA PÁGINAS INTERNAS **********/

/* Esta regra verifica se a página tem um cabeçalho interno (.page-header).
   Se tiver (ou seja, não é a Home), força a barra de topo a ser Branca Sólida.
*/
body:has(.page-header) .fixed-top {
    background-color: #FFFFFF !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
}

/* 1. Troca as Cores do Texto para Escuro/Vermelho (para ler no fundo branco) */
body:has(.page-header) .navbar-nav .nav-link {
    color: #555555 !important; /* Cinzento Escuro */
    text-shadow: none !important;
}

body:has(.page-header) .navbar-nav .nav-link:hover,
body:has(.page-header) .navbar-nav .nav-link.active {
    color: var(--primary) !important; /* Vermelho */
}

/* 2. Força o Logo Colorido a aparecer (e esconde o branco) */
body:has(.page-header) .logo-topo {
    display: none !important;
}

body:has(.page-header) .logo-scroll {
    display: block !important;
}

/* 3. Ajusta os Contactos de Topo para Vermelho */
body:has(.page-header) .top-bar small,
body:has(.page-header) .top-bar small i,
body:has(.page-header) .top-bar small a {
    color: var(--secondary) !important;
    text-shadow: none !important;
}

/* 4. Ajusta os Ícones Sociais */
body:has(.page-header) .btn-light {
    background: #F8F9FA !important;
    color: var(--primary) !important;
    border: none !important;
}