/* ==================== CONFIGURAÇÃO GERAL E VARIÁVEIS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&family=Roboto:wght@400;500&display=swap');

:root {
    /* Paleta de Cores */
    --color-primary: #0055FF; /* Azul Vibrante (Royal/Elétrico) */
    --color-secondary: #E60023; /* Vermelho Automotivo */
    --color-dark: #111111;      /* Preto Profundo */
    --color-light: #FFFFFF;     /* Branco Puro */
    --color-gray-light: #F4F4F4;
    --color-gray-dark: #AAAAAA;
    --color-text: #333;

    /* Tipografia */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Outros */
    --container-width: 1140px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 5px 15px rgba(0, 0, 0, 0.3);
    --border-radius: 8px;
    --transition: all 0.3s ease-in-out;
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: var(--transition);
}

a:hover {
    color: var(--color-secondary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.2;
}

/* ==================== CONTROLE DE VÍDEO PERSONALIZADO ==================== */

/* 1. O contêiner pai para posicionamento */
.video-container {
    position: relative;
    /* Faz o contêiner ter o tamanho exato do vídeo */
    display: inline-block; 
    line-height: 0; /* Remove espaço extra */
    border-radius: var(--border-radius); /* Garante que o hover não vaze */
    overflow: hidden; /* Garante que o botão não vaze */
}

/* 2. Seu CSS de vídeo original (adicionando cursor: pointer) */
video {
    background: #000000;
    border: 5px solid transparent; /* borda “falsa” */
    border-radius: var(--border-radius);
    background-image: 
        linear-gradient(#000000, #000000), /* fundo interno */
        linear-gradient(to right, #f0f0f0, #c0c0c0); /* gradiente da borda */
    background-origin: border-box;
    background-clip: content-box, border-box;
    box-sizing: border-box;
    cursor: pointer; /* Permite clicar no vídeo para pausar */
}

/* 3. O botão de Play/Pause estilizado */
.play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Centraliza perfeitamente */
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10;
    
    /* Estilo (usando suas cores) */
    background: rgba(15, 0, 230, 0.8); /* var(--color-secondary) com transparência */
    color: var(--color-light);
    border: 2px solid var(--color-light);
    border-radius: 50%; /* Círculo */
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    
    cursor: pointer;
    transition: all 0.2s ease-out;
    
    /* Escondido por padrão */
    opacity: 0;
}

/* Faz o botão aparecer no hover */
.video-container:hover .play-pause-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- Lógica de troca de ícone --- */

/* Por padrão (tocando), o ícone 'play' está escondido */
.play-pause-btn .fa-play {
    display: none;
}

/* Quando tiver a classe 'paused' */
.play-pause-btn.paused .fa-pause {
    display: none; /* Esconde o 'pause' */
}

.play-pause-btn.paused .fa-play {
    display: block; /* Mostra o 'play' */
    /* Pequeno ajuste para centralizar o ícone de play */
    margin-left: 4px; 
}

/* .gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: linear-gradient(to right, #f0f0f0, #c0c0c0);
    padding: 5px;
    transition: var(--transition);
} */

/* ==================== CLASSES UTILITÁRIAS ==================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    text-transform: uppercase;
}
.section-title.light {
    color: var(--color-light);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-gray-dark);
    margin-bottom: 3rem;
}

.text-center {
    text-align: center;
}

.bg-dark {
    background-color: var(--color-dark);
    color: var(--color-light);
}
.bg-dark h1, .bg-dark h2, .bg-dark h3 {
    color: var(--color-light);
}
.bg-dark p {
    color: var(--color-gray-dark);
}

.bg-light {
    background-color: var(--color-gray-light);
}

/* Botões */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-light);
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-light);
    border-color: var(--color-secondary);
}
.btn-secondary:hover {
    background-color: transparent;
    color: var(--color-secondary);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

#topodetalhes {
    background: #282828;
}

/* ==================== HEADER & NAVEGAÇÃO ==================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    padding: 1rem 0;
    transition: var(--transition);
}

#topodetalhes{
    background: #282828;
}

#header.sticky {
    background: rgba(17, 17, 17, 0.9); /* Preto Profundo com transparência */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--color-light);
    text-transform: uppercase;
}
.logo:hover {
    color: var(--color-light);
}

/* Menu Mobile (Mobile-First) */
.nav-links {
    display: none; /* Escondido por padrão */
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-dark);
    padding: 1rem 0;
}
.nav-links.active {
    display: flex; /* Mostra quando ativo */
}

.nav-links li {
    text-align: center;
    margin: 0.5rem 0;
}

.nav-links a {
    color: var(--color-light);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.5rem 1rem;
    display: block;
}
.nav-links a:hover {
    color: var(--color-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-icon {
    font-size: 1.2rem;
    color: var(--color-light);
    cursor: pointer;
}

.header-cta {
    display: none; /* Escondido no mobile */
}

#mobile-menu-toggle {
    font-size: 1.5rem;
    color: var(--color-light);
    cursor: pointer;
}

/* ==================== HERO SECTION ==================== */
.hero {
    height: 100vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-light);
    
    /* Substitua pelo URL da sua imagem/vídeo de fundo */
    background-image: url(https://i.postimg.cc/MTHsPKcD/background.jpg);
    background-size: cover;
    background-position: center center;
    /* background-attachment: fixed; Efeito Paralaxe Simples (Cuidado no Mobile) */
    position: relative;
}

/* Overlay escuro para legibilidade */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-light);
    margin-bottom: 1rem;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--color-light);
    font-weight: 400;
}

/* ==================== SEÇÃO PRODUTOS ==================== */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas no mobile */
    gap: 1rem;
}

.category-card {
    background: var(--color-gray-light);
    padding: 2rem 1rem;
    text-align: center;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.category-card i {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.category-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    transition: var(--transition);
}

.category-card:hover, .category-card.active {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.category-card:hover i, .category-card:hover h3,
.category-card.active i, .category-card.active h3 {
    color: var(--color-light);
}

/* Preview de Produtos (Dinâmico) */
.product-preview-container {
    margin-top: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 1.5rem;
    /* Animação suave de entrada */
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    background: var(--color-light);
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.product-card img {
    width: 100%;
    height: 345px;
    object-fit: cover;
}

.product-card-content {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.product-card-content p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    flex-grow: 1;
}

/* [NOVO] Estilos para a descrição oculta */
.product-details-hidden {
    max-height: 0; /* Começa oculto */
    overflow: hidden;
    transition: all 0.5s ease-in-out; /* Transição suave */
    border-top: 1px solid transparent; /* Linha sutil que aparecerá */
    margin-top: 0; /* Sem margem quando oculto */
}

.product-details-hidden.visible {
    max-height: 500px; /* Altura máxima para expandir */
    margin-top: 1rem; /* Espaçamento quando visível */
    padding-top: 1rem; /* Espaçamento interno */
    border-top: 1px solid #eee; /* Linha sutil */
}

.product-details-hidden p {
    font-size: 0.9rem;
    color: #333; /* Cor de texto mais escura para a descrição */
    margin-bottom: 0; /* Remove margem extra */
}

/* [NOVO] Estilos para o Carrossel de Imagem do Produto */
.product-image-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Mantém a proporção da imagem (4:3) */
    padding-top: 95%; 
    background: #f0f0f0;
}

.product-image-slider .slider-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.product-image-slider .slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-slider .slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-light);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    opacity: 0; /* Começa invisível */
}

/* Mostra as setas ao passar o mouse */
.product-card:hover .slide-arrow {
    opacity: 1;
}

.product-image-slider .slide-arrow:hover {
    background: var(--color-primary);
}

.product-image-slider .slide-arrow.prev {
    left: 10px;
}
.product-image-slider .slide-arrow.next {
    right: 10px;
}

/* ==================== SEÇÃO POR QUE A SONNIC? ==================== */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas no mobile */
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-item i {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Contador */
.counter-section {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 2rem;
    margin-top: 4rem;
    text-align: center;
}

.counter-item span {
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-secondary);
    display: block;
}
.counter-item p {
    font-size: 1.1rem;
    color: var(--color-gray-dark);
    font-family: var(--font-heading);
}

/* ==================== SEÇÃO INSTALAÇÕES (GALERIA) ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 colunas no mobile */
    gap: 0.5rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    background: linear-gradient(to right, #f0f0f0, #c0c0c0);
    padding: 5px;
    transition: var(--transition);
}
.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-dark);
    z-index: 2;
}

/* ==================== SEÇÃO DEPOIMENTOS (CARROSSEL) ==================== */
.testimonial-slider {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
    min-height: 250px; /* Evita "pulos" de layout */
}

.slider-container {
    display: flex; /* JS vai controlar o 'transform' */
    transition: transform 0.5s ease-in-out;
}

.testimonial-slide {
    min-width: 100%;
    padding: 1.5rem;
    text-align: center;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.5s ease-in-out;
}

.testimonial-slide.active {
    opacity: 1;
    position: relative;
}

.testimonial-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--color-primary);
}

.testimonial-text {
    font-size: 1.1rem;
    font-style: italic;
    color: #555;
    margin-bottom: 1rem;
}

.testimonial-author {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.slider-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}
.slider-control:hover {
    background: var(--color-secondary);
}

.slider-control.prev {
    left: 0px;
}
.slider-control.next {
    right: 0px;
}

/* ==================== SEÇÃO CONTATO ==================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 3rem;
}

/* Formulário */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 1rem;
}
#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 5px rgba(0, 85, 255, 0.3);
}

/* Informações e Mapa */
.contact-info h3, #contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info p i {
    color: var(--color-primary);
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.contact-info p a {
    color: inherit; /* Herda a cor do parágrafo (preto) */
    text-decoration: none; /* Remove o sublinhado */
}

.contact-info p a:hover {
    color: var(--color-primary); /* Muda para a cor primária ao passar o mouse */
    text-decoration: underline;
}

.map-placeholder {
    width: 100%;
    height: 250px;
    background: var(--color-gray-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid #ddd;
    margin: 1.5rem 0;
}
.map-placeholder iframe {
    border: 0;
}

.social-links a {
    color: var(--color-dark);
    font-size: 1.5rem;
    margin-right: 1rem;
}
.social-links a:hover {
    color: var(--color-primary);
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--color-dark);
    color: var(--color-gray-dark);
    padding-top: 4rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr; /* 1 coluna no mobile */
    gap: 2rem;
    text-align: center;
}

.footer-col .logo {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-col h4 {
    font-size: 1.2rem;
    color: var(--color-light);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}
.footer-col ul li a {
    color: var(--color-gray-dark);
}
.footer-col ul li a:hover {
    color: var(--color-light);
    padding-left: 5px;
}

.footer-col p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.footer-col p i {
    margin-right: 0.5rem;
}

.footer-col .social-links a {
    color: var(--color-gray-dark);
    font-size: 1.3rem;
    margin: 0 0.5rem;
}
.footer-col .social-links a:hover {
    color: var(--color-light);
}

.copyright {
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid #333;
    font-size: 0.9rem;
}
.copyright p {
    margin-bottom: 0.5rem;
}
.copyright a {
    color: var(--color-gray-dark);
}
.copyright a:hover {
    color: var(--color-light);
}

/* ==================== ANIMAÇÃO SCROLL REVEAL ==================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


/* =================================================================
   MEDIA QUERIES (TABLET E DESKTOP)
================================================================= */

/* --- Telas Médias (Tablets) --- */
@media (min-width: 768px) {
    .section {
        padding: 5rem 0;
    }
    
    .section-title {
        font-size: 3rem;
    }

    /* Navegação */
    #mobile-menu-toggle {
        display: none;
    }
    .nav-links {
        display: flex;
        flex-direction: row;
        position: static;
        background: none;
        width: auto;
        padding: 0;
    }
    .nav-links li {
        margin: 0;
    }
    .nav-links a {
        padding: 0 1rem;
        font-weight: 500;
        font-family: var(--font-body);
    }
    .nav-links a:hover {
        color: var(--color-primary);
    }
    .header-cta {
        display: inline-block;
    }

    /* Hero */
    .hero h1 {
        font-size: 4rem;
    }

    /* Produtos */
    .category-grid {
        grid-template-columns: repeat(5, 1fr); /* 5 colunas */
    }
    .product-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 colunas */
    }

    /* Por que a Sonnic */
    .features-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 colunas */
    }
    .counter-section {
        grid-template-columns: repeat(3, 1fr); /* 3 colunas */
    }

    /* Galeria */
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 colunas */
    }
    .gallery-grid img {
        height: 250px;
    }

    /* Contato */
    .contact-container {
        grid-template-columns: 1fr 1fr; /* 2 colunas */
        gap: 4rem;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 colunas */
        text-align: left;
    }
    .footer-col .social-links a {
        margin: 0 0.8rem 0 0;
    }
}

/* --- Telas Grandes (Desktops) --- */
@media (min-width: 1200px) {
    .hero h1 {
        font-size: 5rem;
    }
    
    .hero p {
        font-size: 1.5rem;
    }
}