/*
  Responsividade do site (tablet e celular).
  Carregado por último: só sobrescreve o layout de desktop de styles.css e
  forms.css. Pontos de quebra: 960px (tablet) e 640px (celular).
*/
body {
  min-width: 0;
}

/* O botão do menu só aparece no tablet e no celular */
.menu-toggle {
  display: none;
}

/* ================= Tablet (até 960px) ================= */
@media (max-width: 960px) {
  .container {
    width: calc(100% - 64px);
  }
  .section {
    padding-block: 76px;
  }
  .section-heading {
    margin-bottom: 40px;
  }

  /* ---------- Header com menu ---------- */
  .header-inner {
    width: calc(100% - 64px);
    flex-wrap: wrap;
    gap: 0;
  }
  /* Ordem: logo e botão na primeira linha, menu embaixo */
  .header .brand {
    order: 1;
  }
  .header .menu-toggle {
    order: 2;
  }
  .header nav {
    order: 3;
  }
  .header .utilities {
    order: 4;
  }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 1px solid #ffffff44;
    border-radius: 4px;
    color: white;
    background: transparent;
  }
  .menu-toggle .icon {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
  }
  /* Ícone: as três linhas viram um X */
  .menu-line {
    transform-box: fill-box;
    transform-origin: center;
    transition:
      transform 0.3s ease,
      opacity 0.2s ease;
  }
  .header.is-open .menu-line-1 {
    transform: translateY(5px) rotate(45deg);
  }
  .header.is-open .menu-line-2 {
    opacity: 0;
    transform: scaleX(0);
  }
  .header.is-open .menu-line-3 {
    transform: translateY(-5px) rotate(-45deg);
  }

  /* Lista do menu: fica recolhida e desliza ao abrir */
  .header nav,
  .header .utilities {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      visibility 0s linear 0.35s;
  }
  .header.is-open nav,
  .header.is-open .utilities {
    max-height: 320px;
    opacity: 1;
    visibility: visible;
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease 0.05s,
      visibility 0s;
  }
  .header.is-open {
    background: var(--navy);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 16px 40px #0c1a3059;
  }
  .header nav {
    border-top: 1px solid transparent;
  }
  .header.is-open nav {
    margin-top: 12px;
    border-top-color: #ffffff1f;
  }
  .header nav a,
  .header .utilities a {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0;
    font-size: 1rem;
    border-bottom: 1px solid #ffffff1f;
    text-shadow: none;
  }
  .header.is-open .utilities {
    padding-bottom: 20px;
  }
  .header .tracking-link {
    border-left: 0;
    padding-left: 0;
    color: var(--cyan);
  }

  /* ---------- Hero ---------- */
  .hero {
    min-height: 640px;
  }
  .hero-content {
    padding-block: 140px 72px;
  }

  /* ---------- Faixa de rastreio ---------- */
  .tracking-inner {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 16px 24px;
  }
  .tracking-copy {
    flex: 1 1 320px;
    text-align: left;
  }

  /* ---------- Soluções ---------- */
  .benefits-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }
  .benefit-item,
  .benefit-item:first-child,
  .benefit-item:last-child {
    padding: 20px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .benefit-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
  .benefit-item:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .service-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-inline: auto;
  }
  .delivery-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 28px;
  }
  .delivery-grid article:nth-child(2n) {
    border-right: 0;
  }

  /* ---------- Jornada ---------- */
  .journey-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .journey-card,
  .journey-2,
  .journey-3 {
    grid-column: span 1;
    height: 380px;
  }
  .journey-copy {
    padding: 24px;
  }
  .journey-copy h3 {
    font-size: 1.4rem;
  }
  .journey-proof {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .journey-proof > p {
    grid-column: 1 / -1;
  }
  .journey-proof > div:first-of-type {
    border-left: 0;
    padding-left: 0;
  }

  /* ---------- Parceiros ---------- */
  .partners-section {
    padding-block: 72px 32px;
  }
  .partners-heading h2 {
    font-size: 2rem;
  }

  /* ---------- Rede ---------- */
  .network-layout {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-block: 64px;
  }
  .network-copy h2 {
    font-size: 2.8rem;
  }
  .network-visual {
    max-width: 520px;
    margin-inline: auto;
  }

  /* ---------- Franquia ---------- */
  .franchise-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  /* ---------- FAQ ---------- */
  .faq {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  /* ---------- Contato (home) ---------- */
  .contact-banner {
    min-height: 0;
    padding: 260px 0 48px;
    align-items: flex-end;
  }
  .contact-panel {
    width: min(480px, 100%);
  }
  .contact-details {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  /* ---------- Rodapé ---------- */
  .footer-main {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 36px 24px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }

  /* ---------- Modais ---------- */
  .site-modal,
  .site-modal-wide {
    width: min(640px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
  }
  .modal-shell {
    grid-template-columns: 1fr;
  }
  .modal-panel {
    padding: 36px 32px 28px;
  }
  .modal-panel h2 {
    font-size: 1.8rem;
    padding-right: 48px;
  }
  .modal-route {
    display: none;
  }
  .modal-contacts {
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
  }
  .modal-form {
    padding: 32px;
  }
  /* No modal empilhado, a caixa de mensagem volta à altura normal */
  .modal-form[data-form='franqueado'] .form-grid {
    grid-template-rows: none;
  }
  .modal-form[data-form='franqueado'] textarea {
    height: 120px;
  }
  /* Franquia no tablet: foto em cima, contatos no azul, formulário embaixo */
  .site-modal-franchise .modal-shell {
    grid-template-columns: 1fr;
  }
  .modal-cover {
    height: 240px;
  }
  .form-title.modal-form-title {
    font-size: 1.75rem;
    padding-right: 0;
  }
  .site-modal-franchise .modal-panel {
    padding: 4px 32px 24px;
  }
  .site-modal-franchise .modal-panel-title {
    display: none;
  }
  .site-modal-franchise .modal-form {
    padding: 32px;
  }
  .site-modal-franchise .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .site-modal-franchise .form-grid > .field:first-child {
    grid-column: 1 / -1;
  }
  .site-modal-franchise .form-footer {
    grid-template-columns: 1fr 1fr;
  }
  .site-modal-franchise .form-footer .button-outline {
    grid-column: 1;
  }
  .site-modal-franchise .form-footer .button-navy {
    grid-column: 2;
  }
  /* O X fica sobre o painel azul */
  .modal-close {
    color: white;
  }
  .modal-close:hover {
    background: #ffffff1f;
  }

  /* ---------- Página de contato ---------- */
  .page-hero {
    padding: 150px 0 130px;
  }
  .hero-route {
    width: 70vw;
    opacity: 0.6;
  }
  .contact-page {
    padding-bottom: 64px;
  }
  .contact-page-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .channels {
    padding-top: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }
  .channel,
  .channel:first-child {
    padding-top: 24px;
  }
  .channel:last-child {
    border-bottom: 1px solid var(--line);
  }
  .contact-map {
    height: auto;
  }
  .contact-map iframe {
    position: static;
    display: block;
    height: 340px;
  }
  .contact-map .container {
    display: block;
    height: auto;
    padding-block: 0 48px;
  }
  .map-card {
    width: 100%;
    margin-top: -48px;
    position: relative;
  }
}

/* ================= Só tablet (641px a 960px) ================= */
@media (min-width: 641px) and (max-width: 960px) {
  .hero h1 {
    font-size: 2.6rem;
  }
  /* Cartões de serviço mais baixos: ícone à esquerda, texto à direita */
  .service-grid {
    max-width: none;
    gap: 16px;
  }
  .service-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    column-gap: 28px;
    align-items: center;
    padding: 28px 32px;
    text-align: left;
  }
  .service-icon {
    grid-row: span 2;
    width: 96px;
    height: 96px;
    margin: 0;
  }
  .service-card h3 {
    align-self: end;
  }
  .service-card p {
    align-self: start;
    margin-top: 6px;
  }
}

/* ================= Celular (até 640px) ================= */
@media (max-width: 640px) {
  .container,
  .header-inner {
    width: calc(100% - 32px);
  }
  .section {
    padding-block: 60px;
  }
  .brand,
  .footer-brand {
    flex-basis: auto;
  }
  .brand img,
  .footer-brand img {
    width: 124px;
  }
  .header-inner {
    min-height: 72px;
    padding-block: 10px;
  }

  /* ---------- Hero ---------- */
  .hero {
    min-height: 600px;
  }
  .hero-content {
    padding-block: 120px 56px;
  }
  .hero h1 {
    font-size: clamp(2.1rem, 9vw, 2.6rem);
  }
  .hero p {
    font-size: 1rem;
  }
  /* Texto ocupa a largura toda: escurece a foto inteira para dar contraste */
  .hero .hero-gradient {
    background: linear-gradient(180deg, rgba(26, 52, 93, 0.55) 0%, rgba(26, 52, 93, 0.88) 70%);
  }
  .hero .button {
    width: 100%;
  }

  /* ---------- Faixa de rastreio ---------- */
  .package-stage {
    display: none;
  }
  .tracking-copy {
    text-align: center;
  }
  .tracking-inner .button {
    width: 100%;
  }

  /* ---------- Soluções ---------- */
  .solutions:before {
    display: none;
  }
  .benefits-strip {
    grid-template-columns: 1fr;
  }
  .benefit-item:nth-child(odd) {
    border-right: 0;
  }
  .benefit-item:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }
  .service-card {
    padding: 32px 22px;
  }
  .delivery-grid article {
    padding-inline: 10px;
  }
  .delivery-bottom .button {
    width: 100%;
  }

  /* ---------- Jornada ---------- */
  .journey-grid {
    grid-template-columns: 1fr;
  }
  .journey-card,
  .journey-2,
  .journey-3 {
    height: 340px;
  }
  .journey-proof {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .journey-proof > div,
  .journey-proof > div:first-of-type {
    border-left: 0;
    padding-left: 0;
    padding-top: 24px;
    border-top: 1px solid #ffffff33;
  }

  /* ---------- Parceiros ---------- */
  .partners-heading h2 {
    font-size: 1.7rem;
  }
  .partner-group {
    gap: 40px;
    padding-right: 40px;
  }
  .partner-logo,
  .partner-logo img {
    width: 120px;
  }

  /* ---------- Rede ---------- */
  .network-copy h2 {
    font-size: 2.3rem;
  }
  .network-copy .button,
  .franchise .button {
    width: 100%;
  }

  /* ---------- Contato (home) ---------- */
  .contact-banner {
    padding-top: 220px;
  }
  .contact-panel {
    padding: 36px 24px 40px;
  }
  .contact-panel h2 {
    font-size: 2rem;
  }
  .contact-panel .button {
    width: 100%;
    min-width: 0;
  }
  .contact-details {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* ---------- Rodapé ---------- */
  .footer-main {
    grid-template-columns: 1fr 1fr;
  }
  .security-note {
    align-items: flex-start;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
  }

  /* ---------- Formulários ---------- */
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field-wide {
    grid-column: auto;
  }
  /* Botões empilhados, com o de envio primeiro */
  .form-footer {
    grid-template-columns: 1fr;
  }
  .form-footer .button-navy {
    order: 1;
  }
  .form-footer .button-outline {
    order: 2;
  }
  .form-footer button:only-of-type {
    grid-column: auto;
  }

  /* ---------- Modais ---------- */
  .site-modal,
  .site-modal-wide {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
  .modal-panel {
    padding: 28px 20px 22px;
  }
  .modal-panel h2 {
    font-size: 1.6rem;
  }
  .modal-panel > p {
    margin-top: 10px;
    font-size: 0.8125rem;
  }
  .modal-cover {
    height: 180px;
  }
  .form-title.modal-form-title {
    font-size: 1.55rem;
  }
  .form-lead {
    font-size: 0.875rem;
  }
  /* Sem contatos, o painel azul de franquia fica vazio */
  .site-modal-franchise .modal-panel {
    display: none;
  }
  .site-modal-franchise .modal-form {
    padding: 24px 20px;
  }
  .site-modal-franchise .form-grid,
  .site-modal-franchise .form-footer {
    grid-template-columns: 1fr;
  }
  .site-modal-franchise .form-grid > .field:first-child,
  .site-modal-franchise .form-footer .button-outline,
  .site-modal-franchise .form-footer .button-navy {
    grid-column: auto;
  }
  /* No celular, os contatos saem do modal para o formulário caber */
  .modal-contacts {
    display: none;
  }
  .modal-form {
    padding: 24px 20px;
  }
  .file-text strong {
    white-space: normal;
  }

  /* ---------- Página de contato ---------- */
  .page-hero {
    padding: 120px 0 110px;
  }
  .page-hero h1 {
    font-size: 2.4rem;
  }
  .page-hero p {
    font-size: 1rem;
  }
  .hero-route {
    top: auto;
    bottom: 0;
    right: -40px;
    width: 120vw;
    opacity: 0.35;
  }
  .contact-card {
    margin-top: -72px;
    padding: 28px 20px;
  }
  .contact-card > h2 {
    font-size: 1.5rem;
  }
  .channels {
    grid-template-columns: 1fr;
  }
  .contact-map iframe {
    height: 280px;
  }
}

/* Quem pediu menos movimento no sistema vê as trocas sem animação */
@media (prefers-reduced-motion: reduce) {
  .menu-line,
  .header nav,
  .header .utilities {
    transition: none !important;
  }
}

/* ================= Primeira dobra =================
   A hero cresce para que ela e a faixa de rastreio encham a tela.
   Assim a seção branca seguinte não aparece como uma faixa embaixo
   em telas altas. 123px e 186px são as alturas da faixa de rastreio,
   arredondadas para baixo para não sobrar nem um fio branco. */
.hero {
  min-height: max(746px, calc(100svh - 123px));
}
@media (min-width: 1600px) {
  .hero {
    min-height: max(810px, calc(100svh - 123px));
  }
}
@media (max-width: 1100px) {
  .hero {
    min-height: max(680px, calc(100svh - 123px));
  }
}
@media (max-width: 960px) {
  .hero {
    min-height: max(640px, calc(100svh - 123px));
  }
}
@media (max-width: 700px) {
  .hero {
    min-height: max(640px, calc(100svh - 186px));
  }
}
@media (max-width: 640px) {
  .hero {
    min-height: max(600px, calc(100svh - 186px));
  }
}
