body, html { overflow-x: hidden !important; position: relative; width: 100%; }
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    color: #FFFFFF;
    font-family: 'Helvetica Neue', sans-serif;
    /* IMPORTANTE: Em mobile (onde o Lenis desativa o smooth e usa o scroll nativo), o overflow-y não pode ser hidden! */
    overflow-y: auto; 
    overflow-x: hidden;
}

/* --- PARTÍCULAS GLOBAIS (3D Depth) --- */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Atrás de todos os vidros e fundos */
    pointer-events: none; /* Deixa o rato passar através */
}

#particles-fg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9997; /* À frente de tudo, mas atrás da navegação e modais */
    pointer-events: none;
}


/* --- Technical Grid Background --- */
body {
    background-color: var(--theme-bg, #000000); /* Fallback for older browsers */
    background-image: repeating-linear-gradient(
        150deg,
        #0D0D0D,
        #0D0D0D 2px,
        #000000 2px,
        #000000 8px
    );
}

/* --- Fixed Header Minimalista --- */
#main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 9900;
    
    /* Configuração de transições "a sair" (quando se volta ao topo) */
    transition: 
        top 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        padding 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        background-color 0.4s ease, 
        backdrop-filter 0.4s ease,
        -webkit-backdrop-filter 0.4s ease,
        box-shadow 0.4s ease, 
        border-color 0.4s ease;
        
    align-items: center;
    padding: 0 50px;
    box-sizing: border-box;
    background-color: rgba(5, 5, 5, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0);
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
    
    /* Retirar o blur no estado inicial para que o vidro seja INEXISTENTE */
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

#main-header.header-scrolled {
    top: 0;
    padding-top: 10px;
    padding-bottom: 10px;
    
    /* Configuração de transições "a entrar" (quando se faz scroll down)
       O SEGREDO: O Top/Padding começam de imediato e demoram 0.8s a subir.
       As cores, o vidro e as sombras só começam DEPOIS (delay de 0.6s) e duram 0.8s a aparecer. */
    transition: 
        top 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        padding 0.8s cubic-bezier(0.25, 1, 0.5, 1),
        background-color 0.8s ease 0.6s, 
        backdrop-filter 0.8s ease 0.6s,
        -webkit-backdrop-filter 0.8s ease 0.6s,
        box-shadow 0.8s ease 0.6s, 
        border-color 0.8s ease 0.6s;
        
    background-color: rgba(5, 5, 5, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Forçar os botões no cabeçalho a perderem a margem extra do .details-btn */
#main-header .details-btn {
    margin-top: 0; 
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Encolher e tornar muito mais discretos os botões após o scroll */
#main-header.header-scrolled .details-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

#main-header.header-scrolled .details-btn:hover {
    color: #000;
    background-color: var(--theme-primary, #d4af37);
    border-color: var(--theme-primary, #d4af37);
}

.nav-contact-link {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.85rem; 
    letter-spacing: 5px;
    font-weight: bold; 
    transition: color 0.3s ease;
}

.nav-contact-link:hover {
    color: #00d4ff;
}

/* --- Side Navigation (Rebites) --- */
#side-nav {
    position: fixed;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998; /* Forçado para a frente, logo abaixo do header */
}

#side-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0; 
    align-items: flex-end;
}

#side-nav ul li a {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 7.5px 0 7.5px 30px; 
    text-decoration: none;
    position: relative;
}

.dot {
    display: block;
    width: 8px; 
    height: 8px; 
    background-color: rgba(255, 255, 255, 0.3); 
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer; 
}

#side-nav ul li a:hover .dot, 
#side-nav ul li a.active .dot {
    background-color: #ffffff;
    transform: scale(1.5);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); 
}

#side-nav ul li a.active .contact-dot, 
#side-nav ul li a:hover .contact-dot {
    background-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8); 
}

#side-nav ul li a::after {
    content: attr(data-name);
    position: absolute;
    right: 20px; 
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 0.7rem; 
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
}

#side-nav ul li a:hover::after {
    opacity: 1; 
}

/* --- THEME SYSTEM: CORTE DE CHAPA DUPLA A 150º --- */

/* Tema Aura (para o Hero) */
.theme-aura .aura-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150vw;
    height: 150vh;
    /* Um gradiente suave (10%) com a cor dourada do tema para se notar melhor */
    background: radial-gradient(circle, color-mix(in srgb, var(--theme-color) 10%, transparent) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.theme-aura .content h1 {
    /* Toque de luxo subtil no título do Hero */
    text-shadow: 0 0 30px color-mix(in srgb, var(--theme-color) 40%, transparent);
}


/* Tema Glass (para as secções de serviços) */
.glass-panel {
    position: relative;
    background-color: rgba(10, 10, 10, 0.3); 
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-radius: 8px;
    padding: 35px 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden; 
    will-change: transform;
}

.theme-glass .glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-glass .glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        150deg,
        transparent,
        transparent 30%,
        color-mix(in srgb, var(--theme-color) 15%, transparent) 30%,
        color-mix(in srgb, var(--theme-color) 15%, transparent) 30.5%,
        transparent 30.5%,
        transparent 60%
    );
    z-index: -1; 
}

/* --- MARCA DE ÁGUA TÉCNICA (SÍMBOLOS) --- */
/* Injetamos o valor de `--service-icon` como Material Symbol no fundo do cartão */
.theme-glass .glass-panel::after {
    content: var(--service-icon);
    font-family: 'Material Symbols Outlined';
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    font-size: 20rem;
    line-height: 1;
    color: var(--theme-color);
    opacity: 0.08;
    user-select: none;
    pointer-events: none;
    z-index: -1; 
}


/* --- Detalhes dos Botões Comuns --- */
.details-btn {
    display: inline-block;
    background-color: transparent;
    border: 1px solid color-mix(in srgb, var(--theme-color) 50%, #fff); 
    color: #fff;
    padding: 10px 20px;
    margin-top: 10px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

section[class*="theme-glass"] .details-btn:hover {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    color: #000;
}


/* --- Base Layout --- */
#background-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -3; /* Atrás de tudo, inclusive das partículas */
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.layer.visible {
    opacity: 1;
}

.fullscreen-section {
    position: relative; 
    width: 100vw;
    height: 75vh; 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#hero-4winners.fullscreen-section {
    height: 100vh;
}

#laser-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
}

.content {
    position: relative; 
    z-index: 1;
    max-width: 800px;
    width: 80%; /* Garante que os cartões têm uma largura consistente */
    padding: 20px;
}

.content > * {
    opacity: 0;
    transform: translateY(30px);
    will-change: transform, opacity;
}

.content h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
}

.content p {
    font-size: 1.5rem;
    line-height: 1.6;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    #side-nav {
        display: none; 
    }

    #main-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        top: 40px;
        left: 0;
        padding: 0 20px;
    }

    #main-header.header-scrolled {
        top: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav-contact-link {
        font-size: 0.75rem; 
    }

    .content h1 {
        font-size: 1.45rem; 
        letter-spacing: 2px;
    }

    .content p {
        font-size: 1.2rem; 
    }
    
    .glass-panel {
        padding: 30px 20px;
        width: 90%;
        backdrop-filter: blur(6px) saturate(110%);
        -webkit-backdrop-filter: blur(6px) saturate(110%);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }
    
    /* Encolhe o ícone de marca de água nos telemóveis */
    .theme-glass .glass-panel::after {
        font-size: 12rem;
        right: -10px;
    }
}


/* Fallback Botões (ex: Secção Contacto se perder tema) */
section:not([class*="theme-"]) .details-btn {
    border-color: #fff;
}
section:not([class*="theme-"]) .details-btn:hover {
    background-color: #fff;
    color: #000;
}

.cta-btn {
    margin-top: 40px;
    background-color: #00d4ff;
    border-color: #00d4ff;
    color: #000;
    font-weight: bold;
    text-align: center;
    width: calc(100% - 40px); 
}

.cta-btn:hover {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

/* --- Modal Styles (HYBRID SPLIT LAYOUT) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Um pouco mais escuro para destacar as imagens */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000; 
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(10px); /* Foca a atenção no modal */
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--theme-bg, #111111);
    border: 1px solid #333;
    border-radius: 8px;
    position: relative;
    /* O modal agora é muito mais largo para suportar o ecrã dividido */
    max-width: 1000px;
    width: 95%;
    /* Removemos o padding geral do .modal-content, vamos geri-lo dentro do layout */
    padding: 0; 
    transform: translateY(20px);
    transition: transform 0.4s ease;
    overflow: hidden; /* Garante que a imagem não sai dos cantos arredondados */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-overlay.visible .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    /* O botão de fechar flutua sobre a imagem ou o texto no topo direito */
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #fff;
    color: #000;
}

/* --- Layout de Ecrã Dividido (Split Layout) --- */
.modal-layout-container {
    display: flex;
    flex-direction: row;
}

/* Secção da Imagem/Media (Lado Esquerdo) */
.modal-media-wrapper {
    flex: 0 0 50%; /* Ocupa exatamente 50% da largura */
    background-color: #000;
    position: relative;
    border-right: 1px solid #333;
}

.modal-media-wrapper img,
.modal-media-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* A imagem preenche o espaço sem distorcer (corta as pontas se necessário) */
}

/* Secção do Texto (Lado Direito) */
.modal-text-section {
    /* Box-sizing previne que o padding se some aos 50% de largura no Flexbox, que causava o corte de texto */
    box-sizing: border-box; 
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centra o texto verticalmente */
}

.modal-text-section.split-width {
    flex: 0 0 50%; /* Se houver imagem, ocupa os outros 50% */
}

.modal-text-section.full-width {
    flex: 1 1 100%; /* Se não houver imagem (ex: Contactos), ocupa tudo */
}


#modal-title {
    margin-top: 0;
    text-transform: uppercase;
    margin-bottom: 25px;
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--theme-primary, #d4af37); /* Usa a cor dourada premium */
}

.modal-description {
    font-size: 1rem;
    line-height: 1.7;
    color: #cccccc;
}

#modal-body h3 {
    margin-top: 10px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: #888;
}

#modal-body ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Estilo tipo 'Tags' para os materiais */
#modal-body li {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #fff;
}

/* Contact Info inside Modal */
.contact-modal-info {
    text-align: left;
}

.contact-item {
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.8;
}

.contact-item strong {
    display: block;
    margin-bottom: 5px;
    color: #888;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.contact-item a {
    color: #FFFFFF;
    text-decoration: none;
    border-bottom: 1px dotted #ffffff;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.contact-item a:hover {
    color: var(--theme-primary, #d4af37);
    border-bottom-color: var(--theme-primary, #d4af37);
}

.schedule {
    display: flex;
    flex-direction: column;
    color: #ccc;
}

/* Ajustes Responsive para o Modal Híbrido */
@media (max-width: 768px) {
    .modal-layout-container {
        flex-direction: column; /* Em mobile, a imagem fica em cima, o texto em baixo */
    }

    .modal-media-wrapper {
        flex: none;
        width: 100%;
        height: 300px; /* Define uma altura fixa para a imagem no telemóvel */
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .modal-text-section {
        padding: 30px 20px;
    }
    
    #modal-title {
        font-size: 1.5rem;
    }
}
/* --- FADE EFFECTS FOR PARTICLES (PHASE 1) --- */
#particles-bg, #particles-fg {
    transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1);
}
.particles-hidden {
    opacity: 0 !important;
}

/* --- LAYOUT SPLIT (ZIGZAG) NO FLUXO PRINCIPAL --- */
.layout-split {
    display: flex;
    justify-content: center; /* Centraliza o bloco todo */
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 0 5%;
    
    /* override some inherited fullscreen properties */
    height: auto; /* let it adapt to content + margin */
    box-sizing: border-box;
    padding-top: 40px; padding-bottom: 40px; /* Leave space for header */
}

/* Modificadores para a direção do ZigZag */
.layout-split.zigzag-left {
    flex-direction: row; /* Imagem esquerda, texto direita */
}

.layout-split.zigzag-right {
    flex-direction: row-reverse; /* Imagem direita, texto esquerda */
}

.layout-split .section-media {
    width: 60%; /* Imagem ocupa mais espaço para impacto */
    height: 60vh; /* Altura considerável */
    max-height: 600px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    z-index: 1; /* Fica atrás do painel de vidro */
    border: 1px solid rgba(255,255,255,0.05);
}

.layout-split .section-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Efeito de escurecer ligeiramente a imagem para não chocar com o ambiente dark */
     
    
}


.layout-split .glass-panel {
    width: 45%;
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: -10%;
    z-index: 10;
    padding: 40px 30px;
    text-align: left;
}

.layout-split.zigzag-right .glass-panel {
    margin-left: 0;
    margin-right: -10%;
}

.layout-split .glass-panel h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: left;
}

.layout-split .glass-panel p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
}

/* Ajustes Responsive para o Layout Split */
@media (max-width: 1024px) {
    .layout-split .section-media {
        width: 55%;
    }
.layout-split .glass-panel {
    width: 45%;
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: -10%;
    z-index: 10;
    padding: 40px 30px;
    text-align: left;
}
.layout-split.zigzag-right .glass-panel {
    margin-left: 0;
    margin-right: -10%;
}
}

@media (max-width: 768px) {
    /* Em mobile empilhamos tudo e centralizamos perfeitamente no ecrã */
    .layout-split,
    .layout-split.zigzag-left,
    .layout-split.zigzag-right {
        flex-direction: column;
        padding: 0 5%; /* Mais controlável que pixels fixos */
        justify-content: center;
        align-items: center;
    }

    .layout-split .section-media {
        width: 100%;
        height: 35vh; /* Um pouco mais alta */
        border-radius: 12px; /* Em mobile, arredondar tudo fica mais "Card" style */
        /* O truque do Feather/Fading edge na base da imagem usando pseudo-elemento (mask) */
        -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
        margin-bottom: -50px; /* Puxa o painel de vidro mais para cima da máscara */
    }

.layout-split .glass-panel {
    width: 45%;
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: -10%;
    z-index: 10;
    padding: 40px 30px;
    text-align: left;
}
    
    .layout-split .glass-panel h1,
    .layout-split .glass-panel p {
        text-align: center;
    }
}


/* Ensure the first service section does not bleed into the hero section */
#corte-laser {
    margin-top: 10vh; /* creates space so it doesn't peak out when at the top */
}

/* On mobile, we might need even more separation since elements stack up tall */
@media (max-width: 768px) {
    #corte-laser {
        margin-top: 10vh;
    }
}


/* --- NOVO DESIGN DA FICHA TÉCNICA (MODAL DE SERVIÇOS B2B) --- */

#modal-title {
    margin-top: 0;
    text-transform: uppercase;
    margin-bottom: 25px;
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--theme-primary, #d4af37); /* Dourado Premium */
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), 0.3);
    padding-bottom: 15px;
}

.section-subtitle {
    margin-top: 10px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: #888;
}

/* Tabela de Especificações Técnicas */
.tech-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    overflow: hidden;
}

.tech-specs-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tech-specs-table tr:last-child {
    border-bottom: none;
}

.tech-specs-table td {
    padding: 12px 15px;
    font-size: 0.95rem;
}

.tech-specs-table .spec-label {
    color: #aaaaaa;
    width: 45%; /* Rótulo ocupa menos de metade */
    font-weight: 500;
}

.tech-specs-table .spec-value {
    color: #ffffff;
    font-weight: 600;
    text-align: right; /* O Valor fica encostado à direita para ficar alinhado */
}

/* Lista de Materiais */
.modal-materials {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-materials li {
    background-color: rgba(var(--theme-primary-rgb), 0.1); /* Dourado muito transparente */
    border: 1px solid rgba(var(--theme-primary-rgb), 0.3); /* Dourado */
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--theme-primary, #d4af37); /* Dourado no texto também */
    transition: background-color 0.3s ease;
}

.modal-materials li:hover {
    background-color: rgba(var(--theme-primary-rgb), 0.2);
}

/* O Media Wrapper agora suporta iframes (Youtube) ou model-viewer futuro */
.modal-media-wrapper {
    display: flex; /* Centra o conteúdo se não preencher tudo */
    justify-content: center;
    align-items: center;
    background-color: var(--theme-bg, #050505);
}

.modal-media-wrapper model-viewer,
.modal-media-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}



/* --- FIX: LIMITES DO MODAL E OVERFLOW INTERNO --- */
.modal-content {
    max-height: 90vh !important; /* Nunca ultrapassa 90% da altura do ecrã */
    display: flex;
    flex-direction: column;
}

.modal-layout-container {
    max-height: 90vh;
    overflow-y: auto; /* Permite scroll interno se o conteúdo for gigante */
    /* Estilização da barra de scroll interna para ficar elegante e B2B */
    scrollbar-width: thin;
    scrollbar-color: var(--theme-primary, #d4af37) #111;
}

.modal-layout-container::-webkit-scrollbar {
    width: 6px;
}
.modal-layout-container::-webkit-scrollbar-track {
    background: var(--theme-bg, #111);
}
.modal-layout-container::-webkit-scrollbar-thumb {
    background-color: var(--theme-primary, #d4af37);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .modal-media-wrapper {
        height: 30vh !important; /* Altura proporcional ao ecrã em vez de fixa */
        max-height: 250px !important;
        flex-shrink: 0; /* Garante que a imagem/3D não é esmagada pelo texto */
    }
    
    .modal-text-section {
        padding: 20px 15px !important; /* Reduz o "ar" inútil */
    }

    #modal-title {
        font-size: 1.4rem !important;
        margin-bottom: 15px !important;
        padding-bottom: 10px !important;
    }

    .tech-specs-table td {
        padding: 8px 10px !important;
        font-size: 0.85rem !important; /* Texto da tabela ligeiramente menor */
    }

    .section-subtitle {
        margin-top: 15px !important;
        margin-bottom: 10px !important;
    }

    .modal-materials li {
        padding: 6px 10px !important;
        font-size: 0.8rem !important; /* Tags mais compactas */
    }
}


#hero-subtitle {
    line-height: 1.5;
}


/* --- HERO LOGO SVG STYLES --- */
#hero-4winners .content h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

#hero-logo-svg {
    filter: drop-shadow(0px 10px 30px rgba(var(--theme-primary-rgb), 0.4));
}

#hero-logo-svg path, 
#hero-logo-svg polygon, 
#hero-logo-svg rect, 
#hero-logo-svg circle {
    /* Mantém as cores originais do CorelDraw que usaste, mas adicionamos reflexo/brilho do CSS */
    transition: filter 0.3s ease;
}

#hero-logo-svg:hover path {
    filter: brightness(1.2);
}


/* --- HERO SUBTITLE ADJUSTMENTS --- */
#hero-subtitle {
    font-size: 1.2rem; /* Was around 2rem or inheriting large sizes, now 40% smaller */
    letter-spacing: 2px;
    /* Distância equivalente a 1.5x a altura da linha (line-height é 1.5, logo 1.5 * 1.5 = 2.25em) */
    margin-top: 2.25em;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7); /* Slightly muted to let the golden logo shine */
}

@media (max-width: 768px) {
    #hero-subtitle {
        font-size: 0.9rem; /* Even smaller on mobile */
        /* Como usamos 'em', a margem encolhe automaticamente com a fonte no telemóvel! */
        margin-top: 2.25em; 
    }
}
/* O logótipo sobe de igual forma em todo o lado para centralizar o grupo (Logo+Texto) verticalmente */
#main-logo-container {
    transform: translateY(-5vh);
}

/* Esconder de vez barras de scroll nativas durante scroll virtual */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

@keyframes spin { 
    100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } 
}

html.modal-open, body.modal-open {
    overflow: hidden;
}

/* --- PORTFOLIO GLOBAL MODAL --- */
#portfolio-modal .portfolio-content {
    max-width: 90vw;
    width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 30px;
    background-color: var(--theme-bg, #050505);
}

#portfolio-title {
    text-align: center;
    font-size: 1rem;
    letter-spacing: 2px;
    color: var(--theme-primary, #d4af37);
    margin-top: 0;
    margin-bottom: 20px;
}

.portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.portfolio-filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.portfolio-filter-btn:hover,
.portfolio-filter-btn.active {
    border-color: var(--theme-primary, #d4af37);
    color: var(--theme-primary, #d4af37);
    background: rgba(var(--theme-primary-rgb), 0.1);
}

.portfolio-grid {
    overflow-y: auto;
    padding-right: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 40px; /* Espaçamento entre diferentes categorias */
}

.portfolio-category-title {
    margin: 0 0 15px 0;
    font-size: 0.8rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.portfolio-item {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--theme-bg, #111);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 10;
}

.portfolio-item img,
.portfolio-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-item .item-type-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    padding: 5px;
    border-radius: 50%;
    font-size: 1.2rem;
    pointer-events: none;
}



/* --- PORTFOLIO LIGHTBOX GLOBAL --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 20000; /* Over everything else */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 20001;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-close:hover {
    color: var(--theme-primary, #d4af37);
    background: rgba(255,255,255,0.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 20001;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-nav:hover {
    color: var(--theme-primary, #d4af37);
    background: rgba(255,255,255,0.1);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Fix mobile nav */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 1.5rem; }
}

/* --- Estilos para o Media Engine (Fase 3) --- */
.modal-media-wrapper {
    position: relative;
    flex: 1;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.media-loader {
    color: var(--theme-primary, #d4af37);
    font-size: 2rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* SMART CONTACT BAR (MOBILE FIRST) */
#smart-contact-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* Barra ultra-fina em mobile no estado inativo */
    background-color: rgba(5, 5, 5, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
    /* Removido o overflow: hidden para permitir que o ícone transborde a barra fina sem ser decepado */
}

#smart-contact-bar.active {
    height: 56px; /* Expande para este tamanho chamativo quando ativa */
    background-color: rgba(5, 5, 5, 0.95);
    border-top: 1px solid rgba(var(--theme-primary-rgb), 0.5);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.contact-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.contact-icon-btn {
    width: 25px; /* Adequado para caber na mini-barra de 30px */
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-primary, #d4af37);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.contact-icon-btn svg {
    width: 18px; /* Mais contido e minimalista em mobile */
    height: 18px;
}

/* Quando ativa (expandida) transforma o Dourado no Verde Típico do WA */
#smart-contact-bar.active .contact-icon-btn,
#smart-contact-bar:hover .contact-icon-btn {
    color: #25D366; 
}

.contact-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    transform: translateX(10px);
    transition: all 0.4s ease;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500; /* Mais visível */
}

#smart-contact-bar.active .contact-label {
    opacity: 1;
    max-width: 250px;
    transform: translateX(0);
}

/* DESKTOP FLOATING ACTION BUTTON (FAB) */
@media (min-width: 769px) {
    #smart-contact-bar {
        left: auto;
        right: 36px;
        bottom: 15%; 
        width: 40px; /* Volta a um formato regular limpo de círculo perfeito (40x40) */
        height: 40px; 
        border-radius: 20px; 
        background: rgba(10, 10, 10, 0.85);
        border: 1px solid rgba(var(--theme-primary-rgb), 0.3);
        border-top: 1px solid rgba(var(--theme-primary-rgb), 0.3);
        justify-content: flex-end; /* ANCORAGEM CRÍTICA: o conteúdo é atirado para a direita da caixa */
        box-shadow: 0 4px 25px rgba(0,0,0,0.6);
        padding-right: 3px; /* Empurra o ícone os exactos 3px para o colocar no centro matemático de 40px! */
    }
    
    #smart-contact-bar.active,
    #smart-contact-bar:hover {
        width: 197px; /* Aumentado ligeiramente para comportar o novo padding sem esmagar o texto */
        height: 40px;
        border-radius: 20px;
        background: rgba(10, 10, 10, 0.95);
        border: 1px solid #25D366; 
        border-top: 1px solid #25D366;
        padding-right: 3px; 
        padding-left: 17px; /* Cria uma "parede" de proteção para a esquerda do texto */
    }
    
    .contact-bar-content {
        flex-direction: row-reverse; /* Ícone direito, texto esquerdo */
        justify-content: flex-start; /* Obedece ao justify-content: flex-end do pai! */
        width: auto;
    }

    .contact-icon-btn {
        width: 33px; /* Escala Jumbo do Ícone apenas no Desktop */
        height: 33px;
    }

    .contact-icon-btn svg {
        width: 33px; 
        height: 33px;
    }

    .contact-label {
        margin: 0 10px 0 0; /* Aplica o espaço que afasta o texto do ícone! */
        text-align: right;
        transform: translateX(10px); 
        font-size: 0.55rem; /* Escala a fonte para 2/3 do original (0.8rem) */
        letter-spacing: 1.5px; /* Reduz o espaçamento das letras para caber perfeitamente */
    }

    #smart-contact-bar.active .contact-label,
    #smart-contact-bar:hover .contact-label {
        opacity: 1;
        max-width: 250px; 
        transform: translateX(0);
    }
}

.contact-modal-info .contact-item a {
    color: var(--theme-primary, #d4af37);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border 0.3s;
}

.contact-modal-info .contact-item a:hover {
    border-bottom: 1px solid var(--theme-primary, #d4af37);
}

/* BOTÕES DE AÇÃO DIRETA NO MODAL DE CONTACTO */
.contact-actions-container {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap; 
}

/* Base idêntica aos botões "details-btn" da secção principal para total coerência */
.contact-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.4); /* Fio de ouro estrutural */
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03); /* Efeito vidro gelado brilhante */
    color: #fff;
    text-decoration: none;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem; 
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.contact-action-btn svg,
.contact-action-btn span.material-symbols-outlined {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--theme-primary, #d4af37); /* Todos os ícones assumem o dourado industrial do tema base */
    transition: all 0.3s ease;
}

/* Hover effects */
.contact-action-btn:hover {
    border-color: rgba(var(--theme-primary-rgb), 0.8);
    background: rgba(var(--theme-primary-rgb), 0.1); 
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* O whatsapp brilha verde nativo apenas durante o hover como "surpresa", mantendo-se elegante */
.wa-modal-btn:hover svg {
    color: #25D366; 
}

.cta-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.whatsapp-btn {
    background: #25D366 !important;
    color: #fff !important;
    border: none !important;
}

.viewer-360-container {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
}

.viewer-360-hint {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    color: var(--theme-primary, #d4af37);
    font-size: 0.8rem;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    opacity: 0.8;
}

.modal-media-wrapper img, .modal-media-wrapper video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- Ajustes Lightbox V2 --- */
.lightbox-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.lightbox-content img, .lightbox-content video, .lightbox-content .viewer-360-container {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-caption {
    padding: 20px;
    color: var(--theme-primary, #d4af37);
    font-family: monospace;
    letter-spacing: 1px;
    text-align: center;
}

/* --- Ajustes Mobile Portefólio (Fase 5) --- */
@media (max-width: 768px) {
    .portfolio-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .lightbox-content img, .lightbox-content video, .lightbox-content .viewer-360-container {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .lightbox-caption {
        font-size: 0.7rem;
        padding: 10px;
    }
}

/* --- Polimento Final Fase 3 --- */
@media (max-width: 480px) {
    #portfolio-title {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    .portfolio-category-title {
        font-size: 0.7rem;
        margin-top: 20px;
    }
}

/* --- Placeholder Técnico para Secções Vazias --- */
.technical-placeholder {
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--theme-bg, #1a1a1a) 0%, var(--theme-bg, #000000) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(var(--theme-primary-rgb), 0.1);
}

.technical-placeholder span {
    color: rgba(255, 255, 255, 0.05);
    font-family: monospace;
    letter-spacing: 20px;
    font-size: 1rem;
    transform: rotate(-45deg);
}

.section-media.media-empty {
    background: #000;
}

/* --- Listas de Serviços V3 --- */
.service-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service-list li {
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.service-list li::before {
    content: '→';
    margin-right: 10px;
    color: var(--theme-primary, #d4af37);
    font-weight: bold;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.service-list li:hover {
    background: rgba(var(--theme-primary-rgb), 0.1);
    border-color: rgba(var(--theme-primary-rgb), 0.3);
    color: #fff;
    transform: translateX(10px);
}

.service-list li:hover::before {
    opacity: 1;
    transform: translateX(5px);
}

@media (max-width: 768px) {
    .service-list li {
        font-size: 0.85rem;
        padding: 12px 15px; 
    }
}

/* --- V3: Correção do Layout Mobile --- */
@media (max-width: 768px) {
    .layout-split .glass-panel,
    .layout-split.zigzag-right .glass-panel {
        width: 90% !important; /* Ocupa quase toda a largura */
        min-height: auto; /* Altura baseada no conteúdo */
        margin: -50px auto 0 auto !important; /* Sobe e centra, anula margens negativas */
        transform: none !important; /* Remove qualquer translação do desktop */
        text-align: center;
    }

    .layout-split .glass-panel h1,
    .layout-split .glass-panel .service-list {
        text-align: center;
    }
}

/* --- V3.1 - Rodapé Minimalista Industrial --- */
#site-footer {
    width: 100%;
    min-height: 10vh; /* Ocupa o espaço morto que tínhamos no fundo */
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Encosta o texto à base do ecrã */
    padding-bottom: 40px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 100%);
    position: relative;
    z-index: 10;
}

.footer-content {
    text-align: center;
    font-family: 'Helvetica Neue', sans-serif;
    color: rgba(255, 255, 255, 0.4);
}

.footer-content p {
    font-size: 0.85rem;
    margin: 5px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-content .disclaimer {
    font-size: 0.65rem;
    color: rgba(var(--theme-primary-rgb), 0.6); /* Um dourado muito suave e apagado */
    letter-spacing: 0.5px;
    max-width: 80%;
    margin: 15px auto 0 auto;
    text-transform: none;
    font-family: monospace; /* Dá um aspeto de "Nota Técnica" */
}

@media (max-width: 768px) {
    #site-footer {
        padding-bottom: 30px;
    }
    .footer-content p {
        font-size: 0.75rem;
    }
    .footer-content .disclaimer {
        font-size: 0.6rem;
    }
}

/* --- V3.1 - Efeito Feather/Fade no Vidro (Mobile) --- */
@media (max-width: 768px) {
    .layout-split .glass-panel {
        /* Remove a borda superior que cria a linha rígida */
        border-top: none;

        /* O fundo agora é um gradiente que começa transparente */
        background: linear-gradient(
            to bottom,
            rgba(10, 10, 10, 0) 0%,
            rgba(10, 10, 10, 0.4) 10%,
            rgba(10, 10, 10, 0.5) 100%
        );

        /* A "magia" do blur em gradiente */
        /* Uma máscara faz com que o próprio blur apareça suavemente em vez de ser um bloco */
        -webkit-mask-image: linear-gradient(to top, black 90%, transparent 100%);
        mask-image: linear-gradient(to top, black 90%, transparent 100%);
    }
}


/* ============================================================
   V3 DEFINITIVE MODAL STRUCTURE
   ============================================================ */
#details-modal .modal-content {
    max-width: 1100px !important;
    width: 95% !important;
    background: var(--theme-bg, #050505) !important;
    border: 1px solid #333 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-layout-container {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    min-height: 550px !important;
    max-height: 85vh !important;
}

.modal-media-section {
    flex: 1 !important;
    background: #000 !important;
    position: relative !important;
    display: flex !important;
    overflow: hidden !important;
}

.modal-media-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.modal-media-wrapper img, 
.modal-media-wrapper video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.modal-text-section {
    flex: 1 !important;
    padding: 50px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    background: var(--theme-bg, #050505) !important;
    overflow-y: auto !important;
}

@media (max-width: 768px) {
    .modal-layout-container {
        flex-direction: column !important;
        max-height: 90vh !important;
        min-height: auto !important;
    }
    .modal-media-section {
        height: 300px !important;
        flex: none !important;
    }
    .modal-text-section {
        padding: 30px 20px !important;
        flex: 1 !important;
    }
}
