.nav-toggle,
.nav-burger,
.nav-backdrop {
    display: none;
}


/* --------------------------------------------------------------------------
   1. TABLET  (até 1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {

    .card {
        width: min(100%, 400px);
    }

    .conteiner {
        width: min(100%, 620px);
    }

}


/* --------------------------------------------------------------------------
   2. CELULAR  (até 768px)  — o grosso da adaptação
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

    /* ---------------------------------------------------------------------
       2.1  BASE MOBILE
       --------------------------------------------------------------------- */

    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    body {
        overflow-x: hidden;
    }

    img,
    svg,
    video {
        max-width: 100%;
    }

    button,
    a,
    label,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }

    /* Alvos de toque com pelo menos 44px */
    .icon-side,
    .return-h,
    .btn-excluir,
    .notif-envelope,
    .denunciar,
    .envia,
    .enviar {
        min-width: 44px;
        min-height: 44px;
    }

    .toast-container {
        max-width: min(100%, 380px);
    }

    .aviso-modal,
    .toast {
        max-width: 100%;
    }

    /* ---------------------------------------------------------------------
       2.2  MENU HAMBÚRGUER
       A barra lateral vira uma gaveta que desliza da esquerda.
       Abre e fecha só com CSS (checkbox + label), sem JavaScript.
       --------------------------------------------------------------------- */

    .nav-burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        position: fixed;
        top: 12px;
        left: 12px;
        width: 46px;
        height: 46px;
        border-radius: 14px;
        background-color: #EFE7DD;
        border: 1px solid #E6DCC6;
        box-shadow: 0 4px 14px rgba(74, 64, 56, 0.12);
        cursor: pointer;
        z-index: 60;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-burger span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background-color: #4A4038;
        transition: transform 220ms ease, opacity 220ms ease;
    }

    /* Vira um "X" quando o menu está aberto */
    .nav-toggle:checked ~ .nav-burger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle:checked ~ .nav-burger span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle:checked ~ .nav-burger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 78px;
        right: 0;
        bottom: 0;
        background-color: rgba(74, 64, 56, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms ease;
        z-index: 50;
    }

    .nav-toggle:checked ~ .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* A gaveta lateral */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: 78px;
        z-index: 55;
        gap: 16px;
        padding: 14px 5px;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-100%);
        transition: transform 220ms ease;
        box-shadow: 4px 0 18px rgba(74, 64, 56, 0.18);
    }

    .nav-toggle:checked ~ .conteiner .sidebar {
        transform: translateX(0);
    }

    .top-icons > .config {
        margin: 10px 0;
    }

    .config button {
        margin: 4px 0;
    }

    /* ---------------------------------------------------------------------
       2.3  CONTEÚDO PRINCIPAL
       Abre espaço no topo para o botão do menu.
       --------------------------------------------------------------------- */

    .conteiner {
        flex-direction: column;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 66px 14px 40px;
    }

    .main {
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: 66px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .m-content {
        height: auto;
        min-height: calc(100vh - 66px);
        min-height: calc(100dvh - 66px);
        padding: 4px 12px 28px;
    }

    /* ---------------------------------------------------------------------
       2.4  CARD DO PET (feed)
       --------------------------------------------------------------------- */

    .card {
        width: 100%;
        max-width: 420px;
        border-radius: 24px;
    }

    .imagem,
    .imagem img {
        height: 240px;
    }

    .info > .nome-pet {
        font-size: 1.6rem;
    }

    .carac {
        margin-bottom: 28px;
    }

    .tags .tag {
        display: inline-block;
        margin: 4px;
        padding: 8px 12px;
    }

    .like-dislike {
        margin-top: 22px;
    }

    .icon-button-ld {
        width: 64px;
        height: 64px;
    }

    .icon-button-ld .led,
    .icon-button-ld .like {
        width: 40px;
        height: 40px;
    }

    /* ---------------------------------------------------------------------
       2.5  NOTIFICAÇÕES
       --------------------------------------------------------------------- */

    .topo {
        padding: 8px 0 14px;
    }

    .configure {
        max-width: 100%;
        margin: 0 auto;
    }

    .notif {
        gap: 10px;
        padding: 14px 10px;
    }

    .notif-texto span {
        font-size: 13px;
    }

    /* ---------------------------------------------------------------------
       2.6  CHATS — lista em cima, conversa embaixo
       --------------------------------------------------------------------- */

    .main-content {
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: 66px;
        overflow: visible;
    }

    .chats-sidebar {
        width: 100%;
        height: auto;
        max-height: 38vh;
        border-right: none;
        border-bottom: 1px solid #E6DCC6;
        flex-shrink: 0;
    }

    .chats-sidebar-h {
        padding: 14px 14px 6px;
    }

    .chat-box {
        flex: 1;
        min-height: 52vh;
        padding: 12px;
    }

    .chat-h > header {
        padding: 4px 2px;
    }

    .user-icon {
        width: 42px;
        height: 42px;
    }

    .user-name {
        font-size: 14px;
    }

    .msg-r {
        width: 100%;
        margin: 8px 0;
        padding: 10px;
    }

    .msg {
        max-width: 85%;
        font-size: 13px;
    }

    .box-f {
        padding: 8px 0 0;
        gap: 8px;
    }

    .msg-e {
        height: 44px;
        font-size: 13px;
    }

    .enviar {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* ---------------------------------------------------------------------
       2.7  FORMULÁRIOS (Adicionar Pet, Retirar Pet, Preferências, Senhas)
       --------------------------------------------------------------------- */
    
    .logo {
        font-size: 0.8em;
    }

    .logo-img {
        width: 120px;
    }

    .princip {
        width: 100%;
    }

    .opc {
        display: flex;
        flex-direction: row;
        width: 100%;
        flex-wrap: wrap;
        overflow-x: auto;
        align-items: center;
        text-align: center;
    }

    .input-s {
        margin: 5px 30px;
        padding: 5px;
        position: relative;
    }

    .prefe {
        font-size: 0.8em;
    }

    .topo {
        padding: 0 0 18px;
    }

    .linha {
        flex-wrap: wrap;
    }

    .inp,
    .desc,
    .desc:focus {
        width: 100%;
    }

    .linha select {
        width: 100%;
        min-width: 0;
    }

    /* Campos com fonte menor que 16px fazem o iOS dar zoom; corrige */
    .inp,
    .desc,
    .msg-e,
    input,
    select,
    textarea {
        font-size: max(16px, 1em);
    }

    .tipos {
        gap: 8px;
    }

    .tipo {
        padding: 14px 8px;
    }

    .pet-row {
        gap: 6px;
    }

    .pet-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .pet-item-icon {
        width: 40px;
        height: 40px;
    }

    .btn-excluir {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    /* Toggle grande do "Retirar Pet" cabe na linha */
    .toggle {
        --track-width: 118px;
        --track-height: 28px;
        --thumb-size: 24px;
        --track-fontsize: 9px;
        --text-pos: 8px;
    }

    /* Botão de salvar acomoda-se com folga sobre a tela */
    form.conteiner .salvar {
        position: sticky;
        bottom: 12px;
        z-index: 5;
    }

    /* ---------------------------------------------------------------------
       2.8  PÁGINAS DE CARD ÚNICO (Erro, Confirmar e-mail, Sobre, Ajuda)
       --------------------------------------------------------------------- */

    .configure {
        border-radius: 20px;
        padding: 22px 18px;
    }

    .tittle,
    .titulo .tittle {
        font-size: 18px;
    }

    .titulo .sub-tittle {
        font-size: 12.5px;
    }

    .salvar {
        width: 100%;
    }

    .sobre-foto {
        max-height: 360px;
        object-position: 50% 45%;
    }

    .sobre-p {
        font-size: 13px;
    }

    /* ---------------------------------------------------------------------
       2.9  LOGIN — painéis empilhados
       --------------------------------------------------------------------- */

    .content {
        width: 100%;
        min-height: 100vh;
        height: 100vh;
        height: 100dvh;
        min-height: 100dvh;
    }

    .formulario {
        width: 100%;
    }

    .label-input,
    .label-input input {
        width: 100%;
    }

    .label-input input {
        height: 42px;
    }

    .tittle-w,
    .tittle-s {
        font-size: 22px;
    }

    .tm {
        width: 100%;
        position: static !important;
        margin-top: 32px;
        margin-bottom: 24px;
        font-size: 16px;
    }
}


/* --------------------------------------------------------------------------
   3. CELULARES ESTREITOS  (até 400px)
   -------------------------------------------------------------------------- */

@media (max-width: 400px) {

    .m-content {
        padding: 4px 8px 24px;
    }

    .imagem,
    .imagem img {
        height: 190px;
    }

    .info > .nome-pet {
        font-size: 1.35rem;
    }

    .icon-button-ld {
        width: 56px;
        height: 56px;
    }

    .icon-button-ld .led,
    .icon-button-ld .like {
        width: 34px;
        height: 34px;
    }

    .card {
        border-radius: 20px;
    }

    .configure {
        padding: 18px 14px;
        border-radius: 18px;
    }

    .conteiner {
        padding-left: 10px;
        padding-right: 10px;
    }

    .toggle {
        --track-width: 104px;
        --track-height: 26px;
        --thumb-size: 22px;
        --track-fontsize: 8px;
    }

    .toast-container {
        padding: 12px;
    }

    .tm {
        width: 100%;
        position: static !important;
        margin-top: 32px;
        margin-bottom: 24px;
        font-size: 12px;
    }
}


/* --------------------------------------------------------------------------
   4. TELAS BAIXAS (celular na horizontal)
   -------------------------------------------------------------------------- */

@media (max-height: 520px) and (max-width: 900px) {

    .chats-sidebar {
        max-height: 45vh;
    }

    .m-content {
        padding-top: 8px;
    }

    .sidebar {
        gap: 8px;
        padding: 8px 5px;
    }

    .top-icons > .config {
        margin: 6px 0;
    }

    .tm {
        width: 100%;
        position: static !important;
        margin-top: 32px;
        margin-bottom: 24px;
        font-size: 12px;
    }
}