:root {
    --primary-color: #00b8e3;
    --primary-dark: #00a88d;
    --secondary-color: #0e2a47;
    --text-dark: #333333;
    --text-muted: #6c757d;
    --light-bg: #f8f9fa;
    --section-spacing: 80px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--secondary-color);
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-secondary { background-color: var(--secondary-color) !important; }

.bg-primary-subtle {
     background-color: rgba(0, 203, 169, 0.15) !important;
}

.fw-medium { font-weight: 500; }
.fw-bold { font-weight: 700; }
.fw-bolder { font-weight: 800; }
.ls-sm { letter-spacing: 1px; }

.section-padding {
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.transition-all { transition: all 0.3s ease-in-out; }

.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.075)!important;
}

.hover-scale { transition: transform 0.5s ease; }
.blog-card:hover .hover-scale { transform: scale(1.05); }

.placeholder-image { display: block; background-color: #e9ecef; }

.navbar-nav .nav-link {
    color: var(--secondary-color);
    font-size: 0.9rem;
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.hero-section {
    position: relative;
}

.hero-slide {
    height: calc(100vh - 100px); 
    min-height: 600px;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 50%, rgba(255,255,255,0) 100%);
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
}

.tracking-wide {
    letter-spacing: 1px;
}

/* ================= CONTROLES CUSTOMIZADOS DO BANNER PRINCIPAL ================= */
.custom-hero-controls {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 10;
    display: flex;
    gap: 15px;
}

.hero-nav-btn {
    width: 50px;
    height: 50px;
    background-color: white;
    color: var(--primary-color);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

.hero-nav-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
}

.hero-nav-btn:active {
    transform: translateY(0);
}

.carousel-control-prev, .carousel-control-next {
    width: 5%;
    opacity: 0;
    transition: opacity 0.3s;
}

.hero-section:hover .carousel-control-prev,
.hero-section:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-icon-bg {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 50px; height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
}

.carousel-control-next-icon, .carousel-control-prev-icon { display: none; }

.btn-video-play {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 60px; height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    position: relative;
}

.btn-video-play:hover { color: white; background-color: var(--primary-dark); }

.ripple::before, .ripple::after {
    content: '';
    display: block; position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    animation: ripple 2s linear infinite;
}

.ripple::after { animation-delay: 1s; }

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

.service-box {
    border: 1px solid rgba(0,0,0,0.05);
}

.service-box .icon-wrapper i {
    transition: transform 0.3s ease;
}

.service-box:hover .icon-wrapper i {
    transform: scale(1.2) rotate(5deg);
}

.service-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.doctor-card {
    border: 1px solid rgba(0,0,0,0.05);
}

.team-hover:hover .team-social { opacity: 1 !important; }
.team-hover:hover .doctor-img-wrapper img { transform: scale(1.05); transition: transform 0.5s ease; }

.tips-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 70%;
    background-color: var(--secondary-color);
    z-index: 1;
}

.tips-section .container { z-index: 2; }

.tips-card-wrapper {
    position: relative;
}

.tips-nav-arrow {
    width: 50px; height: 60px;
    opacity: 0.8; transition: all 0.3s;
}

.tips-nav-arrow:hover { opacity: 1; width: 60px; }
.tips-prev:hover { padding-right: 1.5rem!important; }
.tips-next:hover { padding-left: 1.5rem!important; }

/* Breadcrumb Banner */
.page-title-area {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 100px 0 80px;
    position: relative;
}
.page-title-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(14, 42, 71, 0.85); /* Azul secundário com opacidade */
    z-index: 1;
}
.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.5);
    content: "\f105"; /* Ícone de seta do FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
.breadcrumb a:hover {
    color: var(--primary-color) !important;
}

/* Missão, Visão e Valores Cards */
.mvv-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}
.mvv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08) !important;
}

/* Filtros e Busca */
.search-box {
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    overflow: hidden;
}
.search-box input {
    border: none; outline: none; box-shadow: none;
}
.filter-btn {
    border: 1px solid #ddd; color: var(--text-muted); border-radius: 50px;
    padding: 8px 20px; font-weight: 500; transition: all 0.3s ease;
}
.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color); color: white; border-color: var(--primary-color);
}

/* Card do Exame */
.exam-card { border: 1px solid rgba(0,0,0,0.05); }
.exam-img-wrapper { position: relative; overflow: hidden; }
.exam-img-wrapper img { transition: transform 0.5s ease; }
.exam-card:hover .exam-img-wrapper img { transform: scale(1.05); }

.exam-card-text-only {
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-color); /* Borda superior colorida */
}

.exam-card-text-only:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}

.exam-icon-header {
    background-color: var(--light-bg);
    padding: 2rem 1rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.exam-icon-circle {
    width: 60px;
    height: 60px;
    background-color: var(--primary-subtle, rgba(0, 203, 169, 0.15));
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Cores específicas por categoria (Opcional, mas fica legal) */
.cardiologicos .exam-card-text-only { border-top-color: #e74c3c; }
.cardiologicos .exam-icon-circle { color: #e74c3c; background-color: rgba(231, 76, 60, 0.1); }

.laboratoriais .exam-card-text-only { border-top-color: #3498db; }
.laboratoriais .exam-icon-circle { color: #3498db; background-color: rgba(52, 152, 219, 0.1); }
  

.footer-links a:hover, .footer-contact a:hover, .hover-primary:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

.floating-buttons-container {
    position: fixed;
    right: 0;
    bottom: 1%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1050; /* Fica acima de tudo, inclusive navbar */
    padding-right: 15px;
}

.btn-floating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: scale(1.05) translateX(-5px);
    color: #fff;
}

.btn-float-whatsapp {
    background-color: #25D366; /* Verde Oficial do WhatsApp */
}
.btn-float-whatsapp:hover { background-color: #1ebe57; }

.btn-float-exams {
    background-color: var(--secondary-color); /* Azul Escuro da Paleta */
}
.btn-float-exams:hover { background-color: #0a1f35; }

/* Ajuste pro mapa não quebrar o layout */
.map-wrapper iframe {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Estilos específicos do Contacto (Layout Centralizado) */
.contact-info-box {
    background-color: white;
    padding: 2.5rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    height: 100%;
    text-align: center;
    border-bottom: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}
.contact-info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}
.contact-icon {
    width: 70px; height: 70px;
    background-color: var(--primary-subtle);
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}
.map-container {
    background: #fff;
    padding: 10px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}
.map-container iframe {
    width: 100%;
    height: 450px;
    border-radius: 15px;
    border: none;
}


/* ================= ESTRUTURA E GALERIA (COMPLETO E CORRIGIDO) ================= */

/* 1. O container e a trilha do carrossel (Isso faltava no seu CSS) */
.gallery-wrapper {
    position: relative;
    padding: 0 15px;
}

.gallery-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px; 
}

.gallery-track::-webkit-scrollbar {
    height: 6px;
}
.gallery-track::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 10px;
}
.gallery-track::-webkit-scrollbar-thumb {
    background: var(--primary-color); 
    border-radius: 10px;
}

/* 2. Controle de quantas imagens aparecem por tela (Isso também faltava) */
.gallery-item-wrap {
    flex: 0 0 85%; /* Mobile: 1 imagem inteira + pedaço da próxima */
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .gallery-item-wrap { flex: 0 0 calc(50% - 10px); } /* Tablet: 2 imagens */
}
@media (min-width: 992px) {
    .gallery-item-wrap { flex: 0 0 calc(33.333% - 14px); } /* Desktop: 3 imagens */
}

/* 3. Botões de navegação (Setas) */
.gallery-nav-btn {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 10;
    background: white;
    border: none;
    border-radius: 50%;
    width: 45px; 
    height: 45px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-nav-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}
.gallery-prev { left: -10px; }
.gallery-next { right: -10px; }

@media (max-width: 767px) {
    .gallery-nav-btn { display: none; } /* Esconde as setas no celular */
}

/* 4. Estilos das fotos e efeito de hover */
.gallery-item {
    position: relative;
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}
.gallery-item img {
    width: 100%;
    height: 380px; /* Altura fixa boa para as fotos */
    object-fit: cover; 
    transition: transform 0.5s ease;
}
.gallery-item:hover img {
    transform: scale(1.08);
}
.gallery-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 203, 169, 0.85); /* Verde principal com opacidade */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
    color: white;
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
.gallery-overlay i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-overlay i {
    transform: translateY(0);
}
.gallery-overlay h5 {
    color: white;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-overlay h5 {
    transform: translateY(0);
}

/* ================= BLOG CARDS ================= */
.post-card {
    border: 1px solid rgba(0,0,0,0.05);
}
.post-card-img-wrapper {
    overflow: hidden;
}
.post-card-img-wrapper img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.post-card:hover .post-card-img-wrapper img {
    transform: scale(1.05);
}

/* ================= CORPO CLÍNICO ================= */

/* Transforma o card em flexbox para alinhar os botões sempre no fundo */
.doctor-card {
    display: flex;
    flex-direction: column;
}

/* O "mt-auto" aqui garante que qualquer espaço sobrando empurre o botão pra baixo */
.doctor-card .btn {
    margin-top: auto; 
}

/* Trava absoluta das dimensões do avatar */
.avatar-medico {
    width: 130px !important;
    height: 130px !important;
    min-width: 130px;
    min-height: 130px;
    border: 4px solid var(--primary-subtle);
    border-radius: 50%;
    margin: 0 auto 1rem auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg); 
}

/* Força a imagem a preencher o círculo exato de 130x130 sem amassar */
.avatar-medico img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
}

.avatar-medico i {
    font-size: 4.5rem; /* Ícone um pouquinho maior para preencher bem o círculo */
    color: #cbd5e1; 
}

/* Modal de Detalhes */
.modal-medico .modal-content {
    border-radius: 20px;
    border: none;
}
.modal-medico .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}
.modal-medico .info-box {
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
    :root { --section-spacing: 60px; }
    h2 { font-size: 1.75rem; }
    /*.floating-buttons-container {
                bottom: 20px;
                top: auto;
                transform: none;
                flex-direction: row;
                right: 50%;
                transform: translateX(50%);
                width: max-content;
                padding-right: 0;
            }
            .btn-floating span { display: none; } 
            .btn-floating { padding: 15px; border-radius: 50%; width: 55px; height: 55px; font-size: 1.5rem; }*/
}

@media (max-width: 767.98px) {
    .hero-slide {
        height: auto !important; 
        min-height: 450px !important;
        padding-top: 50px;
        padding-bottom: 50px;
        background-position: 70% center;
    }

    .hero-overlay {
        background: rgba(255, 255, 255, 0.85) !important;
    }

    .hero-title {
        font-size: 2.5rem !important;
    }
}

/* ================= AVISO DE COOKIES (LGPD) ================= */
.cookie-banner {
    position: fixed;
    bottom: -150%; /* Começa escondido para fora da tela */
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 4px solid var(--primary-color);
    padding: 15px 0;
    z-index: 9999; /* Fica acima de tudo, inclusive do botão do WhatsApp */
    transition: bottom 0.5s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08) !important;
}

/* Classe que o JavaScript adiciona para fazer o banner subir */
.cookie-banner.show {
    bottom: 0;
}

/* Ajuste no mobile para não ficar tão espremido */
@media (max-width: 767px) {
    .cookie-banner {
        padding: 20px 0;
        border-radius: 15px 15px 0 0; /* Arredonda as pontas de cima no celular */
    }
}

/* ================= BANNER PRINCIPAL: COMPORTAMENTO MOBILE (SOMENTE IMAGEM) ================= */
@media (max-width: 767.98px) {
    .hero-slide {
        /* Puxa a imagem mobile e faz ela cobrir o banner todo */
        background-image: var(--bg-mobile) !important;
        background-size: cover !important;
        background-position: center center !important;
        
        /* Ajuste a altura do banner mobile aqui (500px é um bom padrão) */
        min-height: 500px !important;
        height: auto !important;
        padding: 0 !important;
    }

    /* Reduz o tamanho e margem dos botões para não roubarem a cena no celular */
    .custom-hero-controls {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .hero-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}