/* =========================
   GLOBAL E VARIÁVEIS
============================== */
:root {
    --color-primary: #0A3D62;
    --color-secondary: #2E8B57;
    --color-accent: #FFB600;
    --color-dark: #072a44;
    --color-light: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #f1f1f1;
    --color-bg-light-gray: #f9f9f9;
    
    --font-family: 'Helvetica Neue', 'Arial', sans-serif;
    --header-height: 70px;
    --border-radius-md: 8px;
    --border-radius-xl: 16px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%; 
    max-width: 100%;
    /* Garante que o scroll vá até o ponto correto, abaixo do header fixo */
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
    width: 100%;
    max-width: 100%; 
    overflow-x: hidden; 
}

/* Essencial para travar a rolagem quando modais estiverem abertos */
body.no-scroll {
    overflow: hidden;
}

img {
    max-width: 100%; 
    height: auto; 
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--color-primary);
}

.container {
    width: 100%; 
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.8rem; 
}

.container--medium {
    max-width: 800px;
}

.mobile-only { display: block; }
.desktop-only { display: none; }

/* =========================
   COMPONENTES (Botões, Cards)
============================== */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn--accent {
    background-color: var(--color-accent);
    color: var(--color-dark);
}
.btn--accent:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 182, 0, 0.3);
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-light);
}
.btn--primary:hover {
    background-color: #083252;
}

.btn--secondary {
    background-color: var(--color-bg-light-gray);
    color: var(--color-primary);
    border: 1px solid #ddd;
}

.btn--primary-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn--primary-outline-light {
    background-color: transparent;
    color: var(--color-light);
    border: 2px solid var(--color-light);
}
.btn--primary-outline-light:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
}

.btn--full-width {
    width: 100%;
}

.card {
    background-color: var(--color-light);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    text-align: center;
}
.card__icon {
    width: 50px; height: 50px; margin: 0 auto 1rem;
}
.card__title {
    font-size: 1.25rem; color: var(--color-primary); margin-bottom: 0.5rem;
}
.card__description {
    font-size: 0.95rem;
}

/* =========================
   SEÇÕES
============================== */
.section { padding: 4rem 0; }
.section--dark {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}
.section--light-gray {
    background-color: var(--color-bg-light-gray);
}

.section__title {
    font-size: 2rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.section__title-light {
    font-size: 2rem;
    color: var(--color-light);
    margin-bottom: 1rem;
}
.section__subtitle {
    font-size: 1.1rem;
    text-align: center;
    color: #555;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto; margin-right: auto;
}
.section__tag {
    display: inline-block;
    font-size: 0.9rem; font-weight: 600;
    color: var(--color-accent); text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* =========================
   HEADER (Fixo)
============================== */
.header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--header-height);
    background-color: var(--color-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}
.header__container {
    height: 100%;
    display: flex; justify-content: space-between; align-items: center;
}
.header__logo img { height: 50px; }
.header__nav-toggle { background: none; border: none; cursor: pointer; padding: 5px; }
.header__nav-toggle img { width: 28px; }

/* Menu Mobile */
.header__nav {
    position: fixed;
    top: 0; right: -100%;
    width: 100%;
    height: 100dvh; /* Usa dynamic viewport height */
    background-color: var(--color-dark);
    padding: 6rem 2rem 2rem;
    transition: right 0.3s ease-in-out;
    z-index: 1001;
}
.header__nav.is-active { right: 0; }
.header__nav-list {
    display: flex; flex-direction: column; align-items: center; gap: 2rem;
}
.header__nav-link {
    font-size: 1.5rem; color: var(--color-light); font-weight: 600;
}
.header__nav-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    background: none; border: none; cursor: pointer;
}
.header__nav-close img { width: 24px; }


/* =========================
   HERO SECTION
============================== */
.hero {
    position: relative;
    width: 100%;
    
    height: auto; 
    min-height: 100vh;
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    
    background-size: cover;
    background-position: center;
    color: var(--color-light);
    
    /* Compensação para o header fixo em mobile */
    padding-top: 130px; 
    padding-bottom: 4rem;
}

.hero__overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(10, 61, 98, 0.75);
    z-index: 1;
}

.hero__container {
    margin-top: 7rem;
    position: relative; z-index: 2;
    width: 100%;
}

.hero__title {
    font-size: 2rem; 
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero__subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 90%;
    margin-left: auto; margin-right: auto;
}

.hero__cta-group {
    display: flex; flex-direction: column; gap: 1rem;
    width: 100%; max-width: 300px; margin: 0 auto;
}


/* =========================
   DIFERENCIAIS & LAYOUTS
============================== */
.grid-4 {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}

.split-layout {
    display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center;
}
.split-layout__content { order: 2; }
.split-layout__media { order: 1; border-radius: var(--border-radius-xl); overflow: hidden; }
.split-layout__media img { width: 100%; height: 100%; object-fit: cover; }

.checklist { list-style: none; margin: 1.5rem 0; }
.checklist li {
    position: relative; padding-left: 28px; margin-bottom: 0.75rem;
}
.checklist li::before {
    content: '✔'; position: absolute; left: 0; top: 0;
    color: var(--color-accent); font-weight: 700;
}

/* =========================
   CARROSSEL
============================== */
.carousel-wrapper {
    display: flex; align-items: center; justify-content: center;
    position: relative; width: 100%; max-width: 1200px; margin: 0 auto; gap: 10px;
}
.product-grid {
    display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-behavior: smooth;
    gap: 20px; padding: 20px 5px; flex: 1; width: 0;
    scrollbar-width: none; -ms-overflow-style: none;
}
.product-grid::-webkit-scrollbar { display: none; }

.card--product {
    flex: 0 0 auto; width: 280px; scroll-snap-align: start;
    background: #fff; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1.5rem; display: flex; flex-direction: column; align-items: center;
}
.card__image { width: 100%; height: 180px; object-fit: contain; margin-bottom: 1rem; }

.carousel-btn {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    background-color: var(--color-primary); color: #fff; border: none;
    font-size: 1.5rem; cursor: pointer; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@media (max-width: 768px) { .carousel-btn { display: none; } }

/* =========================
   FAQ
============================== */
.faq-accordion { display: flex; flex-direction: column; gap: 1rem; }
.faq-item { border: 1px solid #eee; border-radius: var(--border-radius-md); overflow: hidden; }
.faq-question {
    padding: 1.5rem; font-size: 1.1rem; font-weight: 600; cursor: pointer;
    display: block; position: relative;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: '+'; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%);
    font-size: 1.5rem; color: var(--color-primary);
}
.faq-item[open] .faq-question::after { content: '−'; }
.faq-answer { padding: 0 1.5rem 1.5rem; background-color: #fdfdfd; }

/* =========================
   FOOTER
============================== */
.footer {
    background-color: var(--color-dark); color: var(--color-text-light); padding: 4rem 0 2rem;
}
.footer__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.footer__col p { opacity: 0.7; }
.footer__logo { height: 40px; margin-bottom: 1rem; filter: invert(1) brightness(2); }
.footer__title { font-size: 1.2rem; color: var(--color-light); margin-bottom: 1rem; }
.footer__list li { margin-bottom: 0.5rem; }
.footer__list a { color: var(--color-text-light); opacity: 0.7; }
.footer__newsletter-form { display: flex; gap: 0.5rem; }
.footer__newsletter-form input { flex-grow: 1; border: none; padding: 0.75rem; border-radius: var(--border-radius-md); }
.footer__bottom {
    margin-top: 3rem; padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center; opacity: 0.7;
}

/* =========================
   FLOATING ACTIONS
============================== */
.floating-actions {
    position: fixed;
    /* Suporte a safe-areas do iOS/Android (notch, barra de gestos) */
    bottom: calc(20px + env(safe-area-inset-bottom)); right: 20px;
    display: flex; flex-direction: column; gap: 15px; z-index: 900;
    align-items: flex-end;
}
.fab {
    width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
    box-shadow: var(--shadow-medium); display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s; position: relative;
}
.fab:hover { transform: scale(1.1); }
.fab--chat { background-color: var(--color-primary); color: #fff; }
.fab--calc { background-color: var(--color-accent); color: var(--color-dark); }
.fab__badge {
    position: absolute; top: -2px; right: -2px; background: red; color: white;
    font-size: 0.7rem; width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold;
}
.fab-tooltip {
    position: absolute; right: 70px; top: 50%; transform: translateY(-50%);
    background: #333; color: #fff; padding: 5px 10px; border-radius: 4px;
    font-size: 0.8rem; white-space: nowrap; opacity: 0; transition: opacity 0.3s;
    pointer-events: none;
}
.fab:hover .fab-tooltip { opacity: 1; }


/* =========================
   SIDEBARS (Modais)
============================== */
.sidebar-modal {
    position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 400px;
    height: 100dvh; /* Melhor para mobile */
    background: #fff; z-index: 2000;
    box-shadow: -5px 0 25px rgba(0,0,0,0.2); transform: translateX(100%);
    transition: transform 0.4s ease; display: flex; flex-direction: column;
}
.sidebar-modal.is-open { transform: translateX(0); }
.sidebar-header {
    padding: 1rem 1.5rem; background: var(--color-primary); color: white;
    display: flex; justify-content: space-between; align-items: center;
}
.sidebar-header--accent { background: var(--color-accent); color: var(--color-dark); }
.sidebar-close { background: none; border: none; font-size: 2rem; color: inherit; cursor: pointer; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 1.5rem; }
.iframe-wrapper { padding: 0; }
.chat-iframe { width: 100%; height: 100%; border: none; }

/* Calc Form */
.calc-form .form-group { margin-bottom: 1rem; }
.calc-form label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.calc-form input { width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 6px; }
.input-wrapper { position: relative; }
.input-prefix { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #666; }
.input-wrapper input { padding-left: 35px; }
.form-divider { margin: 1.5rem 0; border: 0; border-top: 1px dashed #ccc; }

/* Calc Result */
.calc-result {
    margin-top: 2rem; background: #eefbf2; padding: 1.5rem;
    border-radius: 8px; border: 1px solid #c1eac5; text-align: center;
}
.result-box { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 1.1rem; }
.result-value { font-weight: bold; color: var(--color-secondary); }
.result-value--big { font-size: 1.4rem; }

/* =======================================================
   RESPONSIVIDADE (Desktop > 768px)
======================================================= */
@media (min-width: 768px) {
    .mobile-only { display: none; }
    .desktop-only { display: block; }

    /* Header Desktop */
    .header__nav { position: static; height: auto; padding: 0; background: none; width: auto; }
    .header__nav-list { flex-direction: row; gap: 2rem; }
    .header__nav-link { font-size: 1rem; color: var(--color-text); font-weight: 500; }
    .header__nav-close { display: none; }
    .header__logo img { height: 60px; }

    /* Hero Desktop */
    .hero {
        height: 100vh;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--header-height);
        padding-bottom: 0;
        text-align: left;
    }
    .hero__container {
        display: flex; flex-direction: column; 
        justify-content: center;
        height: 100%; 
        text-align: left;
    }
    .hero__title { font-size: 3.5rem; margin-bottom: 1rem; }
    .hero__subtitle { font-size: 1.25rem; margin: 0 0 2.5rem 0; margin-left: 0; max-width: 600px; }
    .hero__cta-group { flex-direction: row; max-width: none; margin: 0; justify-content: flex-start; }

    /* Grids */
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .footer__grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; }
    .split-layout { grid-template-columns: 1fr 1fr; gap: 4rem; }
    .split-layout__content { order: 1; }
    .split-layout__media { order: 2; }
    .split-layout--reverse .split-layout__content { order: 2; }
    .split-layout--reverse .split-layout__media { order: 1; }
    
    #chat-window { border-left: 1px solid #ddd; }
}