/* =================================================================
   RIO CAIXAS — Landing Page
   Construção por partes — Base + Header
   ================================================================= */

/* ----------------------------- Variáveis ----------------------------- */
:root {
    /* Cores extraídas da identidade Rio Caixas */
    --color-brown:      #4a4526;   /* Marrom oliva escuro (logo/rodapé) */
    --color-brown-dark: #3b3720;
    --color-tan:        #cdb897;   /* Bege / caramelo */
    --color-tan-light:  #e4d8bf;
    --color-orange:     #e87722;   /* Laranja de destaque (CTA) */
    --color-orange-dark:#d0651a;
    --color-ink:        #2f2b24;   /* Texto principal */
    --color-muted:      #6f6a60;   /* Texto secundário */
    --color-line:       #ece7dd;   /* Linhas / bordas suaves */
    --color-white:      #ffffff;

    /* Tipografia */
    --font-base: 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Layout */
    --container: 1200px;
    --header-h: 84px;

    /* Efeitos */
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.35, 1);
    --shadow-header: 0 6px 24px rgba(60, 50, 30, 0.08);
}

/* ----------------------------- Reset ----------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-ink);
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Compensa o header fixo ao navegar por âncoras */
[id] {
    scroll-margin-top: calc(var(--header-h) + 16px);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-h);
    z-index: 1000;
    background: transparent;
    transition: height var(--transition), background var(--transition), box-shadow var(--transition);
}

/* Véu de fumaça atrás do menu (só no topo) */
 

/* Ao rolar a página, o header ganha fundo branco */
.header.is-scrolled {
    background: var(--color-white);
    box-shadow: var(--shadow-header);
}

/* Some com o véu quando o header fica branco */
.header.is-scrolled::before {
    opacity: 0;
}

.header__container {
    width: 100%;
    max-width: var(--container);
    height: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ------------------------------- Logo ------------------------------- */
.header__logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header__logo img {
    height: 52px;
    width: auto;
    transition: transform var(--transition);
}

.header__logo:hover img {
    transform: scale(1.04);
}

/* ---------------------------- Navegação ---------------------------- */
.nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    height: var(--header-h);
    padding: 0 20px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-white);
    transition: background var(--transition), color var(--transition);
}

/* Ao rolar (header branco), o texto do menu vira marrom */
.header.is-scrolled .nav__link {
    color: var(--color-brown);
}

/* Só na página inicial: no topo (header transparente) o menu já é marrom */
.page-home .header:not(.is-scrolled) .nav__link {
    color: var(--color-brown);
}

/* Hover e item ativo ganham a aba bege (mesmo estilo do Orçamento) */
.nav__link:hover,
.nav__link.is-active {
    background: var(--color-tan);
    color: var(--color-brown);
    font-weight: 600;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

/* Destaque: Orçamento — aba bege que ocupa a altura do header */
.nav__cta {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    height: var(--header-h);
    padding: 0 26px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-brown);
    background: var(--color-tan);
    transition: background var(--transition), color var(--transition);
}

/* Remove o sublinhado animado herdado do .nav__link nesta aba */
.nav__cta::after { display: none; }

.nav__cta:hover {
    background: var(--color-tan-light);
    color: var(--color-brown-dark);
}

/* ---------------------------- Hambúrguer ---------------------------- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 46px;
    height: 46px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background: var(--color-brown);
    transition: transform var(--transition), opacity var(--transition);
}

.hamburger.is-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    width: 100%;
}

.hero__media {
    position: relative;
    width: 100%;
    height: 90vh;
    overflow: hidden;
    min-height: 600px;
}

.hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Faixa bege com o slogan, sobreposta na base do banner */
.hero__slogan {
    position: absolute;
    left: 50%;
    bottom: -22px;
    transform: translateX(-50%);
    width: min(92%, 820px);
    padding: 22px 40px;
    background: var(--color-tan);
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(60, 50, 30, 0.22);
    text-align: center;
    z-index: 2;
}

/* Ponta triangular apontando para baixo */
.hero__slogan::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    border-left: 26px solid transparent;
    border-right: 26px solid transparent;
    border-top: 22px solid var(--color-tan);
}

.hero__slogan p {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-brown);
}

/* Espaço abaixo do hero para a faixa não colar na próxima seção */
.hero {
    margin-bottom: 56px;
}

/* ============================================================
   BEM-VINDO / QUEM SOMOS
   ============================================================ */
.intro {
    max-width: var(--container);
    margin: 0 auto;
    padding: 40px 28px 72px;
}

.intro__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    /* Linha vertical divisória entre texto e imagem */
    position: relative;
}

.intro__container::before {
    content: "";
    position: absolute;
    top: 8%;
    bottom: 8%;
    left: 50%;
    width: 1px;
    background: var(--color-line);
}

.intro__title {
    margin-bottom: 22px;
    font-size: clamp(1.15rem, 2.2vw, 1.6rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--color-brown);
}

.intro__text p {
    margin-bottom: 18px;
    color: var(--color-muted);
}

.intro__text p:last-child {
    margin-bottom: 0;
}

.intro__text strong {
    color: var(--color-ink);
    font-weight: 700;
}

.intro__media {
    display: flex;
    justify-content: center;
}

.intro__media img {
    width: 100%;
    max-width: 520px;
    height: auto;
}

.intro__action {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* ------------------------------- Botões ------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 54px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn--primary {
    color: var(--color-white);
    background: var(--color-orange-dark);
    box-shadow: 0 10px 24px rgba(208, 101, 26, 0.28);
}

.btn--primary:hover {
    background: var(--color-orange);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(232, 119, 34, 0.36);
}

/* ============================================================
   QUEM SOMOS
   ============================================================ */
.about {
    max-width: var(--container);
    margin: 0 auto;
    padding: 40px 28px 80px;
}

/* Título grande em bege, deslocado para a direita e sobreposto ao card */
.about__heading {
    text-align: right;
    margin-bottom: -34px;
    padding-right: 14%;
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-tan);
    position: relative;
    z-index: 1;
}

.about__container {
    display: grid;
    grid-template-columns: 38% 1fr;
    gap: 40px;
    align-items: center;
}

.about__logo {
    display: flex;
    justify-content: center;
}

.about__logo img {
    width: 100%;
    max-width: 340px;
    height: auto;
}

/* Card bege com texto */
.about__card {
    background: var(--color-tan);
    border-radius: 28px;
    padding: 48px 44px 40px;
    color: var(--color-white);
}

.about__subtitle {
    margin-bottom: 22px;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 700;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--color-brown);
}

/* Foto flutuando à esquerda, com o texto contornando */
.about__photo {
    float: left;
    width: 320px;
    margin: 4px 24px 12px 0;
    border-radius: 4px;
    border: 4px solid var(--color-white);
    box-shadow: 0 8px 20px rgba(60, 50, 30, 0.25);
}

.about__card p {
    margin-bottom: 14px;
    text-align: left;
    color: var(--color-white);
}

.about__card p:last-child {
    margin-bottom: 0;
}

.about__card strong {
    font-weight: 700;
    color: var(--color-brown-dark);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #5b451f;
    color: var(--color-tan-light);
    padding: 40px 0 28px;
    font-size: 0.9rem;
}

.footer__container,
.footer__emails {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

.footer__container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: center;
}

.footer__brand img {
    width: 100%;
    max-width: 240px;
    height: auto;
}

.footer__contacts {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer__contacts > li {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 40px;
}

.footer__item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer__item svg,
.footer__email svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    fill: var(--color-tan);
}

.footer__item strong,
.footer__email strong {
    font-weight: 600;
    color: var(--color-white);
}

/* Linha divisória + bloco de e-mails */
.footer__emails {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(201, 183, 143, 0.28);
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 24px;
}

.footer__email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    transition: color var(--transition);
}

.footer__email:hover {
    color: var(--color-white);
}

.footer__email:hover strong {
    color: var(--color-tan);
}

/* Telefone e WhatsApp clicáveis no footer */
a.footer__item {
    transition: color var(--transition);
}

a.footer__item:hover {
    color: var(--color-white);
}

a.footer__item:hover strong {
    color: var(--color-tan);
}

/* ============================================================
   BOTÃO FLUTUANTE — WHATSAPP
   ============================================================ */
.whatsapp-float {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: #25d366;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition), box-shadow var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: var(--color-white);
}

@media (max-width: 600px) {
    .whatsapp-float {
        right: 16px;
        bottom: 16px;
        width: 52px;
        height: 52px;
    }
    .whatsapp-float svg { width: 28px; height: 28px; }
}

/* ============================================================
   RESPONSIVIDADE — HEADER
   ============================================================ */
@media (max-width: 900px) {
    :root { --header-h: 72px; }

    .header__logo img { height: 44px; }

    .hamburger { display: flex; }

    /* A aba de orçamento volta a ser um item normal dentro do menu mobile */
    .nav__cta {
        height: auto;
        padding: 14px 16px;
    }

    /* Intro empilha, centraliza e esconde a linha divisória */
    .intro__container {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .intro__container::before { display: none; }

    .intro__media { order: -1; }

    .intro__text { text-align: center; }

    /* Quem Somos empilha e centraliza tudo */
    .about__heading {
        text-align: center;
        padding-right: 0;
        margin-bottom: 18px;
    }

    .about__container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about__logo img { max-width: 240px; }

    .about__card {
        padding: 32px 26px;
        text-align: center;
    }

    .about__subtitle { text-align: center; }

    /* Foto deixa de flutuar e vai centralizada acima do texto */
    .about__photo {
        float: none;
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 0 auto 20px;
    }

    .about__card p { text-align: center; }

    /* Footer empilha */
    .footer {
        padding-bottom: 88px; /* folga pro botão flutuante do WhatsApp */
    }

    .footer__container {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .footer__brand { display: flex; justify-content: center; }

    .footer__contacts > li { justify-content: center; }

    .footer__emails {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    /* No mobile os e-mails podem quebrar linha (não cortar) */
    .footer__email {
        white-space: normal;
        justify-content: center;
        text-align: center;
        word-break: break-word;
    }

    /* No mobile esconde os ícones do footer */
    .footer__item svg,
    .footer__email svg {
        display: none;
    }

    /* Menu lateral deslizante */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(82%, 340px);
        height: 100vh;
        padding: calc(var(--header-h) + 24px) 28px 32px;
        background: var(--color-white);
        box-shadow: -14px 0 40px rgba(0, 0, 0, 0.16);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.35, 1);
        overflow-y: auto;
    }

    .nav.is-open {
        transform: translateX(0);
    }

    .nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .nav__link {
        height: auto;
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    /* No menu mobile o texto é sempre marrom (fundo branco do painel) */
    .header .nav__link { color: var(--color-brown); }

    .nav__cta {
        margin-left: 0;
        margin-top: 14px;
        justify-content: center;
    }

    /* Overlay escuro atrás do menu */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition), visibility var(--transition);
        z-index: 999;
    }

    .nav-overlay.is-open {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .header__container { padding: 0 18px; }
    .header__logo img { height: 40px; }
}

/* Acessibilidade: reduz movimento */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ---------------------- Feedback dos formulários ---------------------- */
.form__feedback {
    margin-top: 6px;
    min-height: 1.2em;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

.form__feedback--ok {
    color: #1c7c3c;
}

.form__feedback--erro {
    color: #c0392b;
}

/* ---------------------- Endereço clicável (abre mapa) ---------------------- */
.footer__item--map {
    background: none;
    border: 0;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.footer__item--map:hover strong,
.footer__item--map:focus-visible strong {
    text-decoration: underline;
}

.footer__item--map:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------------------- Modal do mapa ---------------------- */
.map-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.map-modal.is-open {
    display: flex;
}

.map-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.map-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: mapModalIn 0.25s ease;
}

@keyframes mapModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.map-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.map-modal__close:hover,
.map-modal__close:focus-visible {
    background: rgba(0, 0, 0, 0.8);
}

.map-modal__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
}

.map-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Trava o scroll do fundo quando o modal está aberto */
body.map-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .map-modal {
        padding: 0.75rem;
    }
    .map-modal__frame {
        aspect-ratio: 3 / 4;
    }
}
