/* 
   ==========================================================================
   VARIÁVEIS GLOBAIS (DESIGN SYSTEM)
   Aqui são definidos os tokens de design do projeto, como cores, 
   espaçamentos e tipografia. Alterar aqui reflete em todo o site.
   ========================================================================== 
*/
:root {
    /* Cores do Site: Alterar aqui muda em todo o lado */
    --color-primary: #0f5db6;
    /* Deep Teal/Blue - Confiável e médico */
    --color-primary-light: #0f5db6;
    --color-primary-dark: #08458a;
    --color-accent: #e93d3d;
    /* Gold/Bronze - Sensação Premium */
    --color-text: #272727;
    --color-text-light: #666666;
    --color-background: #ffffff;
    --color-background-alt: #9be0e7;
    --color-background-alt2: #f8f9fa;
    --color-white: #ffffff;

    /* Espaçamentos padrão */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Tipografia */
    --font-heading: "Outfit", sans-serif;
    --font-body: "Inter", sans-serif;

    /* UI */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* 
   ==========================================================================
   RESET DE ESTILOS & CONFIGURAÇÕES BASE
   Limpeza das margens e paddings padrão do navegador para garantir
   consistência visual em diferentes browsers.
   ========================================================================== 
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-background);
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* 
   ==========================================================================
   TIPOGRAFIA & TÍTULOS
   Estilização global para cabeçalhos (h1-h6) e textos base.
   ========================================================================== 
*/
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
}

/* 
   ==========================================================================
   LAYOUT & ESTRUTURA
   Contentores e seções que definem a largura e o espaçamento vertical das páginas.
   ========================================================================== 
*/
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

section {
    padding: var(--spacing-lg) 0;
}

/* 
   ==========================================================================
   CABEÇALHO (HEADER)
   Barra de navegação persistente, logótipo e menu de acesso rápido.
   ========================================================================== 
*/
.header {
    background: transparent;
    /* Começa transparente para mostrar o carousel */
    padding: var(--spacing-md) 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado do Header após o Scroll */
.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: var(--spacing-xs) 0;
    box-shadow: var(--shadow-md);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 70px;
    /* Tamanho inicial ligeiramente maior */
    width: auto;
    object-fit: contain;
    transition: all 0.4s ease;
}

.header.scrolled .logo img {
    height: 50px;
    /* Reduz o logótipo no scroll */
}

.nav-list {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    /* Centraliza os itens do menu verticalmente com o logótipo */
}

.nav-list a {
    font-weight: 500;
    color: var(--color-text);
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--color-primary);
}

/* 
   ==========================================================================
   COMPONENTES: BOTÕES
   Estilos base para as chamadas de ação (CTAs) do site.
   ========================================================================== 
*/
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* Botão Menu Mobile: Só aparece em telemóveis */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* 
   ==========================================================================
   SECÇÃO HERO (DESTAQUE INICIAL)
   A primeira secção impactante com o carousel de fundo e texto principal.
   ========================================================================== 
*/
.hero {
    position: relative;
    background-color: var(--color-background-alt);
    padding: 180px 0 var(--spacing-xl) 0;
    /* Aumentado o padding superior para o header fixo */
    overflow: hidden;
    z-index: 1;
}

.hero-background-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

/* Overlay para legibilidade */
.hero-slide::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.7),
            rgba(255, 255, 255, 0.7));
}

/* Remover overlay nos cartões para as imagens ficarem nítidas */
.card-image .hero-slide::after {
    display: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    text-align: left;
    /* Reseta o alinhamento do texto */
}

.hero-text {
    padding-right: var(--spacing-md);
}

.hero h1,
.hero h2,
.hero h3 {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 3.8rem;
    line-height: 1.1;
    white-space: nowrap;
    /* Garante que o nome fica numa linha em desktop */
}

.hero h2 {
    font-size: 2rem;
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero h3 {
    font-size: 1.2rem;
    color: var(--color-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-md);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    /* Espaço entre botões */
    flex-wrap: wrap;
    /* Permitir quebra em ecrãs pequenos */
    justify-content: flex-start;
    /* Alinhar botões à esquerda */
}

.hero-image {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 600px;
    /* Aumentado para ser bem imponente */
    margin-bottom: calc(-1 * var(--spacing-xl));
    /* Puxa a imagem para a linha final do fundo azul */
}

.hero-image img {
    max-height: 110%;
    /* Faz a imagem crescer um pouco para fora do contentor */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.15));
    z-index: 2;
}

/* Esconde a imagem mobile por padrão em ecrãs grandes */
.hero-image-mobile {
    display: none;
}

/* Responsivo: Ajustes para ecrãs pequenos (Telemóveis/Tablets) */
@media (max-width: 1024px) {
    .hero {
        padding: 120px 0 var(--spacing-lg) 0;
        /* Reduzi de 180px para libertar espaço */
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
        /* Gap menor para compactar conteúdo */
    }

    .hero-text {
        padding-right: 0;
    }

    /* Esconde a imagem original e mostra a que está entre os textos */
    .hero-image-desktop {
        display: none !important;
    }

    .hero-image-mobile {
        display: flex;
        justify-content: center;
        margin: 1rem 0 -2rem 0;
        position: relative;
        z-index: 1;
    }

    .hero-image-mobile img {
        height: 220px;
        /* Reduzi de 280px para ser mais elegante */
        width: auto;
        object-fit: contain;
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
        -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
        mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    }

    .hero-buttons {
        justify-content: center;
    }
}


/* Utilitários */
.text-center {
    text-align: center;
}

.align-center {
    align-items: center;
}

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--color-primary-dark);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

/* Cartões */
.card {
    background: var(--color-white);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 93, 182, 0.1);
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.feature-card {
    text-align: center;
    padding: 0;
    /* Tiramos o padding para a imagem colar nos bordos */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feature-card h3,
.feature-card p {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.feature-card h3 {
    margin-top: 1.5rem;
}

.feature-card p {
    margin-bottom: 2rem;
}

.card-image {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    background: var(--color-background-alt2);
}

.card-image img,
.card-image .hero-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.card-image img:not(.hero-slide) {
    position: relative;
    /* Imagens estáticas não precisam de absolute */
}

.feature-card .icon {
    /* Mantido para compatibilidade se necessário, mas card-image é preferível */
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    background: var(--color-background-alt);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
}

/* Service Cards (Especialidades) */
.service-card {
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.service-card:hover img {
    transform: scale(1.08);
}

.service-card h3 {
    margin-top: 1.5rem;
    padding: 0 1.5rem;
    font-size: 1.4rem;
}

.service-card p {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-light);
    flex-grow: 1;
    /* Garante que o texto ocupe o espaço e o botão fique alinhado */
}

.service-card .btn-link {
    margin-bottom: 1.5rem;
    align-self: center;
}

/* Preview de Sobre */
.about-preview {
    background-color: var(--color-white);
}

.about-text .lead {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--color-accent);
    padding-left: var(--spacing-sm);
}

.btn-link {
    display: inline-block;
    color: var(--color-primary);
    font-weight: 600;
    margin-top: var(--spacing-sm);
    border-bottom: 2px solid transparent;
}

.btn-link:hover {
    border-bottom-color: var(--color-accent);
}

.image-placeholder {
    width: 100%;
    height: 400px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    border-radius: var(--border-radius-lg);
}

/* 
   ==========================================================================
   RODAPÉ (FOOTER)
   Seção final com informações de contacto, links sociais e direitos de autor.
   ========================================================================== 
*/
.footer {
    background-color: #313131;
    /* Para o fundo escuro da imagem */
    color: #cccccc;
    padding-top: var(--spacing-lg);
    font-size: 0.95rem;
}

.footer-container {
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid #333;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-lg);
}

.footer-col h3 {
    color: var(--color-white);
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-heading);
}

.footer-col h4 {
    color: var(--color-white);
    /* Para títulos específicos como "Morada" */
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.footer-col h4:first-child {
    margin-top: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: #cccccc;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--color-accent);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: var(--spacing-sm);
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--color-white);
}

.social-icon.instagram:hover {
    background-color: #e1306c;
}

.social-icon.facebook:hover {
    background-color: #1877f2;
}

.social-icon.whatsapp:hover {
    background-color: #25d366;
}

.footer-logo {
    display: block;
    margin-bottom: var(--spacing-sm);
}

.footer-logo img {
    height: 120px;
    /* Aumentado de 80px */
    width: auto;
}

.footer-bottom {
    padding: var(--spacing-sm) 0;
    font-size: 0.85rem;
    color: #777;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
}

/* Rodapé Responsivo */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Centrar logo no telemóvel */
    .footer-logo img {
        margin: 0 auto;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-links a:hover {
        padding-left: 0;
    }

    .footer-bottom .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Responsivo */
@media (max-width: 1024px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero h1 {
        white-space: normal !important;
        /* Permite quebras em telemóveis e tablets */
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
        /* Imagem primeiro no telemóvel */
    }

    .nav {
        display: none;
        /* Oculto por padrão no telemóvel, o js irá alternar */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-white);
        box-shadow: var(--shadow-md);
        padding: var(--spacing-md);
    }

    .nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header .btn {
        display: none;
        /* Ocultar CTA do cabeçalho em ecrãs muito pequenos, ou mantê-lo */
    }
}

/* 
   ==========================================================================
   BOTÃO WHATSAPP (FLUTUANTE)
   Acesso rápido ao suporte/marcação via WhatsApp em qualquer página.
   ========================================================================== 
*/
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.whatsapp-btn svg {
    width: 35px;
    height: 35px;
    fill: white;
}

/* Cabeçalhos das Páginas (Tratamentos, Quem Somos, Contactos) */
.page-header {
    background-color: var(--color-background-alt);
    padding: 160px 0 var(--spacing-lg) 0;
    /* Padding extra no topo para compensar o header fixo */
    text-align: center;
}

/* Estilos da Página de Tratamentos */
.treatment-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.treatment-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-sm);
}

.treatment-card h3 {
    margin-top: auto;
}

/* Estilos da Página de Contactos */
.contact-form-container {
    background: var(--color-background-alt);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

@media (max-width: 768px) {
    .contact-content .container {
        padding-left: 1rem;
        padding-right: 1rem;
        overflow: hidden;
        /* Evita scrolls laterais estranhos */
    }

    .contact-info-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 3rem;
    }

    .contact-info-list {
        display: inline-block;
        /* Faz o bloco ter a largura do maior item */
        width: 100%;
        max-width: 310px;
        /* Largura suficiente para o e-mail mas contida para centrar */
        margin: 0 auto;
    }

    .contact-info-item {
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        text-align: left;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .email-text {
        word-break: break-all;
        /* Garante que o e-mail não "empurra" o layout para fora */
        font-size: 0.95rem;
    }

    .contact-form-container {
        padding: 2.5rem 1.5rem;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .contact-form-container h3 {
        text-align: center;
        margin-bottom: 1.5rem;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(14, 75, 91, 0.1);
}

.map-container {
    height: 100%;
    min-height: 400px;
    background: #eee;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    /* Impede que o círculo seja esmagado e fique oval */
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* 
   ==========================================================================
   COMPARISON SLIDER (ANTES & DEPOIS)
   ========================================================================== 
*/
.comparison-slider {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    cursor: ew-resize;
    user-select: none;
}

.comparison-slider img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    /* Evita que o drag do browser interfira */
}

.image-after {
    z-index: 1;
}

.image-before {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 50%;
    /* Controlado pelo JS */
    height: 100%;
    overflow: hidden;
    border-right: 3px solid white;
}

/* Garantir que a imagem debaixo não distorça quando cortada em cima */
.image-before img {
    width: auto;
    height: 100%;
    max-width: none;
}

/* Rótulos de Antes/Depois */
.label-before,
.label-after {
    position: absolute;
    top: 15px;
    padding: 4px 12px;
    background: rgba(15, 93, 182, 0.8);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    z-index: 3;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.label-before {
    left: 15px;
}

.label-after {
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
}

/* O Handle (O círculo com as setas) */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 0;
    z-index: 4;
    pointer-events: none;
}

.handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
}

.handle-circle::before,
.handle-circle::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.handle-circle::before {
    border-right: 7px solid var(--color-primary);
    margin-right: 4px;
}

.handle-circle::after {
    border-left: 7px solid var(--color-primary);
    margin-left: 4px;
}

/* 
   ==========================================================================
   PARCEIROS (INFINITE SCROLL)
   ========================================================================== 
*/
.partners {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-white);
    border-top: 1px solid var(--color-border);
    overflow: hidden;
}

.partners-slider {
    position: relative;
    width: 100%;
    mask-image: linear-gradient(to right,
            transparent,
            black 15%,
            black 85%,
            transparent);
    -webkit-mask-image: linear-gradient(to right,
            transparent,
            black 15%,
            black 85%,
            transparent);
}

/* Secção de Valores (Quem Somos) */
.values-section {
    padding: var(--spacing-xl) 0;
    background-color: var(--color-background-alt2);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.value-card {
    background: var(--color-white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(15, 93, 182, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.value-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-primary);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.value-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(15, 93, 182, 0.1);
}

.value-card:hover::before {
    transform: scaleX(1);
}

.value-icon-container {
    width: 64px;
    height: 64px;
    background: rgba(15, 100, 200, 0.08);
    /* Usando um tom de azul */
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 1.8rem;
    color: var(--color-primary);
    transition: all 0.4s ease;
}

.value-card:hover .value-icon-container {
    background: var(--color-primary);
    color: var(--color-white);
    transform: rotate(10deg);
}

.value-card h3 {
    font-size: 1.4rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.value-card p {
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .values-grid {
        grid-template-columns: 1fr;
    }
}

.partners-track {
    display: flex;
    gap: 4rem;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.partner-logo {
    width: 150px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(1);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.partner-logo:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-50% - 2rem));
    }
}

/* 
   ==========================================================================
   MODAL DE TRATAMENTOS
   ========================================================================== 
*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    /* Escondido por padrão */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--color-white);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow-y: auto;
    animation: modalScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
}

.modal-content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .modal-content-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

.modal-image {
    width: 100%;
    height: 300px;
}

@media (min-width: 768px) {
    .modal-image {
        height: 100%;
    }
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 3rem 2rem;
}

.modal-info h2 {
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.modal-info p {
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.treatment-card {
    cursor: pointer;
}

/* Estilos para P�ginas Legais (Documenta��o) */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.legal-card {
    background: var(--color-white);
    padding: 4rem;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.legal-section {
    margin-bottom: 3rem;
}

.legal-section:last-child {
    margin-bottom: 0;
}

.legal-section h2 {
    color: var(--color-primary);
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legal-section h2::before {
    content: "";
    display: block;
    width: 4px;
    height: 24px;
    background: var(--color-accent);
    border-radius: 2px;
}

.legal-section p {
    color: var(--color-text-light);
    line-height: 1.8;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .legal-card {
        padding: 2.5rem 1.5rem;
    }

    .legal-container {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
}

/* Ajustes Extra para Telemóveis Pequenos */
@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    .hero h3 {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .logo img {
        height: 50px;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }
}