/*
 * Responsive layer for the legacy desktop layout.
 * Desktop (>= 980px) remains controlled by global.css/base.css.
 */

#menu-mobile-toggle {
    display: none;
}

.home-banner-container {
    width: 1007px;
}

@media screen and (max-width: 979px) {
    html {
        height: auto;
        -webkit-text-size-adjust: 100%;
    }

    body {
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 100vh;
        height: auto;
    }

    body:before {
        display: none !important;
        content: none !important;
    }

    #tudo {
        flex: 1 0 auto;
        width: 100%;
        min-height: 0;
    }

    #principal {
        overflow: visible;
        padding-bottom: 0;
    }

    #rodape {
        position: static;
        flex: 0 0 auto;
        height: auto;
        margin-top: 0;
    }

    .tamanho-base {
        width: calc(100% - 48px);
        max-width: 980px;
        margin-right: auto;
        margin-left: auto;
    }

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

    /* Header */
    #topo {
        width: 100%;
        height: auto;
    }

    #topo .topo-principal {
        display: flex;
        align-items: center;
        justify-content: space-between;
        overflow: visible;
        padding: 18px 0;
    }

    #topo .topo-principal > a {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 526px;
    }

    #topo #logo-empresa {
        position: static;
        left: auto;
        display: block;
        width: 100%;
        height: auto;
        margin: 0;
    }

    .telefone-topo {
        flex: 0 0 196px;
        float: none;
        width: 196px;
        margin: 0 0 0 24px;
    }

    .topo-espacador {
        height: 0 !important;
    }

    /* Mobile navigation */
    .menu-container {
        position: relative;
    }

    .js #menu-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        width: 100%;
        padding: 13px 0;
        border: 0;
        background: transparent;
        color: #7a7a7a;
        font-family: 'helveticaneueltcom-thcn', Arial, sans-serif;
        font-size: 18px;
        line-height: 1;
        text-transform: uppercase;
        cursor: pointer;
    }

    .menu-mobile-icon {
        display: inline-block;
        width: 22px;
        margin-left: 8px;
    }

    .menu-mobile-icon i {
        display: block;
        height: 2px;
        margin: 4px 0;
        background: #7a7a7a;
    }

    #menu {
        position: static;
        width: 100%;
        padding: 0;
    }

    .js #menu {
        display: none;
    }

    .js #menu.menu-aberto {
        display: block;
    }

    #menu .tamanho-base {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    #menu ul,
    #menu li {
        width: 100%;
    }

    #menu li,
    #menu a {
        float: none;
    }

    #menu a,
    #menu li:last-child a {
        display: block;
        box-sizing: border-box;
        width: 100%;
        padding: 12px 0 !important;
        border-right: 0;
        border-bottom: 1px solid #dbd0c0;
    }

    #menu li:last-child a {
        border-bottom: 0;
    }

    #menu a:hover,
    #menu li .corrente {
        padding-left: 25px !important;
        background-position: 0 center;
    }

    /* Home banner */
    .home-banner-container {
        width: calc(100% - 48px);
    }

    #banner,
    #banner #view {
        width: 100%;
    }

    #banner #view {
        top: 0;
        left: 0;
        height: 100%;
    }

    #banner #view > a {
        display: block;
        width: 100% !important;
        height: 100% !important;
    }

    #banner #view > a img {
        display: block;
        width: 100%;
        height: 100%;
    }

    #banner-pager {
        bottom: 12px;
        left: 12px;
    }

    /* Common page columns: stack content before decorative/sidebar content. */
    .pagina-profissional,
    .pagina-procedimentos,
    .pagina-procedimento,
    .pagina-noticias,
    .pagina-noticia,
    .pagina-links,
    .pagina-contato {
        display: flex;
        flex-direction: column;
    }

    #profissional-box-left,
    #procedimentos-conteudo,
    #procedimentos-left,
    #procedimento-left,
    #noticias-artigos-left,
    #noticia-left,
    #links-left,
    #contato-left {
        order: 1;
        float: none;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
    }

    .profissional-box-right,
    #procedimentos-right,
    #procedimento-right,
    #noticias-artigos-right,
    #noticia-right,
    #links-right,
    #contato-right {
        order: 2;
        float: none;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 28px 0 0;
    }

    /* Professional */
    #profissional-box-left h1,
    #profissional-box-left p,
    .topicos {
        width: auto;
        max-width: none;
    }

    #profissional-box-left .crm-p {
        margin-left: 0;
    }

    .profissional-box-right img {
        display: block;
        margin: 0 auto;
    }

    /* Clinic gallery */
    #featured {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    #featured > a {
        order: 1;
        display: block;
        width: 100%;
    }

    #featured .ui-tabs-panel {
        float: none !important;
        width: 100%;
    }

    #featured .ui-tabs-panel img {
        display: block;
        width: 100%;
        height: auto;
    }

    #featured ul.ui-tabs-nav {
        order: 2;
        display: flex;
        float: none !important;
        width: 100%;
        margin-top: 14px;
        overflow: visible;
    }

    #featured ul.ui-tabs-nav li {
        flex: 1 1 0;
        padding: 0;
        margin: 0 12px 0 0;
    }

    #featured ul.ui-tabs-nav li:last-child {
        margin-right: 0;
    }

    #featured ul.ui-tabs-nav li img {
        display: block;
        width: 100%;
        height: auto;
    }

    #featured #nav-fragment-1 {
        display: none;
    }

    /* Procedures */
    #procedimentos-conteudo {
        float: none !important;
    }

    .procedimentos-box {
        float: none;
        box-sizing: border-box;
        width: 100%;
    }

    .procedimentos-box:hover {
        margin-left: 0;
    }

    #procedimentos-left .texto,
    .procedimentos-box p,
    #procedimento-left p {
        width: auto;
        max-width: none;
    }

    #procedimentos-right img,
    #procedimento-right > img,
    #noticias-artigos-right > img,
    #links-right img {
        display: block;
        margin-right: auto;
        margin-left: auto;
    }

    /* Search forms */
    #procedimento-right form,
    #noticias-artigos-right form,
    #noticia-right #noticias-artigos-right form {
        width: 100%;
        max-width: 445px;
        margin: 0 auto 20px;
    }

    #procedimento-right #text,
    #noticias-artigos-right #text,
    #noticia-right #noticias-artigos-right #text {
        float: none;
        box-sizing: border-box;
        width: 100%;
        height: 47px;
        padding: 10px 48px 10px 14px;
    }

    #procedimento-right #submit,
    #noticias-artigos-right #submit,
    #noticia-right #noticias-artigos-right #submit {
        top: 5px;
        right: 5px;
        float: none;
        width: 37px;
        height: 37px;
        padding: 0;
    }

    /* News */
    .noticias-box,
    #noticia-right .noticias-box {
        float: none;
        box-sizing: border-box;
        width: 100%;
    }

    .noticias-box:hover {
        margin-left: 0;
    }

    .noticias-box h2,
    .noticias-box p,
    #noticia-right .noticias-box h2,
    #noticia-right .noticias-box p,
    #noticia-left p {
        width: auto;
        max-width: none;
    }

    #noticia-right #noticias-left {
        float: none;
        width: 100%;
    }

    #noticia-left > a > img {
        display: block;
        max-width: 100%;
    }

    #noticia-left .fotos {
        display: flex;
        flex-wrap: wrap;
    }

    #noticia-left h2[style] {
        width: auto !important;
    }

    .mais-fotos {
        margin: 0 8px 8px 0;
    }

    /* Links */
    .topicos-links {
        width: auto;
    }

    #links-left a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Contact */
    #nome,
    #textarea {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .contato-inputs {
        box-sizing: border-box;
        width: calc(50% - 6px);
    }

    .estado.contato-inputs,
    .cidade.contato-inputs {
        display: none;
    }

    .botao-est,
    .botao-cid {
        position: static;
        float: none;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        margin: 0 0 12px;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .botao-est span,
    .botao-cid span {
        display: none;
    }

    #estado,
    #cidade {
        position: static;
        float: none;
        box-sizing: border-box;
        width: 100%;
        height: 55px;
        padding: 10px 15px;
        border: 0;
        border-radius: 20px;
        background: #ede8e0;
        color: #969695;
        font-family: Tahoma, sans-serif;
        font-size: 14px;
        opacity: 1;
    }

    .contato-select-clear {
        margin-top: 0 !important;
    }

    #contato-right iframe {
        display: block;
        width: 100%;
        height: 420px;
    }

    /* Footer */
    #rodape > .tamanho-base {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 0;
    }

    .endereco-rodape,
    .telefone-rodape,
    .rede,
    #prestige {
        float: none;
        margin: 0;
    }

    .endereco-rodape {
        flex: 0 1 275px;
    }

    .telefone-rodape {
        flex: 0 0 196px;
    }

    .rede {
        flex: 0 0 40px;
    }

    .rede:hover {
        margin-top: 0;
    }

    #prestige {
        flex: 0 0 59px;
    }
}

/* =========================================================
   TABLET INTERMEDIÁRIO (641px - 979px)
   ------------------------------------------------------------------
   O layout desktop original foi construído com floats e larguras fixas.
   Entre 641px e 979px os wrappers já viram uma coluna, mas os filhos dos
   cards ainda herdavam floats do desktop. Isso fazia a altura dos cards
   colapsar e permitia que imagem/texto de um item invadissem o próximo.

   Neste intervalo usamos grid apenas nos cards repetidos. Mobile <= 640px
   e desktop >= 980px continuam com seus comportamentos próprios.
   ========================================================= */
@media screen and (min-width: 641px) and (max-width: 979px) {

    /* Flex items precisam poder encolher de verdade. */
    .pagina-conteudo > * {
        min-width: 0;
    }

    /* -----------------------------------------------------
       PROCEDIMENTOS / PROCEDIMENTO
       ----------------------------------------------------- */

    .pagina-procedimentos,
    .pagina-procedimento {
        display: flex;
        flex-direction: column;
    }

    .pagina-procedimentos > #procedimentos-conteudo,
    .pagina-procedimento > #procedimento-left,
    .pagina-procedimento > #procedimentos-conteudo {
        order: 1;
    }

    .pagina-procedimentos > #procedimentos-right,
    .pagina-procedimento > #procedimento-right {
        order: 2;
    }

    .procedimentos-box {
        display: grid;
        grid-template-columns: 148px minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        column-gap: 18px;
        row-gap: 4px;
        align-items: start;

        float: none;
        box-sizing: border-box;
        width: 100%;
        min-height: 113px;
        padding: 10px 0;
        margin: 0;
    }

    .procedimentos-box:first-child {
        padding-top: 0;
    }

    .procedimentos-box:hover {
        margin-left: 0;
    }

    .procedimentos-box > img {
        grid-column: 1;
        grid-row: 1 / span 2;

        float: none;
        box-sizing: border-box;
        width: 148px;
        height: 92px;
        margin: 0;
    }

    .procedimentos-box > h2 {
        grid-column: 2;
        grid-row: 1;

        min-width: 0;
        margin: 0;
    }

    /* O markup legado possui um <br> entre título e resumo. No grid ele
       viraria um item próprio, portanto não deve participar do layout. */
    .procedimentos-box > br {
        display: none;
    }

    .procedimentos-box > .texto,
    .procedimentos-box > p.texto {
        grid-column: 2;
        grid-row: 2;

        float: none !important;
        width: auto !important;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    #procedimentos-conteudo #ver-todos {
        float: none;
        display: block;
        width: max-content;
        margin: 14px 0 0 auto;
    }

    /* -----------------------------------------------------
       NOTÍCIAS / NOTÍCIA
       ----------------------------------------------------- */

    .pagina-noticias,
    .pagina-noticia {
        display: flex;
        flex-direction: column;
    }

    .pagina-noticias > #noticias-artigos-left,
    .pagina-noticia > #noticia-left {
        order: 1;
    }

    .pagina-noticias > #noticias-artigos-right,
    .pagina-noticia > #noticia-right {
        order: 2;
    }

    .noticias-box,
    #noticia-right .noticias-box {
        display: grid;
        grid-template-columns: 65px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 4px;
        align-items: start;

        float: none;
        box-sizing: border-box;
        width: 100%;
        min-height: 84px;
        padding: 10px 0;
        margin: 0;
    }

    .noticias-box:first-child,
    #noticia-right .noticias-box:first-child {
        padding-top: 0;
    }

    .noticias-box:hover,
    #noticia-right .noticias-box:hover {
        margin-left: 0;
    }

    .noticias-box > .data-noticias,
    #noticia-right .noticias-box > .data-noticias {
        grid-column: 1;
        grid-row: 1 / span 2;

        float: none;
        width: 65px;
        height: 64px;
        margin: 0;
    }

    .data-noticias p,
    #noticia-right .data-noticias p {
        float: none;
        width: auto;
        max-width: none;
    }

    .noticias-box > h2,
    #noticia-right .noticias-box > h2 {
        grid-column: 2;
        grid-row: 1;

        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    .noticias-box > p.texto,
    #noticia-right .noticias-box > p.texto {
        grid-column: 2;
        grid-row: 2;

        float: none;
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 0;
    }

    #noticia-right > a {
        float: none;
        display: inline-block;
        margin-top: 12px;
    }
}

@media screen and (max-width: 640px) {
    .tamanho-base,
    .home-banner-container {
        width: calc(100% - 32px);
    }

    .texto {
        text-align: left;
    }

    .size-48,
    .size-46 {
        font-size: 34px;
    }

    .size-42 {
        font-size: 32px;
    }

    .size-38 {
        font-size: 30px;
    }

    .size-32 {
        font-size: 27px;
    }

    /* Header */
    #topo .topo-principal {
        flex-direction: column;
        padding: 14px 0;
    }

    #topo .topo-principal > a {
        flex: none;
        width: 100%;
        max-width: 360px;
    }

    .telefone-topo {
        flex: none;
        margin: 14px auto 0;
    }

    /* Banner */
    #banner-pager {
        bottom: 6px;
        left: 6px;
    }

    #banner-pager a {
        width: 10px;
        height: 10px;
        margin: 3px;
        border-width: 1px;
    }

    #banner-pager .activeSlide {
        border-width: 1px;
    }

    /* Procedure cards */
    .procedimentos-box img {
        float: none;
        display: block;
        margin: 0 0 12px;
    }

    #procedimentos-left .texto,
    .procedimentos-box p {
        float: none;
    }

    /* News cards */
    .noticias-box {
        padding-left: 0;
    }

    /* Contact */
    .contato-inputs {
        float: none !important;
        width: 100%;
        margin-bottom: 12px;
    }

    #contato-right iframe {
        height: 320px;
    }

    #submit {
        float: none;
    }

    /* Footer */
    #rodape > .tamanho-base {
        flex-direction: column;
        align-items: center;
    }

    #rodape > .tamanho-base > * + * {
        margin-top: 22px;
    }

    .endereco-rodape,
    .telefone-rodape {
        flex: none;
    }

    .endereco-rodape {
        width: 275px;
        max-width: 100%;
    }

    .telefone-rodape {
        width: 196px;
    }
}
