/* ==========================================================
   MAHAU — FIX TECLADO MOBILE / PWA
   ========================================================== */

:root{
  --mahau-visual-height:100dvh;
  --mahau-visual-offset-top:0px;
}

/* Evita zoom/falha de foco em Safari/iOS e melhora WebView/PWA Android. */
@media (max-width: 900px){
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  textarea,
  select{
    font-size:16px !important;
    line-height:1.35;
    touch-action:manipulation;
    -webkit-user-select:text;
    user-select:text;
    -webkit-tap-highlight-color:rgba(255,255,255,.06);
    caret-color:auto;
  }

  textarea{
    resize:vertical;
  }

  input,
  textarea,
  select,
  [contenteditable="true"]{
    scroll-margin-top:96px;
    scroll-margin-bottom:180px;
  }
}

/* Em modo instalado, deixa o documento acompanhar a viewport útil
   quando o teclado virtual reduz a área visível. */
html.mahau-standalone,
html.mahau-standalone body{
  min-height:100%;
}

html.mahau-standalone body{
  min-height:var(--mahau-visual-height);
}

/* Não deixa overlays decorativos capturarem toque sobre campos. */
html.mahau-input-focused .hero-overlay,
html.mahau-input-focused .seasonal-particles,
html.mahau-input-focused .mahau-seasonal-particles{
  pointer-events:none !important;
}

/* Ajuda páginas com cabeçalho sticky/fixed a não esconder o input focado. */
html.mahau-keyboard-open input:focus,
html.mahau-keyboard-open textarea:focus,
html.mahau-keyboard-open select:focus{
  position:relative;
  z-index:5;
}

/* ===== MAHAU PWA COMPACT v1 ===== */
/*
   Densidade compacta SOMENTE no app instalado (standalone) e telas pequenas.
   Não altera desktop nem o site aberto normalmente no navegador.
*/
@media (max-width: 600px) {
  html.mahau-standalone .raffle-modal-backdrop {
    align-items: flex-start;
    padding:
      max(8px, env(safe-area-inset-top))
      8px
      max(8px, env(safe-area-inset-bottom));
  }

  html.mahau-standalone .raffle-modal {
    width: 100%;
    max-height: calc(var(--mahau-visual-height, 100dvh) - 16px);
    padding: 18px 16px;
    border-radius: 20px;
    overscroll-behavior: contain;
  }

  html.mahau-standalone .raffle-modal-header {
    gap: 12px;
    margin-bottom: 14px;
  }

  html.mahau-standalone .raffle-modal-header .eyebrow {
    font-size: 9px;
    letter-spacing: .14em;
  }

  html.mahau-standalone .raffle-modal-header h2 {
    margin-top: 4px;
    font-size: 19px;
    line-height: 1.08;
    letter-spacing: -1px;
  }

  html.mahau-standalone .raffle-modal-header button {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    font-size: 13px;
  }

  html.mahau-standalone .raffle-form-grid {
    gap: 6px;
  }

  html.mahau-standalone .raffle-field label {
    margin: 5px 0 4px;
    font-size: 9px;
    line-height: 1.2;
  }

  /* 16px é mantido para evitar zoom automático do Safari/iOS. */
  html.mahau-standalone .raffle-field input {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 16px !important;
    line-height: 1.2;
  }

  html.mahau-standalone .raffle-field small {
    min-height: 8px;
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.15;
  }

  html.mahau-standalone .quantity-box {
    margin-top: 12px;
  }

  html.mahau-standalone .quantity-box > span {
    margin-bottom: 6px;
    font-size: 9px;
  }

  html.mahau-standalone .quantity-options {
    gap: 6px;
  }

  html.mahau-standalone .quantity-options button {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 12px;
  }

  html.mahau-standalone .raffle-consent {
    margin-top: 12px;
    gap: 7px;
    font-size: 9px;
    line-height: 1.35;
  }

  html.mahau-standalone .raffle-consent input {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
  }

  html.mahau-standalone .raffle-submit {
    min-height: 42px;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 12px;
  }

  html.mahau-standalone .raffle-form-message {
    min-height: 12px;
    margin-top: 6px;
    font-size: 10px;
  }

  html.mahau-standalone .paid-summary {
    margin-top: 10px;
    padding: 11px;
    border-radius: 10px;
  }

  html.mahau-standalone .paid-summary strong {
    margin: 2px 0;
    font-size: 20px;
  }

  /* Navegação do PWA um pouco mais compacta também. */
  html.mahau-standalone body {
    padding-top: 56px !important;
    padding-bottom: 68px !important;
  }

  html.mahau-standalone .mahau-customer-mobile-top {
    height: 56px;
    grid-template-columns: 38px 1fr 38px;
    gap: 7px;
    padding: 0 8px;
  }

  html.mahau-standalone .mahau-customer-mobile-menu,
  html.mahau-standalone .mahau-customer-mobile-home {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: .92rem;
  }

  html.mahau-standalone .mahau-customer-mobile-brand img {
    width: 29px;
    height: 29px;
  }

  html.mahau-standalone .mahau-customer-mobile-brand small {
    font-size: .47rem;
  }

  html.mahau-standalone .mahau-customer-mobile-brand strong {
    font-size: .72rem;
  }

  html.mahau-standalone .mahau-customer-mobile-bottom {
    min-height: 62px;
  }

  /* Enquanto o teclado estiver aberto, aproveita ainda mais a área útil. */
  html.mahau-standalone.mahau-keyboard-open .raffle-modal-backdrop {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  html.mahau-standalone.mahau-keyboard-open .raffle-modal {
    max-height: calc(var(--mahau-visual-height, 100dvh) - 8px);
    border-radius: 16px;
  }
}
/* ===== /MAHAU PWA COMPACT v1 ===== */
