/*--------------------------------------------------------PORTEFOLIO/GALERIA----------------------------------------------------------------*/
/* Container principal */
.masonry-dacrilux {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
    /* Adiciona isto para ajudar o navegador a não recalcular tudo */
    will-change: transform;
}

/* Imagens - Desativamos a transição complexa durante scroll */
.gallery-item img {
    width: 100% !important;
    height: 335px !important;
    object-fit: cover;
    display: block;
    /* IMPORTANTE: Desativar animação na imagem, mover apenas para o container */
    transition: none;
}

/* O zoom acontece apenas no container, é mais leve */
.gallery-item a {
    display: block;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.gallery-item a:hover {
    transform: scale(1.03);
    /* Zoom ligeiro no link, não na imagem pesada */
}

/* Otimização de filtro - Usa opacity em vez de cor de fundo se possível */
.gallery-item a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
    pointer-events: none;
}

.gallery-item a:hover::before {
    opacity: 1;
}

/* Ícone de zoom - Simplificado */
.gallery-item a::after {
    content: "+";
    /* Usar um caracter de texto é 100x mais leve que carregar font-icons */
    font-size: 40px;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 3;
    pointer-events: none;
}

/* Ícone de Zoom (FontAwesome) */
.gallery-item a.img-thumbnail-hover-icon::after {
    content: "\f00e";
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    /* Necessário para carregar o ícone corretamente */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 2rem;
    z-index: 3;
    pointer-events: none;
}

/* Ativação do Hover no Link */
.gallery-item a:hover::before,
.gallery-item a:hover::after {
    opacity: 1;
}

.appear-animation {
    will-change: opacity;
    /* Diz ao navegador que a opacidade vai mudar, otimizando o render */
}

/*--------------------------------------------------------WHATSAPP----------------------------------------------------------------*/
.whatsapp-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
}

.whatsapp-button {
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    text-decoration: none;
}

.whatsapp-menu {
    display: none;
    flex-direction: column;
    background: white;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.whatsapp-menu a {
    padding: 8px 10px;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.whatsapp-menu a:last-child {
    border-bottom: none;
}

.whatsapp-container:hover .whatsapp-menu {
    display: flex;
}

/*--------------------------------------------------------MARCAS----------------------------------------------------------------*/

.logo-marquee-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    position: relative;
}

.logo-marquee {
    display: flex;
    width: max-content;
    /* Garante que a largura seja exatamente o conteúdo */
    animation: marquee 30s linear infinite;
    /* 30s = velocidade lenta */
}

.logo-item {
    margin: 0 40px;
    flex-shrink: 0;
}

.logo-item img {
    height: 60px;
    width: auto;
    filter: grayscale(1);
    transition: filter 0.3s;
}

.logo-item img:hover {
    filter: grayscale(0);
}

/* Animação que volta à posição 0 sem saltos */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/*----------------------------------------------------------------LOGO HEADER--------------------------------------------*/

.logo-branco {
    transition: filter 0.3s ease;
    /* Transição suave caso queira remover o filtro no hover */
}

/* Opcional: Se quiser que ele volte à cor original ao passar o rato */
/*.logo-branco:hover {
    filter: brightness(1) invert(0);
}*/

@media (max-width: 991px) {
    .logo-branco {
        right: 0px !important;
    }

    .logo-original {
        right: 0px !important;
    }
}



/*------------------------------------------------ 1. Reset: Fundo do Header Inicial (Transparente)--------------------------- */
#header .header-body {
    background-color: transparent !important;
    transition: background-color 0.4s ease !important;
}

/* 2. Quando o Header está SCROLLED (Sticky) */
html.sticky-header-active #header .header-body {
    background-color: #ffffff !important;
    border-bottom: 1px solid #eee !important;
}

/* 3. Mudar a cor dos textos e ícones quando está SCROLLED */
/* Links do Menu */
html.sticky-header-active #header .header-nav-main nav>ul>li>a {
    color: var(--primary) !important;
}

/* Correção Hover e Active para o Menu (Forçar --primary) */
html.sticky-header-active #header .header-nav-main nav>ul>li>a:hover,
html.sticky-header-active #header .header-nav-main nav>ul>li>a.active {
    color: var(--primary) !important;
    opacity: 0.7;
}

/* Redes Sociais */
html.sticky-header-active #header .social-icons.social-icons-icon-light.social-icons-clean li a i {
    color: var(--primary) !important;
}

/* Efeito Hover das Redes Sociais (Manter --primary em vez de branco) */
html.sticky-header-active #header .social-icons.social-icons-icon-light.social-icons-clean li a:hover i {
    color: var(--primary) !important;
    opacity: 0.7;
}

/* 4. Lógica dos Logos */
#header .logo-original {
    display: none !important;
}

#header .logo-branco {
    display: block !important;
}

html.sticky-header-active #header .logo-branco {
    display: none !important;
}

html.sticky-header-active #header .logo-original {
    display: block !important;
}

/* 5. Ícone de pesquisa e botão mobile no scroll */
html.sticky-header-active #header .header-nav-features .header-nav-top-icon,
html.sticky-header-active #header .header-btn-collapse-nav {
    color: var(--primary) !important;
}

@media (max-width: 991px) {

    /* Força o header body a fixar no topo e mudar de fundo no scroll */
    html.sticky-header-active #header .header-body {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #ffffff !important;
        border-bottom: 1px solid #eee !important;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !important;
        z-index: 9999 !important;
    }

    /* Reduz o tamanho do logo em ecrãs pequenos (abaixo de 767px) */
    @media (max-width: 767px) {
        #header .header-logo img {
            width: 100px !important;
            /* Logo mais pequeno no telemóvel */
            height: auto !important;
        }
    }

    /* Força a cor primary (#231f20) no botão Hambúrguer no scroll */
    html.sticky-header-active #header .header-btn-collapse-nav {
        color: var(--primary) !important;
        background-color: transparent !important;
    }

    /* Garante que o menu móvel aberto fique por baixo do header corretamente */
    html.sticky-header-active #header .header-nav-main {
        top: 100% !important;
    }
}

/* Cor do botão hambúrguer mesmo quando não há scroll (fundo escuro do topo) */
#header .header-btn-collapse-nav {
    color: var(--light) !important;
    /* Branco quando o menu é transparente */
    transition: color 0.3s ease;
}

@media (max-width: 991px) {
    html.sticky-header-active #header .header-nav-main nav>ul>li>a.active {
        color: #fff !important;
        opacity: 0.7;
    }
}


/* =========================================================================
   GALERIA E HERO REPSONSIVO (DESKTOP VS MOBILE < 1400px)
   ========================================================================= */

/* 1. Comportamento Padrão (Desktop) */
.carousel-mobile-only {
    display: none !important;
    /* Esconde o carrossel no desktop */
}

/* 2. Comportamento Responsivo (Mobile & Tablet) */
@media (max-width: 1400px) {

    /* Esconde todo o bloco do desktop (imagens de camadas, marca de água e texto longo) */
    .desktop-layout {
        display: none !important;
    }

    /* Ativa o carrossel mobile */
    .carousel-mobile-only {
        display: block !important;
    }

    /* Define a altura e o comportamento do slide no mobile */
    .mobile-slide {
        position: relative;
        height: 550px;
        /* Altura do banner no telemóvel */
        width: 100%;
    }

    .mobile-slide img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    /* Máscara Escura sobre a imagem para dar contraste ao texto branco */
    .mobile-slide::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.65);
        /* 65% de opacidade preta */
        z-index: 1;
    }

    /* Centralização Absoluta do Texto sobre o Carrossel */
    .mobile-text-overlay {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        max-width: 600px;
        /* Evita que o texto encoste nas bordas em tablets */
        text-align: center;
        z-index: 2;
        padding: 0 20px;
    }

    /* Força os títulos e parágrafos do mobile a serem brancos */
    .mobile-text-overlay h2,
    .mobile-text-overlay h3,
    .mobile-text-overlay p {
        color: #ffffff !important;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
        /* Sombra suave para melhorar a leitura */
    }
}

html #header.header-transparent {
    min-height: 0 !important;
    width: 100%;
    position: absolute;
    background: white !important;
}

#header .header-nav.header-nav-links.header-nav-light-text nav > ul > li > a, #header .header-nav.header-nav-line.header-nav-light-text nav > ul > li > a {
    color: #231f20 !important;
}

#header .header-nav.header-nav-line nav > ul:not(:hover) li > a.active {
        color: #231f20 !important;
    }

    /* Estilo das Bandeiras */
.lang-flags {
    gap: 6px;
}

.lang-flags a {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.lang-flags a:hover {
    transform: scale(1.15);
    opacity: 1;
}

.lang-flags img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

/* Ocultar barra superior e avisos automáticos do Google Translate */
.goog-te-banner-frame.skiptranslate,
body > .skiptranslate,
#goog-gt-tt {
    display: none !important;
}

body {
    top: 0px !important;
}

.goog-tooltip, 
.goog-tooltip:hover {
    display: none !important;
}

.goog-text-highlight {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}