/* ========================================================================= */
/* 0. CONFIGURAÇÕES GLOBAIS E VARIÁVEIS                                      */
/* ========================================================================= */

/* Variáveis de Cores */
:root {
    --primary-brown: #4A3C30;        /* Marrom principal (cor de destaque) */
    --secondary-brown: #7A6F62;      /* Marrom mais claro */
    --light-beige: #F5F5DC;          /* Bege claro */
    --off-white: #F8F8F8;            /* Branco suave para backgrounds */
    --light-gray: #E0E0E0;           /* Cinza claro para bordas/separadores */
    --dark-text: #333333;            /* Texto principal */
    --light-text: #666666;           /* Texto secundário */
    --accent-gold: #B8860B;          /* Dourado suave para destaque */
    --button-hover: #5D4F42;         /* Marrom mais escuro para hover */

    /* Cores que estavam fixas e devem virar variáveis para consistência */
    --color-h-text: rgb(65, 72, 51);
    --color-btn-primary: rgb(218, 212, 197);
    --color-btn-submit: #414833;
    --color-footer-bg: #111e13;
    --color-whatsapp: #25D366;
    --color-whatsapp-hover: #1DA851;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
    overflow-x: hidden; /* CORREÇÃO: Evita scroll horizontal */
}
*, *:before, *:after {
    box-sizing: inherit;
    max-width: 100%; /* CORREÇÃO: Evita que elementos filhos causem o corte */
}

/* Base */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--off-white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Garante que o container é 100% por padrão */
    box-sizing: border-box;
}

/* Links */
a {
    color: var(--primary-brown);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--accent-gold);
}

/* Estilo para o Ampersand Normal (se for usado) */
.ampersand-normal {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}
.hero-content h1 .ampersand-normal {
    font-weight: 700;
}

/* ========================================================================= */
/* 1. TIPOGRAFIA (H1, H2, H3, P)                                             */
/* ========================================================================= */

h1, h2, h3 {
    font-family: 'Joan', serif;
    color: var(--color-h-text);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.8rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--color-btn-submit);
    margin: 10px auto 0;
    border-radius: 2px;
}

h3 {
    font-size: 1.6rem;
}

p {
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* ========================================================================= */
/* 2. BOTÕES (Buttons)                                                       */
/* ========================================================================= */

.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

/* BOTÃO PRIMÁRIO */
.btn-primary {
    background-color: var(--color-btn-primary);
    color: var(--color-h-text);
}
.btn-primary:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

/* BOTÃO WHATSAPP */
.btn-whatsapp {
    background-color: var(--color-whatsapp);
    color: white;
}
.btn-whatsapp:hover {
    background-color: var(--color-whatsapp-hover);
    transform: translateY(-2px);
}

/* BOTÃO SUBMIT (Formulário) */
.btn-submit {
    background-color: var(--color-btn-submit);
    color: white;
    width: 100%;
    padding: 15px 25px;
    margin-top: 15px;
}
.btn-submit:hover {
    background-color: var(--accent-gold);
    transform: translateY(-2px);
}

/* ========================================================================= */
/* 3. HEADER & NAVEGAÇÃO                                                     */
/* ========================================================================= */

.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    z-index: 100;
    background-color: rgb(184, 178, 171);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.navbar .logo {
    max-height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}
.navbar .logo:hover {
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: rgb(17, 29, 19);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

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

/* Menu Hamburguer */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 101;
}

.hamburger-menu .bar {
    display: block;
    width: 28px;
    height: 3px;
    background-color: white; 
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
}

.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Seção Hero (Header Principal) */
.hero-section {
    background-image: url('./src/img/Logo_V1.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: white;
    padding: 400px 20px;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 100px;
    padding-bottom: 30px;
    width: 100%;
}

.hero-content h1,
.hero-content p {
    color: rgb(218, 212, 197);
}

/* ========================================================================= */
/* 4. SEÇÕES GERAIS E LAYOUT                                                 */
/* ========================================================================= */

section {
    padding: 80px 0;
    background-color: var(--off-white);
}

section:nth-of-type(even) {
    background-color: var(--color-btn-primary); 
}


/* Serviços (Services Section) */
.services-section {
    padding: 80px 20px;
    text-align: center;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-item {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    
    /* CORREÇÃO PARA ALTURA UNIFORME */
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%; /* Garante que o item ocupe 100% da altura da célula do grid */
    justify-content: flex-start; /* Alinha o conteúdo ao topo */
    
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.service-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.service-item i {
    font-size: 3.5rem;
    color: var(--color-h-text);
    margin-bottom: 20px;
}


/* Por Que Nos Escolher (Why Us Section) */
.why-us-section {
    background-color: var(--off-white);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.why-us-item {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.why-us-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.why-us-item i {
    font-size: 2.5rem;
    color: var(--color-h-text);
    margin-bottom: 15px;
}


/* Testemunhos (Testimonials Section) */
.testimonials-section {
    background-color: white;
}

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

.testimonial-item {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.testimonial-item p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.testimonial-item span {
    font-weight: 600;
    font-style: normal;
    color: var(--primary-brown);
}

/* ========================================================================= */
/* 5. SEÇÃO DE CONTATO E WHATSAPP                                            */
/* ========================================================================= */

.contact-section .contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
}

/* Formulário */
.contact-form {
    flex: 2;
    min-width: 300px;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
    width: 100%; 
    padding: 12px 10px;
    margin-bottom: 15px;
    border: 1px solid var(--light-gray);
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box; 
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}

/* Informações de Contato */
.contact-info {
    flex: 1;
    min-width: 280px;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.contact-info h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.contact-info p i {
    color: var(--color-btn-submit);
    margin-right: 10px;
    font-size: 1.2rem;
    width: 20px;
}

.contact-info a {
    color: var(--dark-text);
}
.contact-info a:hover {
    color: var(--accent-gold);
}

.map-placeholder {
    margin-top: 25px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--light-gray);
    height: auto;
}

.map-placeholder iframe {
    border: 0;
    width: 100%;
    height: 250px;
    display: block;
}

/* Seção de Contato WhatsApp (Nova Seção) */
.contact-wpp {
    padding: 60px 20px;
    text-align: center;
    background-color: #f7f7f7;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 30px;
}

/* ========================================================================= */
/* 6. TEAM SECTION (Carrossel)                                               */
/* ========================================================================= */

.team-section {
    padding: 80px 0;
    background-color: var(--off-white);
}

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 40px;
    text-align: center;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-slide img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-btn-submit);
    margin-top: 40px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carousel-slide h3 {
    color: var(--color-btn-submit);
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.carousel-slide p {
    color: var(--color-btn-submit);
    margin-bottom: 10px;
    max-width: 500px;
    line-height: 1.6;
    font-size: 1.05rem;
}

.carousel-slide .fab {
    font-size: 1.3rem;
    margin-right: 8px;
}

.carousel-slide a {
    color: var(--color-btn-submit);
    font-weight: 600;
}
.carousel-slide a:hover {
    color: var(--accent-gold);
}


/* Botões do Carrossel */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(65, 72, 51, 0.7);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    z-index: 5;
}

.carousel-button:hover {
    background-color: var(--color-h-text);
}

.carousel-button.prev {
    left: 10px;
}

.carousel-button.next {
    right: 10px;
}

/* Dots do Carrossel */
.carousel-dots {
    text-align: center;
    padding: 10px 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.5);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 5px;
    background-color: var(--color-h-text);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.dot.active {
    background-color: rgb(17, 29, 19);
    transform: scale(1.2);
}

/* ========================================================================= */
/* 7. FOOTER & UTILITÁRIOS                                                   */
/* ========================================================================= */

footer {
    background-color: var(--color-footer-bg);
    color: var(--color-btn-primary); 
    text-align: center;
    padding: 30px 20px;
    font-size: 0.95rem;
    height: auto;
}

footer .social-links a {
    color: var(--color-btn-primary);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer .social-links a:hover {
    color: var(--accent-gold);
}

footer p {
    margin-bottom: 5px;
    font-size: 0.95rem;
    line-height: 1.4;
}

footer p:last-child {
    margin-top: 10px;
    margin-bottom: 0;
}

footer a {
    color: var(--light-beige);
}
footer a:hover {
    color: var(--accent-gold);
}

/* Pop-up de Cookies */
.cookie-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--primary-brown);
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.cookie-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cookie-popup a {
    color: white;
    text-decoration: underline;
}

.cookie-popup button {
    background-color: var(--accent-gold);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    margin-left: 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.cookie-popup button:hover {
    background-color: #A37500;
}

/* Mensagens de Formulário */
.form-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    border: 1px solid transparent; 
}
.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}
.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Botão "Voltar ao Topo" */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgb(17, 29, 19);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================================================= */
/* 8. RESPONSIVIDADE (Media Queries) - FINALIZADA                            */
/* ========================================================================= */

/* Desktop / Laptops Maiores (Ajuste de 4 para 3 colunas) */
@media (max-width: 1200px) {
    .service-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 900px;
        margin: 0 auto;
    }
}

/* Tablets (992px e abaixo): 2 colunas */
@media (max-width: 992px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Mobile (768px e abaixo): Ponto de corte principal (Aplica a maioria dos celulares) */
@media (max-width: 768px) {
    /* Container: Força a largura 100% e evita o corte lateral */
    .container {
        max-width: 100% !important; /* Solução de emergência para cache/sobrescrita */
        width: 100% !important;
        padding: 0 10px;
        box-sizing: border-box; 
    }
    
    /* Base */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    section { padding: 60px 0; }
    .hero-section { padding: 60px 0; }

    /* Navbar Mobile (Hamburger) */
    .navbar {
        padding: 15px 20px;
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .hamburger-menu { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: rgba(184, 178, 171, 0.95);
        position: absolute;
        top: 80px;
        left: 0;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
        border-top: 1px solid rgba(255,255,255,0.2);
    }
    .nav-links.active { display: flex; }
    .nav-links li {
        margin: 0;
        text-align: center;
        width: 100%;
    }
    .nav-links a {
        padding: 15px 0;
        display: block;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links a::after { display: none; }
    .nav-links a:hover { background-color: rgba(184, 134, 11, 0.2); }
    .hero-content { padding-top: 120px; }

    /* Botões CTA (WhatsApp/E-mail) */
    .cta-buttons { flex-direction: column; }
    .cta-buttons > * { 
        width: 80%;
        margin: 0 auto;
    }
    
    /* SERVIÇOS: 2 COLUNAS */
    .service-grid {
        grid-template-columns: repeat(2,minmax(0, 1fr));
        gap: 10px;
        max-width: 450px; /* Largura para centralizar bem no 390px */
        margin: 0 auto; 
        padding: 0;
    }
    .service-item {
        padding: 20px 10px; 
    }

    /* Why Us e Testemunhos: 1 coluna */
    .why-us-grid, .testimonial-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    /* Carrossel */
    .carousel-slide { padding: 30px 20px; }
}

@media (max-width: 400px) {
    /* Serviços: Herdamos as 2 colunas do 768px */
    .service-grid {
        max-width: 380px; /* Usa a maior largura possível */
        margin: 0 auto;
        /* Se a CENTRALIZAÇÃO no 390px ainda estiver ruim, adicione: */
        margin-left: -10px; /* Use o contorno SÓ aqui para o 390px */
    }
    
    /* CHAVE: Reduz o tamanho da fonte para que caiba no espaço de 165px */
    .service-item p {
        font-size: 0.9rem; /* Reduz de 1.1rem para 0.9rem */
    }
    
    /* Reduza o padding interno se precisar de mais 10px de espaço */
    .service-item {
        padding: 20px 5px; /* Reduz o padding horizontal de 10px para 5px */
    }
}

/* Mobile Menor (320px e abaixo): Força 1 coluna para legibilidade máxima em telas muito estreitas */
@media (max-width: 320px) { 
    
    /* SERVIÇOS: Volta para 1 COLUNA */
    .service-grid {
        grid-template-columns: 1fr; 
        gap: 15px;
        max-width: 280px;
        margin: 0 auto;
        padding: 0;
        margin-left: 0; /* Remove a correção de contorno para 1 coluna */
    }
    .service-item {
        padding: 25px 15px; 
    }

    /* Base */
    h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }

    /* Botões */
    .btn { width: 90%; }
    
    /* Navbar */
    .navbar { padding: 10px 15px; }
    .nav-links { top: 70px; }
    
    /* Carrossel */
    .carousel-slide {
        padding: 50px 20px;
        min-height: 480px;
    }
    .carousel-slide p {
        flex-grow: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        margin-bottom: 20px;
    }
    .carousel-slide a {
        margin-top: auto;
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* Desktop (min-width: 768px): Regras para reverter estilos mobile */
@media (min-width: 768px) {
    /* Regras de centralização para o CTA-Buttons em Desktop (ROW) */
    .cta-buttons {
        flex-direction: row;
        gap: 15px;
        justify-content: center;
        align-items: center;
    }
    .cta-buttons > * {
        width: auto;
        margin: 0;
    }
}