body {
    font-family: 'Merriweather', serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

/* Otimização de imagens */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    aspect-ratio: attr(width) / attr(height);
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
    color: #fff;
    padding: 10px 20px;
}

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

header .logo img {
    max-height: 250px;
    margin-right: 10px;
}

nav {
    margin-top: 10px;
    width: 100%;
}

nav ul {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    gap: 15px;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: #E5A841;
    text-decoration: none;
    transition: color 0.3s, transform 0.3s;
    font-size: 0.95rem;
    white-space: nowrap;
    padding: 5px 10px;
}

nav ul li a:hover {
    color: #fff;
    transform: scale(1.5);
}

.whatsapp-chat {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background-color: #fff;
    border-radius: 35%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    padding: 7px;
    z-index: 1000;
}

.whatsapp-chat a {
    color: #25D366;
    font-size: 3em;
}

.whatsapp-button {
    background-color: #25D366;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.whatsapp-button:hover {
    background-color: #128C7E;
}

.whatsapp-button span {
    display: inline-block;
    animation: pulsate 1s infinite;
}

@keyframes pulsate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.banners-rotativos {
    position: relative;
    overflow: hidden;
}

.banners-rotativos .banner img {
    width: 100%;
    height: auto;
}

.banner {
    display: none;
}

.banner img {
    width: 100%;
    height: auto;
}

.centralizado {
    padding: 20px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.centralizado h2 {
    color: #000;
    font-family: 'Merriweather', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.sobre-texto {
    text-align: justify;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    padding: 0 15px;
    max-width: 2000px;
    margin: 0 auto;
}

.sobre-texto p {
    margin-bottom: 20px;
    text-indent: 30px;
}

.sobre-texto p:first-of-type {
    text-indent: 0;
}

.imagens-clinica {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 30px 0;
}

.imagens-clinica img {
    width: 100px;
    height: auto;
    object-fit: contain;
    margin: 10px;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    border: 1px solid #ccc;
    border-radius: 15px;
    margin: 10px;
    padding: 15px;
    text-align: center;
    width: calc(25% - 20px);
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card img {
    width: 100%;
    height: 450px; /* Altura fixa para uniformidade */
    object-fit: cover; /* Preenchimento inteligente */
    border-radius: 10px 10px 0 0;
}

.card h3, .card h4, .card p {
    margin: 5px 0;
}

.veja-mais {
    background-color: #25D366;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-weight: bold;
    margin-top: auto;
}

.veja-mais:hover {
    background-color: #128C7E;
    transform: scale(1.05);
}

.veja-mais:active {
    background-color: #004080;
}

.especializacoes-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.especializacao {
    margin: 10px;
    text-align: center;
    font-size: 1.2em;
    transition: transform 0.3s;
}

.especializacao:hover {
    transform: scale(1.1);
}

.especializacao img {
    width: calc(12.5% - 10px);
}

.carousel {
    display: flex;
    overflow: auto;
    justify-content: center;
    margin-top: 20px;
}

.carousel img {
    width: 250px;
    margin: 10px;
    max-height: 200px;
    transition: transform 0.3s;
}

.carousel img:hover {
    transform: scale(1.1);
}

.compartilhar-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.compartilhar-container button {
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    margin: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.compartilhar-container button:hover {
    background-color: #128C7E;
}

footer {
    display: flex;
    flex-wrap: wrap;
    background: #000;
    color: #fff;
    padding: 20px;
    justify-content: center;
    gap: 20px;
}

footer p {
    text-align: center;
    font-size: 14px;
    color: #fff;
    margin-top: 20px;
    width: 100%;
}

.footer-section {
    flex: 1;
    margin: 10px;
    text-align: center;
    min-width: 250px;
}

.footer-logo {
    width: 100%;
    order: 1;
}

.footer-logo img {
    width: 350px;
    height: auto;
    max-width: 100%;
}

#map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    order: 3;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin-bottom: 15px;
    margin: 0 auto;
    display: block;
}

@media (max-width: 768px) {
    nav ul {
        flex-direction: row; /* Mantém itens em linha */
        overflow-x: auto; /* Adiciona scroll horizontal se necessário */
        justify-content: flex-start; /* Alinha à esquerda */
        white-space: nowrap; /* Impede quebra de linha */
        padding-bottom: 10px; /* Espaço para scroll */
    }

    .card {
        width: calc(50% - 20px);
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .especializacoes-container {
        flex-direction: column;
    }

    .whatsapp-chat {
        bottom: 20px;
        right: 10px;
    }

    footer {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        width: 100%;
        margin: 10px 0;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }

    .modal-image {
        margin: 0 auto;
        width: 100px;
        height: 100px;
    }

    #modalBio {
        font-size: 14px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%;
    }

    nav ul {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li {
        margin-left: 0;
        margin: 5px;
    }

    .especializacao {
        margin: 5px;
    }

    .carousel img {
        width: 200px;
    }

    .footer-logo img {
        width: 250px;
    }

    .modal-content {
        max-width: 80%; /* Largura do modal em dispositivos móveis */
        padding: 25px;
        line-height: 1.8;
    }

    .modal-image {
        width: 170px;
        height: 170px;
        object-fit: cover;
        object-position: center 5%;
        border: 3px solid #fff;
        margin-bottom: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .card {
        width: calc(33.33% - 20px);
    }
}