/* ================================================================
   GLOBAL — MOBILE
   Complemento responsivo de global.css (todas as páginas).
   Carregado no HTML com media="(max-width: 900px)" — por isso as regras
   aqui NÃO ficam dentro de @media: o próprio <link> já filtra.
   Blocos na mesma ordem em que estavam no arquivo original.
   ================================================================ */

/* Utilitários de exibição */
.so-celular {
  display: flex;
}
.oculto-celular {
  display: inline;
  justify-content: space-between;
}

/* ---- .cabecalho ---- */
/* ---- Mobile: some com telefone, links e divisor ---- */
.cabecalho {
  transition:
    backdrop-filter 0.3s ease,
    background 0.3s ease;

  & .cabecalho__faixa {
    display: none;
  }
  & .cabecalho__navegacao {
    padding: 0.21rem 1.6rem;

    & .cabecalho__esquerda {
      & .logo {
        display: grid;
        place-content: center;
      }
    }
  }
  & .cabecalho__links,
  & .cabecalho__divisor,
  & .cabecalho__direita {
    display: none;
  }
}

.cabecalho__local {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.11rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mb-muted);
  white-space: nowrap;
}

.cabecalho__hamburguer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  background: none;
  border: 0;
  color: var(--mb-paper);
  cursor: pointer;
  & svg {
    width: 2.6rem;
    height: 2.6rem;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }
  & .linha {
    transition:
      transform 0.3s ease,
      opacity 0.2s ease;
    transform-origin: center;
    transform-box: fill-box;
  }

  /* Aberto: linhas de cima e de baixo cruzam, a do meio some */
  &[aria-expanded='true'] {
    & .linha--1 {
      transform: translateY(6px) rotate(45deg);
    }
    & .linha--2 {
      opacity: 0;
    }
    & .linha--3 {
      transform: translateY(-6px) rotate(-45deg);
    }
  }
}

.menu-celular {
  position: fixed;
  inset: 0;
  z-index: 99;
  padding: calc(var(--altura-cabecalho, 70px) + 32px) 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 3.3rem;
  overflow-y: auto;

  opacity: 0;
  visibility: hidden;
  transform: translatex(100%);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease,
    visibility 0.4s;

  background-color: rgb(15, 17, 22, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  & .menu-celular__links > *,
  & .menu-celular__redes,
  & .botao {
    opacity: 0;
    transform: translatey(12px);
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  &.menu-celular--aberto {
    opacity: 1;
    visibility: visible;
    transform: translatex(0);
    & .menu-celular__links > *,
    & .menu-celular__redes,
    & .botao {
      opacity: 1;
      transform: translatey(0);
    }

    /* Cascata: cada item da lista espera um pouco mais que o anterior */
    & .menu-celular__links > :nth-child(1) {
      transition-delay: 0.1s;
    }
    & .menu-celular__links > :nth-child(2) {
      transition-delay: 0.15s;
    }
    & .menu-celular__links > :nth-child(3) {
      transition-delay: 0.2s;
    }
    & .menu-celular__links > :nth-child(4) {
      transition-delay: 0.25s;
    }
    & .menu-celular__links > :nth-child(5) {
      transition-delay: 0.3s;
    }
    & .menu-celular__links > :nth-child(5) {
      transition-delay: 0.35s;
    }
    & .menu-celular__redes {
      transition-delay: 0.4s;
    }
    & .botao {
      transition-delay: 0.45s;
    }
  }
  & .menu-celular__links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }
  & .menu-celular__link {
    font-size: 1.92rem;
    color: var(--mb-muted);
    &.menu-celular__link--ativo {
      border-bottom: solid 1px var(--mb-vinho);
    }
  }
  & .menu-celular__redes {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 2.2rem;
  }

  & .botao {
    margin-top: auto;
  }
}

/* SUBMENU de produtos */

.submenu {
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 8px;
  margin-right: 0;

  & .submenu__seta {
    margin: 0;
    width: 3.2rem;
    height: 3.2rem;
    padding: 0;
    & svg {
      width: 2.5rem;
      height: 2.5rem;
      rotate: 90deg;
      margin-bottom: 0;
    }
    &[aria-expanded='true'] svg {
      rotate: 270deg; /* aberto: aponta para cima */
    }
  }

  & .submenu__lista {
    flex-basis: 100%;
    grid-template-columns: none;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
  }

  & .submenu__interno {
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    min-height: 0;
    padding: 0;
    padding-top: 0;
    transition:
      visibility 0.35s,
      padding-top 0.35s ease;

    &::after {
      display: none;
    }
  }
  & .submenu__seta[aria-expanded='true'] + .submenu__lista {
    grid-template-rows: 1fr; /* aberto: altura do conteúdo */

    & .submenu__interno {
      padding-top: 1.4rem;
    }
  }
}

/* Trava a rolagem da página enquanto o menu está aberto */
body.menu-aberto {
  overflow: hidden;
  & .botao-whatsapp {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  & .cabecalho {
    background-color: rgb(15, 17, 22, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
  }
}

/* ---- .rodape ---- */
.rodape {
  /* Footer */
  & .rodape__chamada {
    padding: 40px 20px;
  }
  & .rodape__chamada-grade {
    gap: 24px;
  }
  & .rodape__chamada-acoes,
  & .rodape__chamada-acoes .botao {
    width: 100%;
  }
  & .rodape__chamada-acoes .botao {
    padding: 1.8rem 2rem;
  }
  & .rodape__colunas {
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;

    & .rodape__coluna {
      display: flex;
      flex-direction: column;
      align-items: center;
      & ul {
        display: flex;
        justify-content: center;
        flex-flow: row wrap;

        & li {
          border-bottom: 1px solid var(--mb-bg-soft);
          box-shadow: 0 1rem 1rem 0 rgba(0, 0, 0, 0.2);
          padding: 0.55rem 1.6rem;
        }
      }
    }
  }
  & .rodape__sobre {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
  }
  & .rodape__base {
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    text-align: center;
    align-items: center;
  }
  & .rodape__sobre p {
    max-width: 80%;
  }
}

/* ---- .botao ---- */
.botao {
  &.botao--destaque {
    width: 100%;
    justify-content: center;
    text-align: center;
    padding: 1.02rem 2rem;
    font-size: 11.1px;
  }
}

/* ---- .titulo ---- */
.titulo {
  /* Header: regras mobile agora ficam aninhadas no bloco .cabecalho */
  /* Títulos globais */
  &.titulo--enorme {
    font-size: 44px;
  }
  &.titulo--grande {
    font-size: 32px;
  }
  &.titulo--medio {
    font-size: 26px;
  }
}

/* ---- .secao-cabecalho ---- */
.secao-cabecalho {
  /* Section head */
  & {
    margin-bottom: 32px;
  }
}
