/* Polimento visual mobile do site público Perlatur.
   Foco: leitura, espaçamento, CTAs, cards, filtros e prevenção de overflow horizontal.
   Escopo ativado por /perlatur-mobile-polish.js para não interferir no painel admin. */

@media (max-width: 767px) {
  html.perlatur-public-mobile-polish,
  html.perlatur-public-mobile-polish body,
  html.perlatur-public-mobile-polish #root {
    max-width: 100%;
    overflow-x: hidden;
  }

  html.perlatur-public-mobile-polish body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
  }

  html.perlatur-public-mobile-polish .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Header público */
  html.perlatur-public-mobile-polish header[role="banner"] {
    padding: 0.7rem 0.75rem !important;
  }

  html.perlatur-public-mobile-polish header[role="banner"] > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html.perlatur-public-mobile-polish header[role="banner"] > div > div {
    min-height: 3.8rem !important;
    height: 3.8rem !important;
    border-radius: 1.35rem !important;
    padding: 0.45rem 0.55rem !important;
  }

  html.perlatur-public-mobile-polish header[role="banner"] img {
    max-width: 8.75rem !important;
    max-height: 2.35rem !important;
  }

  html.perlatur-public-mobile-polish header[role="banner"] button[aria-expanded] {
    width: 2.65rem !important;
    height: 2.65rem !important;
    border-radius: 1rem !important;
  }

  /* Drawer mobile */
  html.perlatur-public-mobile-polish [role="dialog"][aria-label*="Menu"] > div:last-child {
    width: min(92vw, 23.5rem) !important;
    max-width: 92vw !important;
    padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
  }

  html.perlatur-public-mobile-polish [role="dialog"][aria-label*="Menu"] nav a,
  html.perlatur-public-mobile-polish [role="dialog"][aria-label*="Menu"] nav button {
    min-height: 3.15rem;
  }

  /* Hero principal */
  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type {
    min-height: auto !important;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type .container {
    padding-top: 7.15rem !important;
    padding-bottom: 5rem !important;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type h1 {
    margin-bottom: 1rem !important;
    max-width: 11.5em;
    font-size: clamp(2.35rem, 12.4vw, 3.15rem) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.045em !important;
    text-wrap: balance;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type p {
    max-width: 23rem;
    margin-bottom: 1.35rem !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
    text-wrap: pretty;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type .flex.flex-wrap.gap-4 {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.8rem !important;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type .flex.flex-wrap.gap-4 button,
  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type .flex.flex-wrap.gap-4 a {
    width: 100% !important;
    justify-content: center !important;
    min-height: 3.1rem !important;
    border-radius: 1rem !important;
  }

  /* Barra de busca logo abaixo do hero */
  html.perlatur-public-mobile-polish section.relative.z-20 {
    margin-top: -1.6rem !important;
    padding-bottom: 0.25rem !important;
  }

  html.perlatur-public-mobile-polish section.relative.z-20 .rounded-2xl.bg-white {
    border-radius: 1.25rem !important;
    padding: 1rem !important;
  }

  html.perlatur-public-mobile-polish section.relative.z-20 input,
  html.perlatur-public-mobile-polish section.relative.z-20 button,
  html.perlatur-public-mobile-polish section.relative.z-20 [role="combobox"] {
    min-height: 3rem !important;
    height: 3rem !important;
    border-radius: 0.95rem !important;
    font-size: 1rem !important;
  }

  /* Seção de pacotes e filtros */
  html.perlatur-public-mobile-polish #packages {
    padding-top: 3.25rem !important;
    padding-bottom: 3.25rem !important;
  }

  html.perlatur-public-mobile-polish #packages .mb-12 {
    margin-bottom: 1.8rem !important;
  }

  html.perlatur-public-mobile-polish #packages .mb-12 h2 {
    font-size: clamp(1.9rem, 9vw, 2.35rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.035em !important;
    text-wrap: balance;
  }

  html.perlatur-public-mobile-polish #packages .mb-12 p {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  html.perlatur-public-mobile-polish #packages .mb-8.rounded-2xl {
    margin-bottom: 1.15rem !important;
    border-radius: 1.2rem !important;
    padding: 1rem !important;
  }

  html.perlatur-public-mobile-polish #packages .mb-8.rounded-2xl > .mb-4 {
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  html.perlatur-public-mobile-polish #packages .mb-8.rounded-2xl label {
    font-size: 0.86rem !important;
  }

  html.perlatur-public-mobile-polish #packages input,
  html.perlatur-public-mobile-polish #packages button,
  html.perlatur-public-mobile-polish #packages [role="combobox"] {
    min-height: 2.85rem;
    font-size: 1rem;
  }

  html.perlatur-public-mobile-polish #packages .grid.gap-6 {
    gap: 1rem !important;
  }

  html.perlatur-public-mobile-polish #packages .rounded-3xl {
    border-radius: 1.25rem !important;
  }

  html.perlatur-public-mobile-polish #packages .aspect-\[16\/10\] {
    aspect-ratio: 4 / 3 !important;
  }

  html.perlatur-public-mobile-polish #packages [class*="p-5"] {
    padding: 1rem !important;
  }

  html.perlatur-public-mobile-polish #packages h3 {
    font-size: 1.03rem !important;
    line-height: 1.22 !important;
  }

  html.perlatur-public-mobile-polish #packages .flex.items-center.gap-3.text-sm.text-gray-600 {
    align-items: flex-start !important;
    gap: 0.65rem !important;
  }

  html.perlatur-public-mobile-polish #packages .flex.items-end.justify-between.border-t {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 0.8rem !important;
  }

  html.perlatur-public-mobile-polish #packages .flex.items-end.justify-between.border-t button {
    width: 100% !important;
    min-height: 2.85rem !important;
    border-radius: 0.95rem !important;
  }

  html.perlatur-public-mobile-polish #packages .mt-10 button {
    width: 100% !important;
    border-radius: 1rem !important;
  }

  /* CTA de pacote personalizado */
  html.perlatur-public-mobile-polish #custom-package {
    padding-top: 3.75rem !important;
    padding-bottom: 3.75rem !important;
  }

  html.perlatur-public-mobile-polish #custom-package h2 {
    font-size: clamp(1.9rem, 9vw, 2.35rem) !important;
    line-height: 1.08 !important;
    text-wrap: balance;
  }

  html.perlatur-public-mobile-polish #custom-package p {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }

  html.perlatur-public-mobile-polish #custom-package a,
  html.perlatur-public-mobile-polish #custom-package button {
    width: 100% !important;
    justify-content: center !important;
    min-height: 3rem !important;
    border-radius: 1rem !important;
  }

  /* Cards institucionais e avaliações */
  html.perlatur-public-mobile-polish section.bg-white.py-20,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-16,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-20 {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  html.perlatur-public-mobile-polish section.bg-white.py-20 h2,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-16 h2,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-20 h2 {
    font-size: clamp(1.85rem, 8vw, 2.25rem) !important;
    line-height: 1.08 !important;
    text-wrap: balance;
  }

  html.perlatur-public-mobile-polish section.bg-white.py-20 .rounded-3xl,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-16 .rounded-3xl,
  html.perlatur-public-mobile-polish section.bg-gray-50.py-20 .rounded-3xl {
    border-radius: 1.25rem !important;
    padding: 1rem !important;
  }

  /* Formulários e CTAs públicos */
  html.perlatur-public-mobile-polish main form input,
  html.perlatur-public-mobile-polish main form textarea,
  html.perlatur-public-mobile-polish main form select,
  html.perlatur-public-mobile-polish main form button {
    font-size: 1rem !important;
  }

  html.perlatur-public-mobile-polish main a,
  html.perlatur-public-mobile-polish main button {
    touch-action: manipulation;
  }
}

@media (max-width: 390px) {
  html.perlatur-public-mobile-polish header[role="banner"] img {
    max-width: 7.85rem !important;
  }

  html.perlatur-public-mobile-polish .min-h-screen.bg-gray-50 > section.relative.overflow-hidden:first-of-type h1 {
    font-size: clamp(2.05rem, 11.6vw, 2.6rem) !important;
  }

  html.perlatur-public-mobile-polish #packages .flex.items-center.gap-3.text-sm.text-gray-600 {
    flex-direction: column !important;
  }
}
