:root {
    /* Paleta baseada na sua imagem */
    --roxo-escuro: #7d5ba6;
    --lilas-claro: #d7c6e9;
    --rosa: #efbcd5;
    --cinza-texto: #737373;
    --branco: #ffffff;
    --fundo-leve: #fcfcfc;
}

/* --- RESET BÁSICO --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--cinza-texto);
    line-height: 1.6;
    background-color: var(--branco);
}

/* --- ANIMAÇÃO DE SCROLL --- */

/* Estado inicial: Invisível e deslocado para baixo */
.hidden {
    opacity: 0;
    transform: translateY(50px); /* Empurra 50px para baixo */
    transition: all 1s ease; /* O efeito dura 1 segundo */
    filter: blur(5px); /* Opcional: começa levemente borrado */
}

/* Estado final: Visível e na posição original */
.show {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Dica: Se quiser que alguns elementos demorem mais para aparecer (ex: cards), 
   podemos criar um atraso */
.delay-1 { transition-delay: 200ms; }
.delay-2 { transition-delay: 400ms; }
.delay-3 { transition-delay: 600ms; }

/* --- CABEÇALHO --- */
header {
    height: 90px; /* Altura fixa */
    display: flex;
    align-items: center;
    background-color: var(--branco);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    position: relative;
    z-index: 150;
}

.logo img { 
    height: 87px; /* Tamanho desejado */
    position: relative;
    top: 5px; /* Ajuste conforme necessário */
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

nav ul { list-style: none; display: flex; gap: 25px; align-items: center; }

/* Links do Menu com Efeito Hover */
nav a {
    text-decoration: none;
    color: var(--roxo-escuro);
    font-weight: 500;
    transition: color 0.3s ease; /* Transição suave */
}

nav a:hover {
    color: var(--rosa); /* Muda para rosa ao passar o mouse */
}

/* Botão de Contato no Menu */
.btn-destaque {
    background-color: var(--roxo-escuro);
    color: white !important; /* Força ser branco */
    padding: 8px 20px;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.btn-destaque:hover {
    background-color: var(--rosa);
}

/* --- CONTAINER GERAL --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.section-padding { padding: 80px 0; }
.bg-leve { background-color: var(--fundo-leve); }

/* --- BOTÕES GERAIS --- */
.btn-center {
    text-align: center;
    margin-top: 40px;
}

.btn-main, .btn-secondary {
    display: inline-block;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: transform 0.2s, background-color 0.3s;
}

.btn-main {
    background-color: var(--roxo-escuro);
    color: white;
    margin-top: 20px;
}

.btn-secondary {
    border: 2px solid var(--roxo-escuro);
    color: var(--roxo-escuro);
}

.btn-main:hover, .btn-secondary:hover {
    background-color: var(--rosa);
    color: white;
    border-color: var(--rosa);
    transform: translateY(-3px); /* Leve subida ao passar o mouse */
}

/* --- HERO (BANNER) --- */
.hero {
    position: relative;
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)), url("imgs/home/sala_mente1.jpeg") center/cover no-repeat;
    background-color: var(--lilas-claro); /* fallback */
    padding: 80px 20px;
    text-align: center;
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 70px;
    border-bottom-right-radius: 70px;
    overflow: hidden;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero h1 {
    color: white;
    font-size: clamp(2.2rem, 6vw, 4rem);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 6px 20px rgba(0,0,0,0.45);
}

.hero p {
    color: #f5f5f5;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
}

.hero .btn-main {
    border: 2px solid #fff;
    background-color: rgba(255,255,255,0.13);
    color: #fff;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.hero .btn-main:hover,
.hero .btn-main:focus {
    background-color: var(--rosa);
    color: #fff;
    transform: translateY(-2px);
}


/* --- TÍTULOS --- */
h2 {
    color: var(--roxo-escuro);
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.resumo-texto {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* --- CARDS DE SERVIÇOS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
    border-bottom: 4px solid var(--lilas-claro);
}

.card:hover {
    transform: translateY(-5px); /* Card sobe um pouco */
}

.card h3 {
    color: var(--roxo-escuro);
    margin-bottom: 15px;
    font-size: 1.4rem;
    transition: color 0.3s; /* Transição da cor do texto */
}

.card p {
    color: var(--cinza-texto);
    transition: color 0.3s;
}

/* REQUISITO: Nome muda de cor ao passar o mouse NO CARD */
.card--with-logo {
    position: relative;
    overflow: hidden;
}

.card--with-logo::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 12px;
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.card--with-logo:hover::before {
    opacity: 1;
    transform: scale(1);
}

.card--neuro::before {
    background-image: url("imgs/logoserenamenteneuro.png");
}

.card--psicologia::before {
    background-image: url("imgs/logoserenamentepsicologia.png");
}

.card--psicoterapia::before {
    background-image: url("imgs/logoserenamentepsiterapia.png");
}

.card--neuro:hover h3 {
    color: #2f7f3f; /* verde escuro */
}

.card--neuro:hover p {
    color: #6fbf71; /* verde claro */
}

.card--psicologia:hover h3 {
    color: #d35400; /* laranja escuro */
}

.card--psicologia:hover p {
    color: #ffa726; /* laranja claro */
}

.card--psicoterapia:hover h3 {
    color: #1e6fa7; /* azul escuro */
}

.card--psicoterapia:hover p {
    color: #6fa8d6; /* azul claro */
}

.card--psicoterapia:hover p {
    color: #6fa8d6; /* azul claro */
}

/* --- GALERIA PREVIEW --- */
.galeria-preview {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.galeria-item {
    border: 2px solid rgba(141, 105, 174, 0.25);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.galeria-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
    border-color: rgba(141, 105, 174, 0.45);
}

.galeria-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* --- PÁGINA SOBRE NÓS --- */

/* Seção História */
.historia-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.historia-texto {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.titulo-historia {
    font-size: 2.8rem;
    color: var(--roxo-escuro);
    margin-bottom: 10px;
}

.historia-texto p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--cinza-texto);
}

.historia-imagem {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.historia-imagem img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Seção Motivação */
.motivacao-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.motivacao-texto h2 {
    margin-bottom: 20px;
}

.motivacao-texto p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--cinza-texto);
    margin-bottom: 25px;
}

.motivacao-texto p:last-child {
    margin-bottom: 0;
}

.img-stack {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-card {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.img-card-1 {
    width: 200px;
    height: 250px;
    top: 20px;
    left: 0;
    z-index: 3;
}

.img-card-2 {
    width: 200px;
    height: 250px;
    top: 80px;
    left: 120px;
    z-index: 2;
}

.img-card-3 {
    width: 200px;
    height: 250px;
    top: 40px;
    left: 200px;
    z-index: 1;
}

.img-stack:hover .img-card-1 { transform: translateY(-10px); }
.img-stack:hover .img-card-2 { transform: translateY(-15px); }
.img-stack:hover .img-card-3 { transform: translateY(-10px); }

/* Seção Missão, Visão e Valores */
.mvv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 40px;
}

.mvv-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease;
    border-top: 4px solid var(--lilas-claro);
}

.mvv-card:hover {
    transform: translateY(-10px);
}

.mvv-icon {
    font-size: 3rem;
    color: var(--roxo-escuro);
    margin-bottom: 20px;
}

.mvv-card h3 {
    color: var(--roxo-escuro);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.mvv-card p {
    color: var(--cinza-texto);
    font-size: 0.95rem;
    line-height: 1.7;
}

.foto-box {
    width: 300px;
    height: 200px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(141, 105, 174, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.foto-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2);
    border-color: rgba(141, 105, 174, 0.45);
}

.foto-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* mostra a imagem inteira sem cortar */
    background-color: #f2f2f2;
    display: block;
    padding: 8px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.foto-box:hover img {
    transform: scale(1.02);
    opacity: 0.95;
}

/* --- LOCALIZAÇÃO --- */
.mapa-placeholder {
    background-color: #e0e0e0;
    height: 300px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 3px solid var(--roxo-escuro);
    overflow: hidden;
}

.localizacao-horarios {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
}

/* --- RODAPÉ --- */
/* --- RODAPÉ CENTRALIZADO E COMPACTO --- */
footer {
    background-color: var(--roxo-escuro); 
    color: white;
    padding: 0; 
    width: 100%;
    margin: 0;
    position: relative; /* garante stacking context para ficar acima de elementos fixos quando necessário */
    z-index: 1000;
}

.footer-content {
    height: 170px;
    display: flex;
    justify-content: space-between; /* Mantém logo de um lado e texto de outro */
    align-items: center;
    max-width: 900px; /* Limita a largura do conteúdo */
    margin: 0 auto;   /* Centraliza o bloco inteiro na tela */
    padding: 20px;
}

.footer-logo {
    max-width: 170px; /* Tamanho do seu logo colorido */
    height: auto;
    /* Sem filtros para manter as cores originais do logo */
}

.footer-contact {
    text-align: left; /* Alinhamento do texto à esquerda dentro do seu bloco */
}

.footer-contact h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.footer-contact p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.footer-socials {
    margin-top: 15px;
    display: flex;
    gap: 20px;
}

.footer-socials a {
    color: white;
    font-size: 1.6rem;
    transition: 0.3s ease;
}

.footer-socials a:hover {
    color: var(--rosa); 
}

.footer-bottom {
    max-width: 900px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Ajuste Mobile */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        height: auto;
        padding: 40px 20px;
    }
    
    .footer-contact {
        text-align: center;
    }

    .footer-socials {
        justify-content: center;
    }
}

/* --- MOBILE --- */

/* --- ESTILOS DA PÁGINA DE SERVIÇOS --- */
.titulo-pagina {
    font-size: 3rem;
    color: var(--roxo-escuro);
    margin-bottom: 10px;
    text-align: center;
}

.subtitulo-pagina {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px auto;
    color: var(--cinza-texto);
    text-align: center;
}

.servicos-full-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.servico-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    text-align: center;
    padding-bottom: 25px;
}

.servico-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 20px;
}

.servico-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.servico-info strong {
    display: block;
    font-size: 1.3rem;
    color: var(--roxo-escuro);
    margin-bottom: 15px;
    padding: 0 15px;
    transition: color 0.3s;
}

.servico-info p {
    font-size: 0.95rem;
    padding: 0 20px;
    color: var(--cinza-texto);
}

.servico-item:hover { transform: translateY(-10px); }
.servico-item:hover .servico-img img { transform: scale(1.1); }
.servico-item:hover .servico-info strong { color: var(--rosa); }

/* --- GALERIA --- */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.galeria-item {
    width: 100%;
    height: 300px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.galeria-item:hover {
    transform: translateY(-10px);
}

.galeria-item:hover img {
    transform: scale(1.05);
}

/* --- AJUSTES DO MENU (DESKTOP E GERAL) --- */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* O primeiro valor (15px) é em cima/baixo, o segundo (25px) é nas laterais */
    padding: 15px 25px; 
    position: relative;
    width: 100%;
}

.menu-toggle {
    display: none; /* Escondido no computador */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2000; /* Fica acima de tudo */
}

.bar {
    width: 100%;
    height: 3px;
    background-color: var(--roxo-escuro);
    border-radius: 10px;
    transition: 0.3s;
}

/* --- REGRAS PARA CELULAR (MOBILE) --- */
@media (max-width: 768px) {
    
    /* Garante que a logo e o botão fiquem nas pontas */
    .header-content {
        flex-direction: row !important;
        justify-content: space-between !important;
    }

    .menu-toggle { display: flex; }

    /* A Gaveta (Menu Lateral) */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 280px; 
        height: 100vh;
        background-color: var(--branco);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1500;
        transition: right 0.4s ease;
        padding: 100px 30px;
    }

    .nav-menu.active { right: 0; }

    .nav-menu ul {
        flex-direction: column;
        gap: 25px;
        align-items: flex-start;
    }

    /* Animação do X */
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* Fundo escurecido */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1400;
    }
    .menu-overlay.active { display: block; }

    /* Ajustes de Grid e Texto no Mobile */
    .servicos-full-grid { grid-template-columns: 1fr; }
    .galeria-grid { grid-template-columns: 1fr; }
    .historia-content { grid-template-columns: 1fr; gap: 30px; }
    .motivacao-content { grid-template-columns: 1fr; gap: 30px; }
    .mvv-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .titulo-pagina { font-size: 2.2rem; }
    .titulo-historia { font-size: 2rem; }
    .img-stack { height: 300px; }
    .img-card { width: 150px !important; height: 200px !important; }
    .img-card-1 { left: 0 !important; }
    .img-card-2 { left: 80px !important; }
    .img-card-3 { left: 160px !important; }
}

/* --- ESTILOS DA TOP BAR --- */
.top-bar {
    background-color: #00995D; /* Verde clássico da Unimed */
    color: #ffffff; /* Texto em branco */
    padding: 8px 0; /* Deixa a barra fininha */
    width: 100%;
    z-index: 1000; /* Garante que fique acima de outros elementos */
}

.top-bar-content {
    display: flex;
    justify-content: center; /* Centraliza o texto e o logo no meio da tela */
    align-items: center; /* Alinha tudo na mesma linha vertical */
    gap: 12px; /* Espacinho entre o texto e o logo */
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.unimed-logo-top {
    height: 22px; /* Controla a altura do SVG para não "quebrar" a barra */
    width: auto;
}

/* Responsividade para celulares */
@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column; /* Coloca o texto em cima e o logo embaixo no celular */
        gap: 6px;
        padding: 4px 0;
        font-size: 0.8rem;
    }
}

/* --- SELO UNIMED SOLO FLUTUANTE (PNG) --- */
.unimed-solo-png-flutuante {
    position: fixed;
    bottom: 30px; /* Distância do fundo da tela */
    right: 30px;  /* Distância da direita da tela */
    z-index: 60; /* menor que o rodapé para não sobrepor os botões sociais */
    width: auto;
    pointer-events: none; /* Deixa o elemento apenas visual, não é clicável */
    display: block;
    will-change: transform; /* melhora performance em alguns navegadores */
}

/* Controla o tamanho da imagem PNG */
.unimed-solo-png-flutuante .unimed-png {
    width: 130px; /* Ajuste a largura conforme o tamanho e formato do seu logo PNG */
    height: auto;
    display: block;
    filter: drop-shadow(0px 3px 6px rgba(0,0,0,0.3)); /* Adiciona uma sombra suave para destacar */
}

/* Responsividade para celulares */
@media (max-width: 768px) {
    .unimed-solo-png-flutuante {
        bottom: 16px;
        right: 16px;
        z-index: 40; /* ainda menor no mobile */
    }
    .unimed-solo-png-flutuante .unimed-png {
        width: 100px; /* Tamanho menor no celular para não atrapalhar */
    }
}