/* ============================================================================
   RESET E ESTILOS GLOBAIS
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================================
   HEADER / NAVEGAÇÃO
   ============================================================================ */

.header {
    background: #1a1a1a; /* Restaurado para preto sólido como solicitado */
    color: #fff;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
}

.nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c9a46a;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #c9a46a;
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================================================
   LANGUAGE SELECTOR
   ============================================================================ */

.language-selector {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    border-color: #c9a46a;
    color: #c9a46a;
}

.lang-btn.active {
    background-color: #c9a46a;
    color: #000;
    border-color: #c9a46a;
}

/* ============================================================================
   HERO SECTION — Parallax universal (desktop + mobile)
   ============================================================================ */

/* Imagem de fundo fixa — funciona em todos os dispositivos */
.hero-bg {
    position: fixed;
    top: 0; /* Começa no topo absoluto para preencher atrás do cabeçalho */
    left: 0;
    width: 100%;
    height: 100%;
    background: url('img/hero_absolute_final.jpg?v=final_perfection');
    background-size: cover;
    background-position: center top; /* Focar no topo para garantir que o céu preenche a área do cabeçalho */
    z-index: -1;
}

.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
}

.hero {
    background: transparent;
    color: white;
    padding: 80px 20px 40px;
    text-align: center;
    margin-top: 70px;
    min-height: 800px; /* Espaço suficiente para o texto, a casa e o botão abaixo */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Garante que o botão vá para o fundo */
    position: relative;
    z-index: 1;
}

.hero-text {
    max-width: 800px;
    margin-top: 20px;
}

.hero-cta {
    margin-top: auto; /* Empurra o botão para baixo */
    padding-top: 450px; /* Espaço para a casa ficar visível no meio */
    padding-bottom: 20px;
    text-align: center;
    width: 100%;
}



.hero-btn {
    /* herda estilos de .btn */
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 0;
    margin-top: -0.5rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.btn {
    display: inline-block;
    background: #c9a46a;
    color: #000;
    padding: 14px 35px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid #c9a46a;
}

.btn:hover {
    background: transparent;
    color: #c9a46a;
}

/* ============================================================================
   SECTIONS
   ============================================================================ */

.section {
    padding: 80px 20px;
    max-width: 100%;
    background: #ffffff;
    position: relative;
    z-index: 2;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.gray {
    background: #f4f4f4;
    position: relative;
    z-index: 2;
}

/* ============================================================================
   ABOUT SECTION
   ============================================================================ */

.sobre-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.sobre-text {
    flex: 1;
}

.sobre-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    font-weight: 700;
}

.sobre-text p {
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.materials-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.materials-list li {
    font-size: 1.05rem;
    color: #555;
    padding: 0.8rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.materials-list li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: #c9a46a;
    font-weight: bold;
    font-size: 1.1rem;
}

.sobre-image {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.sobre-image img {
    width: 100%;
    height: 1055px; /* Altura fixa exata para igualar à original */
    object-fit: cover; /* Preenche o espaço sem distorcer e sem cortar o ficheiro */
    display: block;
}

/* ============================================================================
   PROJECTS GRID
   ============================================================================ */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card:hover img {
    transform: scale(1.05);
}

.card h3 {
    font-size: 1.3rem;
    padding: 1.5rem 1.5rem 0.5rem;
    color: #1a1a1a;
    font-weight: 700;
}

.card p {
    padding: 0 1.5rem 1.5rem;
    color: #666;
    font-size: 0.95rem;
}

/* ============================================================================
   SERVICES SECTION
   ============================================================================ */

.servicos {
    list-style: none;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.servicos li {
    margin: 1.5rem 0;
    padding-left: 2rem;
    position: relative;
    color: #555;
    font-weight: 500;
}

.servicos li::before {
    content: '✔';
    position: absolute;
    left: 0;
    color: #c9a46a;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ============================================================================
   PORTUGAL PROJECT SECTION
   ============================================================================ */

.portugal-content {
    max-width: 1200px; /* Aumentar para acomodar a nova galeria */
    margin: 0 auto;
    text-align: center;
}

.portugal-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.coming-soon {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #c9a46a !important;
    margin-top: 2rem !important;
}

/* ============================================================================
   CONTACT SECTION
   ============================================================================ */

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.contact-text {
    font-size: 1.05rem;
    color: #555;
    line-height: 1.8;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #c9a46a;
    box-shadow: 0 0 0 3px rgba(201, 164, 106, 0.1);
}

.btn-submit {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 14px;
    font-weight: 700;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-submit:hover {
    background: #c9a46a;
    color: #000;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    background: #1a1a1a;
    color: white;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    z-index: 2;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c9a46a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8934f;
}

/* ============================================================================
   SELECTION
   ============================================================================ */

::selection {
    background-color: #c9a46a;
    color: #000;
}

::-moz-selection {
    background-color: #c9a46a;
    color: #000;
}

/* ============================================================================
   HAMBURGER BUTTON (hidden on desktop)
   ============================================================================ */

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: #fff;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* Bandeiras escondidas no desktop, texto visível */
.lang-flag {
    display: none;
}

.lang-text {
    display: inline;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    /* Fundo escuro no body mobile para eliminar qualquer gap visível */
    body {
        background-color: #1a1a1a;
    }

    /* Todas as secções precisam de fundo explícito */
    .section, .gray, footer {
        background-color: inherit;
    }

    .section {
        background-color: #ffffff;
    }

    .gray {
        background-color: #f4f4f4;
    }

    /* Header mobile - Tornar transparente para eliminar qualquer gap cinza */
    .header {
        padding: 12px 20px;
        background: transparent !important;
        box-shadow: none !important;
    }

    .header-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    /* Mostrar hamburger */
    .hamburger {
        display: block;
    }

    /* Nav escondido por defeito no mobile */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #1a1a1a;
        flex-direction: column;
        align-items: center;
        padding: 1.5rem 0;
        gap: 1.2rem;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .nav.open {
        display: flex;
    }

    .nav-link {
        font-size: 1rem;
        padding: 0.5rem 0;
    }

    /* Bandeiras no mobile, esconder texto */
    .lang-flag {
        display: inline;
        font-size: 1.6rem;
    }

    .lang-text {
        display: none;
    }

    .language-selector {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        gap: 1rem;
    }

    .lang-btn {
        background: none;
        border: 2px solid transparent;
        padding: 0.3rem 0.5rem;
        border-radius: 5px;
        font-size: 1.6rem;
        line-height: 1;
    }

    .lang-btn.active {
        background: none;
        border-color: #c9a46a;
    }

    /* Hero mobile - imagem diretamente no hero, sem position:fixed */
    .hero-bg {
        display: none !important;
    }

    .hero {
        margin-top: 70px;
        padding: 30px 20px 40px;
        min-height: 650px;
        background-color: #1a1a1a;
        background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)),
                    url('img/hero_absolute_final.jpg?v=final_perfection');
        background-size: cover;
        background-position: center top;
        background-repeat: no-repeat;
        background-attachment: scroll;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    .hero-text {
        padding-top: 10px;
    }

    .hero-cta {
        margin-top: auto;
        padding-top: 300px; /* Espaço para a casa no mobile */
        padding-bottom: 20px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section {
        padding: 60px 20px;
    }

    .section h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    .sobre-container {
        flex-direction: column;
        gap: 2rem;
    }

    .sobre-image img {
        height: 450px; /* Altura ajustada para mobile */
        object-fit: cover; /* Força a imagem a preencher todo o quadrado sem bordas ou desfoque */
        object-position: center; /* Mantém o centro da foto (cama/teto) focado */
        width: 100%;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .servicos {
        font-size: 1rem;
    }

    .servicos li {
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.3rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .section {
        padding: 40px 15px;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    .card p {
        font-size: 0.85rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}
