/* --- CONFIGURAÇÕES GERAIS E CORES --- */
:root {
    --cor-principal-azul: #2b3952;
    --cor-destaque-dourado: #c7a355;
    --cor-destaque-dourado-hover: #ab8c49;
}

/* --- RESET BÁSICO E CONFIGURAÇÕES GLOBAIS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* NOVO: Adiciona rolagem suave para links de âncora (#) */
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden; /* Mantém o clearfix original */
    padding: 20px 0;
}

/* --- 1. CABEÇALHO E NAVEGAÇÃO --- */
header {
    background: var(--cor-principal-azul);
    color: #ffffff;
    padding-top: 10px;  /* OTIMIZAÇÃO: Reduzido o padding superior */
    padding-bottom: 10px; /* OTIMIZAÇÃO: Reduzido o padding inferior */
    min-height: 70px;
    border-bottom: var(--cor-destaque-dourado) 4px solid;
    position: relative;
    transition: background 0.3s ease;
    z-index: 1000; /* Garante que o header fique no topo */
}

/* NOVO: Estilo do Header Fixo (Sticky) */
header.sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--cor-principal-azul);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: top 0.3s ease-in-out;
}

/* NOVO: Adiciona padding ao <main> para compensar o header fixo.
   Ajuste o '94px' se a altura do seu header mudar.
   (Calculado: 70px min-height + 10px padding-top + 10px padding-bottom + 4px border)
*/
main {
    padding-top: 94px;
}


/* OTIMIZAÇÃO: Container do header agora usa Flexbox */
header .container {
    display: flex;
    justify-content: space-between; /* Alinha logo à esquerda e nav à direita */
    align-items: center; /* Alinha verticalmente no centro */
    padding-top: 0;
    padding-bottom: 0;
}

/* Estilo do Logo (sem 'float' e 'margin-top' negativo) */
header .logo-container {
    margin-top: 0;
    padding: 0; /* Remove o espaçamento que era para o fundo */
    background-color: transparent; /* Define o fundo como transparente */
    border-bottom-right-radius: 0; /* Remove o arredondamento */
    border-bottom-left-radius: 0; /* Remove o arredondamento */
    box-shadow: none; /* Remove a sombra que era do fundo */
    transition: all 0.3s ease;
}

header .logo-container img {
    height: 60px;
    width: auto;
    display: block; /* Garante que não haja espaço extra abaixo da img */
}

/* Botão Hambúrguer (sem mudanças, mas movido para junto da nav) */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    position: absolute;
    top: 25px;
    right: 5%;
    z-index: 1001;
    transition: color 0.3s ease;
}
.hamburger-menu:hover {
    color: var(--cor-destaque-dourado);
}

/* Navegação Principal (sem 'float' e 'margin-top') */
header .main-nav {
    margin-top: 0; /* OTIMIZAÇÃO: Removido */
    /* 'float: right' removido */
}

header .main-nav ul {
    list-style: none;
}

header .main-nav li {
    display: inline;
    padding: 0 20px;
}

header .main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

header .main-nav a:hover {
    color: var(--cor-destaque-dourado);
    font-weight: bold;
}

/* --- BOTÃO (CALL TO ACTION) --- */
.cta-button {
    display: inline-block;
    background: var(--cor-destaque-dourado);
    color: #ffffff;
    padding: 12px 25px;
    font-size: 18px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 25px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background: var(--cor-destaque-dourado-hover);
    transform: translateY(-2px);
}

/* --- SECÇÕES DE CONTEÚDO --- */
section {
    padding: 40px 0;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    
    /* PREPARAÇÃO PARA ANIMAÇÃO (Perfeito!) */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Classe para mostrar a secção quando estiver visível */
section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* OTIMIZAÇÃO: Mudamos de h3 para h2 no HTML, vamos refletir no CSS */
section h2 { /* ANTES: section h3 */
    font-size: 32px;
    text-align: center;
    margin-bottom: 25px;
    color: var(--cor-principal-azul);
}

/* --- SECÇÃO HERO (Banner Inicial) --- */
#hero {
    /* 1. SUBSTITUA 'fundo-hero.jpg' pelo nome da sua imagem */
    background-image: 
        /* Esta linha cria a camada escura (overlay) */
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        /* Esta linha é a sua imagem */
        url('images/fundo-hero.png');
    
    background-size: cover;     /* Faz a imagem cobrir toda a área */
    background-position: center;  /* Centraliza a imagem */
    background-repeat: no-repeat; /* Evita que a imagem se repita */

    text-align: center;
    padding: 60px 0;
    
    /* 2. MUDA A COR DO TEXTO (para ser legível sobre a imagem) */
    color: #ffffff; /* Define a cor de texto padrão (para o 'p') como branca */
}

#hero h1 {
    font-size: 36px;
    color: #ffffff; /* 3. MUDA A COR DO H1 para branco */
    margin-bottom: 15px;
}

#hero p {
    font-size: 18px;
    margin-bottom: 20px;
    /* Esta cor será branca por causa do 'color: #ffffff' definido no #hero acima */
}


/* --- LISTA DE SERVIÇOS --- */
#servicos ul {
    list-style: none;
    max-width: 600px;
    margin: 0 auto;
}

#servicos li {
    font-size: 18px;
    padding: 10px;
    border-bottom: 1px dashed #ccc;
}

#servicos li:before {
    content: '✓';
    color: var(--cor-destaque-dourado);
    font-weight: bold;
    margin-right: 10px;
}

/* --- SECÇÃO GALERIA --- */
#galeria {
    background: #f4f4f4;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.gallery-item {
    width: 350px;
    background: #ffffff;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    text-align: center;
    
    /* PREPARAÇÃO PARA ANIMAÇÃO (Perfeito!) */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    transition-delay: var(--item-delay); /* O JS vai definir este delay */
}

/* Classe para mostrar o item da galeria quando visível */
.gallery-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* (O .gallery-caption não estava no seu HTML, mas se usar, está aqui) */
.gallery-caption {
    font-size: 16px;
    font-weight: bold;
    padding: 15px;
    color: var(--cor-principal-azul);
}

/* --- SECÇÃO CTA INSTAGRAM --- */
#instagram-cta {
    background-color: var(--cor-principal-azul); /* Fundo azul escuro */
    color: #ffffff; /* Texto branco */
    padding: 60px 0;
    text-align: center;
}

#instagram-cta h2 {
    color: #ffffff; /* Título branco */
    font-size: 36px;
    margin-bottom: 20px;
}

#instagram-cta p {
    font-size: 1.1em;
    margin-bottom: 40px;
    max-width: 700px; /* Limita a largura do parágrafo */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Estilos para o Mock-up do Instagram */
.instagram-mockup {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px; /* Largura máxima para o mock-up */
    margin: 0 auto 50px auto; /* Centraliza e adiciona margem inferior */
    overflow: hidden; /* Garante que as imagens não saiam */
}

.instagram-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
}

.instagram-profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Torna a imagem de perfil redonda */
    margin-right: 10px;
    border: 1px solid #ddd;
}

.instagram-follow-button {
    background-color: #0095f6; /* Cor azul do botão de seguir do Instagram */
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    margin-left: auto; /* Empurra o botão para a direita */
    transition: background-color 0.3s ease;
}

.instagram-follow-button:hover {
    background-color: #007acb;
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* 3 colunas responsivas */
    gap: 5px; /* Espaçamento entre as imagens */
    padding: 5px; /* Espaçamento interno */
}

.instagram-grid img {
    width: 100%;
    height: 100px; /* Altura fixa para as imagens da grade */
    object-fit: cover; /* Recorta a imagem para preencher o espaço */
    display: block;
    border-radius: 3px;
}

/* Botão "Ver Mais no Instagram" no final */
.cta-button.instagram-button-final {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 1.3em;
    padding: 15px 30px;
    margin-top: 30px;
}

.cta-button.instagram-button-final:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.cta-button.instagram-button-final i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Media Queries para Mobile */
@media screen and (max-width: 768px) {
    #instagram-cta h2 {
        font-size: 28px;
    }
    #instagram-cta p {
        font-size: 1em;
        margin-left: 5%;
        margin-right: 5%;
    }
    .instagram-mockup {
        max-width: 90%; /* Mais largo no mobile */
        margin-left: auto;
        margin-right: auto;
    }
    .instagram-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* Imagens menores no mobile */
        gap: 3px;
    }
    .instagram-grid img {
        height: 80px;
    }
}

/* --- LOCALIZAÇÃO E CONTATO --- */
#localizacao, #contato {
    text-align: center;
}

/* --- MAPA --- */
.mapa-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin-top: 20px;
    border: 5px solid var(--cor-principal-azul);
    border-radius: 5px;
}

.mapa-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- BOTÃO WHATSAPP --- */
.whatsapp-button {
    background: #25D366;
    transition: background 0.3s ease, transform 0.2s ease;
}

.whatsapp-button:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

/* --- Estilos para Informações de Contato (Telefone/Email) --- */
.contact-info {
    font-size: 1.2em; /* Ligeiramente maior */
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-principal-azul); /* Usa o azul principal para o texto base */
    font-weight: bold; /* Deixa o texto base em negrito */
}

.contact-info i {
    color: var(--cor-destaque-dourado);
    margin-right: 10px; /* Mais espaço entre ícone e texto */
    font-size: 1.5em; /* Ícone um pouco maior */
}

.contact-info a {
    color: var(--cor-principal-azul); /* A cor do link será o azul principal */
    text-decoration: none; /* Remove o sublinhado */
    font-weight: bold; /* Garante que o link também esteja em negrito */
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--cor-destaque-dourado); /* Muda para dourado ao passar o mouse */
}

/* --- RODAPÉ --- */
footer {
    padding: 30px;
    background: var(--cor-principal-azul);
    color: #ffffff;
    text-align: center;
    margin-top: -1px; /* Evita bordas duplicadas */
}

.social-link {
    color: var(--cor-destaque-dourado);
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    display: block;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: #ffffff;
}

footer .copyright {
    font-size: 14px;
    color: #ccc;
    margin: 0;
}

/* --- NOVO: BOTÃO "VOLTAR AO TOPO" --- */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--cor-destaque-dourado);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-align: center;
    line-height: 40px; /* Alinha o ícone verticalmente */
    font-size: 18px;
    z-index: 999;
    text-decoration: none;
    
    /* Começa escondido e com animação */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
}

/* Classe que o JS vai adicionar */
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--cor-destaque-dourado-hover);
}


/* --- MEDIA QUERIES PARA DISPOSITIVOS MÓVEIS --- */
@media screen and (max-width: 768px) {
    
    .container {
        width: 90%;
        padding: 15px 0;
    }

    /* Otimização: O padding-top de 'main' deve ser menor no mobile */
    main {
        padding-top: 79px; /* Altura do header mobile */
    }
    
    header .container {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 5%;
        width: 100%; /* Garante que o flex ocupe tudo */
    }

    header .logo-container {
        margin-top: 0;
        padding: 0;
        background-color: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    header .logo-container img {
        height: 50px;
    }

    .hamburger-menu {
        display: block;
        position: static; /* Remove o 'absolute' da versão desktop */
    }

    /* Navegação Mobile (Menu Aberto) */
    header .main-nav {
        display: none;
        position: absolute;
        top: 100%; /* Gruda abaixo do header */
        left: 0;
        width: 100%;
        background: var(--cor-principal-azul);
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 1000;
        padding-bottom: 10px;
        float: none;
        margin-top: 0;
    }

    header .main-nav.nav-open {
        display: block;
    }

    header .main-nav ul {
        list-style: none;
        width: 100%;
        text-align: center;
        padding: 0;
    }

    header .main-nav li {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #4a5c7a;
    }
    
    header .main-nav li:last-child {
        border-bottom: none;
    }

    header .main-nav a {
        font-size: 19px;
        display: block;
        color: #ffffff;
    }

    header .main-nav a:hover {
        background: var(--cor-destaque-dourado);
        color: #ffffff;
    }

    /* Ajustes de Fonte e Layout Mobile */
    #hero {
        padding-top: 40px; /* Reduzido o padding */
        min-height: auto;
    }
    
    /* (Ajuste para h1 no mobile) */
    #hero h1 { 
        font-size: 28px;
    }
    
    #hero p {
        font-size: 16px;
    }

    /* (Ajuste para h2 no mobile) */
    section h2 { 
        font-size: 24px;
    }

    .gallery-grid {
        gap: 15px;
    }
    
    .gallery-item {
        width: 100%; /* Itens da galeria ocupam 100% */
    }

    #servicos ul {
        width: 100%;
        padding: 0 5%;
    }
    
    #servicos li {
        font-size: 16px;
    }

    footer {
        padding: 20px;
    }

    .social-link {
        font-size: 16px;
    }
}