/* =================================================================
   H2SJ ENGENHARIA - STYLE.CSS (COMPLETO & RESPONSIVO)
   ================================================================= */

/* --- VARIÁVEIS GLOBAIS --- */
:root {
    --cor-primaria: #D91A21;       /* Vermelho Engenharia */
    --cor-secundaria: #020617;     /* Slate 950 - Fundo Profundo */
    --cor-terciaria: #1e293b;      /* Slate 800 */
    --cor-texto: #334155;          /* Slate 700 */
    --cor-claro: #f8fafc;
    --fonte-titulo: 'Montserrat', sans-serif;
    --fonte-corpo: 'Roboto', sans-serif;
    --nav-height: 90px;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    scroll-behavior: smooth; 
    overflow-x: hidden; 
}

body {
    font-family: var(--fonte-corpo);
    background-color: #ffffff;
    color: var(--cor-texto);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- TIPOGRAFIA --- */
h1, h2, h3 {
    font-family: var(--fonte-titulo);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

h1 { 
    color: var(--cor-claro); 
    font-size: 3.5rem; 
    line-height: 1.1; 
    margin-bottom: 1.5rem; 
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8); 
}

h2 { 
    font-size: 2.5rem; 
    color: var(--cor-secundaria); 
    margin-bottom: 1.5rem; 
    position: relative; 
    display: inline-block; 
}

h2::after {
    content: ''; 
    display: block; 
    width: 80px; 
    height: 6px;
    background-color: var(--cor-primaria); 
    margin-top: 15px;
}

h3 { font-size: 1.3rem; margin-bottom: 15px; }
p { margin-bottom: 1.2rem; font-size: 1.1rem; color: #475569; }

/* Exceções de cor para fundos escuros */
section.dark-bg h2, 
.port-hero h2, 
.performance-section h2 { 
    color: var(--cor-claro); 
}

/* --- UTILITÁRIOS --- */
.container { max-width: 1300px; margin: 0 auto; padding: 0 25px; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none !important; }
section { padding: 80px 0; position: relative; }

/* --- HEADER & NAV --- */
header#navbar {
    position: fixed; 
    top: 0; left: 0; width: 100%;
    height: var(--nav-height);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0 5%;
    z-index: 1000;
    transition: all 0.4s ease;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0) 100%);
}

header#navbar.scrolled {
    background-color: var(--cor-secundaria);
    height: 70px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.logo-header img { 
    height: 45px; 
    filter: brightness(0) invert(1); 
    transition: 0.3s;
}

/* Menu Desktop */
nav#mainNav ul {
    list-style: none; 
    display: flex; 
    gap: 30px;
}

nav#mainNav ul li a {
    color: white; 
    font-weight: 700; 
    text-decoration: none;
    font-size: 0.85rem; 
    letter-spacing: 1.5px; 
    text-transform: uppercase;
    transition: color 0.3s;
}

nav#mainNav ul li a:hover { color: var(--cor-primaria); }

/* Hamburger (Oculto no Desktop) */
.hamburger { 
    display: none; 
    color: white; 
    font-size: 1.8rem; 
    cursor: pointer; 
}

/* --- HERO SECTION --- */
.hero {
    position: relative; 
    height: 100vh; 
    min-height: 600px;
    width: 100%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    overflow: hidden; 
    background: #020617;
}

.hero video {
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%;
    object-fit: cover; 
    z-index: 0;
    filter: brightness(0.4) contrast(1.1);
}

.hero-content { 
    z-index: 2; 
    position: relative; 
    color: white; 
    max-width: 1100px; 
    padding: 0 20px; 
}

.hero-logo-large { max-width: 300px; margin-bottom: 2rem; }

.cta-button {
    display: inline-block; 
    padding: 18px 45px;
    background-color: var(--cor-primaria); 
    color: white;
    font-weight: 800; 
    text-decoration: none; 
    text-transform: uppercase;
    margin-top: 2rem; 
    border: 2px solid var(--cor-primaria);
    transition: all 0.3s; 
    cursor: pointer;
    border-radius: 4px;
}

.cta-button:hover { 
    background: transparent; 
    transform: scale(1.05); 
}

/* --- AUTHORITY (PORTOS) --- */
.port-hero { background-color: #111; color: white; }

.port-content {
    display: grid; 
    grid-template-columns: 1.5fr 0.5fr;
    gap: 60px; 
    align-items: center;
}

.port-text h3 { 
    color: var(--cor-primaria); 
    margin-bottom: 20px; 
    font-weight: 700; 
    letter-spacing: 2px; 
}

.port-tag {
    display: inline-block; 
    background: rgba(255,255,255,0.1);
    padding: 5px 15px; 
    border-radius: 20px; 
    font-size: 0.8rem;
    margin: 10px 10px 0 0; 
    border: 1px solid rgba(255,255,255,0.2);
}

.port-stat {
    text-align: center; 
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 40px; 
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(10px);
    border-radius: 8px;
}

.port-stat i { font-size: 4rem; color: var(--cor-primaria); margin-bottom: 20px; }
.port-stat .number { font-size: 3.5rem; font-weight: 900; display: block; line-height: 1; }
.port-stat .label { 
    color: #94a3b8; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    display: block; 
    margin-top: 10px; 
}

/* --- SOLUÇÕES (GRID RESPONSIVO) --- */
.services-section { background-color: #f1f5f9; }

.services-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px; 
    margin-top: 50px;
}

.service-card {
    background: white; 
    padding: 40px 30px; 
    border-left: 5px solid transparent;
    transition: all 0.4s ease; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.service-card:hover {
    border-left: 5px solid var(--cor-primaria); 
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-card i { 
    font-size: 3rem; 
    color: var(--cor-terciaria); 
    margin-bottom: 20px; 
    display: block; 
}

.service-card:hover i { color: var(--cor-primaria); }
.service-card h3 { color: var(--cor-secundaria); }

/* --- PERFORMANCE (CARROSSEL) --- */
.performance-section { background-color: #0f172a; color: white; }

.carousel-container {
    position: relative; 
    height: 600px; 
    width: 100%; 
    max-width: 1200px;
    margin: 40px auto; 
    overflow: hidden; 
    border-radius: 8px; 
    background: #000;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.carousel-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; transition: opacity 0.6s ease-in-out; display: none; z-index: 0;
}

.carousel-slide.current-slide { opacity: 1; z-index: 2; display: block; }

.carousel-slide img, .carousel-slide video {
    width: 100%; height: 100%; object-fit: cover; filter: brightness(0.65);
}

.slide-caption {
    position: absolute; bottom: 60px; left: 60px; max-width: 550px; z-index: 10;
    border-left: 5px solid var(--cor-primaria); padding-left: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.slide-caption h3 { color: white; font-size: 2rem; margin-bottom: 10px; }
.slide-caption p { color: #cbd5e1; margin: 0; }

/* Controles Carrossel */
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.3); color: white; border: none;
    font-size: 2rem; width: 60px; height: 60px; cursor: pointer; z-index: 20;
    display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.carousel-btn:hover { background: var(--cor-primaria); }
.prev-btn { left: 0; }
.next-btn { right: 0; }

.carousel-nav { display: flex; justify-content: center; gap: 15px; margin-top: 20px; }
.carousel-indicator {
    width: 12px; height: 12px; border-radius: 50%; background: #475569;
    border: none; cursor: pointer; transition: 0.3s;
}
.carousel-indicator.current-indicator { background: var(--cor-primaria); transform: scale(1.3); }

/* --- CLIENTES --- */
.clients-section { padding: 60px 0; background: white; border-bottom: 1px solid #e2e8f0; }
.clients-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.client-logo { height: 70px; object-fit: contain; filter: grayscale(100%); opacity: 0.7; transition: 0.3s; }
.client-logo:hover { filter: grayscale(0%); opacity: 1; }

/* --- CONTATO --- */
.contact-section {
    background-image: url('../img/contact.webp'); /* Verifique se a imagem existe */
    background-size: cover;
    background-attachment: fixed; 
    position: relative;
}
.contact-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(2, 6, 23, 0.9);
}

.form-box {
    position: relative; 
    background: white; 
    max-width: 600px; 
    margin: 0 auto;
    padding: 50px; 
    border-radius: 4px; 
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.form-control-group { margin-bottom: 15px; }
.form-control {
    width: 100%; padding: 15px; border: 1px solid #cbd5e1;
    background: #f8fafc; font-family: var(--fonte-corpo); border-radius: 4px;
}

/* --- FOOTER --- */
footer {
    background: var(--cor-secundaria); color: #64748b;
    padding: 30px 0; text-align: center; border-top: 3px solid var(--cor-primaria);
}

/* =================================================================
   BOTÕES FLUTUANTES (DOCK) - SUPORTE A IMAGENS
   ================================================================= */
.floating-dock {
    position: fixed; 
    bottom: 25px; 
    right: 25px; 
    z-index: 9999;
    display: flex; 
    align-items: flex-end; 
    gap: 15px;
}

/* Estilo Base dos Botões */
.float-btn {
    width: 60px; 
    height: 60px; 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none; 
    transition: transform 0.3s ease;
}
.float-btn:hover { transform: scale(1.1); }

/* Ajuste genérico para imagens dentro dos botões */
.float-btn img {
    width: 35px; 
    height: 35px; 
    object-fit: contain;
    filter: brightness(0) invert(1); /* Torna o ícone branco */
}

/* WhatsApp Específico */
.whatsapp-main {
    background-color: #25d366;
    animation: pulse 2s infinite;
}
.whatsapp-main:hover { background-color: #1ebc57; }

/* Instagram Específico */
.instagram-main {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.instagram-main:hover { box-shadow: 0 6px 16px rgba(214, 36, 159, 0.4); }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* --- GALERIA / MINI SLIDES (Styles Adicionais) --- */
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.gallery-item { aspect-ratio: 4/3; }
.condo-image { position: relative; background-color: #f1f5f9; }
.mini-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity 1.5s ease-in-out; z-index: 1;
}
.mini-slide.active { opacity: 1; z-index: 2; }
.mini-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3); color: white; border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    z-index: 10; display: flex; align-items: center; justify-content: center;
    transition: 0.3s;
}
.mini-nav:hover { background-color: var(--cor-primaria); transform: translateY(-50%) scale(1.1); }
.prev-mini { left: 15px; }
.next-mini { right: 15px; }

/* =================================================================
   MEDIA QUERIES - RESPONSIVIDADE (CRÍTICO)
   ================================================================= */

/* Tablets e Menores (max 992px) */
@media (max-width: 992px) {
    .port-content { grid-template-columns: 1fr; text-align: center; }
    .port-stat { display: none; } /* Oculta em telas médias para limpar visual */
    .port-text p { margin: 0 auto 20px auto; }
}

/* Celulares (max 768px) */
@media (max-width: 768px) {
    /* Tipografia Ajustada */
    h1 { font-size: 2.2rem; } 
    h2 { font-size: 1.8rem; }
    section { padding: 60px 0; }

    /* Header e Menu Mobile */
    header { padding: 0 20px; }
    .hamburger { display: block; z-index: 1001; }

    /* Menu Lateral (Gaveta) */
    nav#mainNav {
        position: fixed; 
        top: 0; 
        right: -100%; /* Inicia escondido à direita */
        width: 80%; 
        height: 100vh;
        background: var(--cor-secundaria); 
        display: flex; 
        flex-direction: column;
        justify-content: center; 
        align-items: center; 
        transition: right 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5); 
        padding: 0; 
        z-index: 1000;
    }
    
    /* Classe adicionada via JS para abrir */
    nav#mainNav.active { right: 0; }
    
    nav#mainNav ul { flex-direction: column; gap: 40px; text-align: center; }
    nav#mainNav ul li a { font-size: 1.2rem; display: block; padding: 10px; }

    /* Ajuste Carrossel Mobile */
    .carousel-container { height: 450px; }
    .slide-caption {
        bottom: 0; left: 0; width: 100%;
        background: rgba(0,0,0,0.85);
        padding: 20px; border-left: none;
        border-top: 4px solid var(--cor-primaria);
    }
    .carousel-btn { width: 40px; height: 40px; font-size: 1.2rem; }

    /* Floating Dock - Empilhado ou Ajustado */
    .floating-dock {
        flex-direction: column; /* Um sobre o outro no mobile */
        align-items: center;
        bottom: 20px; right: 15px;
        gap: 12px;
    }
    .float-btn { width: 50px; height: 50px; }
    .float-btn img { width: 28px; height: 28px; }

    /* Formulário */
    .form-box { padding: 30px 20px; }
}