/**
 * SlimVida — mobile, touch e formulários
 * Carregar depois de shop.css / contacto.css / compra.css
 */

html {
  overflow-x: clip;
}

/* Espaço para botão flutuante + barra do sistema */
@media (max-width: 768px) {
  body:has(#contact-float) {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="product"] {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
  }

  body[data-page="compra"] .compra-submit {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* iOS Safari: inputs < 16px fazem zoom ao focar */
@media (max-width: 768px) {
  .compra-field input,
  .compra-field select,
  .contact-field input,
  .contact-field select,
  .contact-field textarea,
  #payment-form input:not([type="checkbox"]),
  #payment-form textarea {
    font-size: 16px !important;
    line-height: 1.35;
  }

  .compra-field input,
  .compra-field select,
  #payment-form input:not([type="checkbox"]) {
    min-height: 48px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .contact-field input,
  .contact-field select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
    height: auto;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
  }

  .contact-field textarea,
  #payment-form textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .contact-field textarea {
    min-height: 120px;
    padding: 10px 12px !important;
  }

  #payment-form textarea {
    min-height: 120px;
    padding: 12px 14px;
  }

  .compra-field select,
  .contact-field select {
    width: 100%;
    max-width: 100%;
  }

  .contact-form-card,
  .contact-form,
  .contact-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .compra-submit,
  .contact-submit,
  #payment-form .btn-primary,
  #payment-form .btn-secondary {
    min-height: 52px;
    font-size: 16px;
    touch-action: manipulation;
  }

  .checkbox-row,
  .compra-pickup__check,
  .account-option {
    min-height: 44px;
    align-items: flex-start;
    padding: 6px 0;
  }

  .checkbox-row input[type="checkbox"],
  .compra-pickup__check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    margin-top: 2px;
    flex-shrink: 0;
  }

  .checkbox-row span {
    padding-top: 2px;
  }
}

/* Barra de idiomas e botão flutuante — safe area */
@media (max-width: 768px) {
  .lang-bar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

@media (max-width: 520px) {
  .contact-float {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  body[data-page="product"] .contact-float {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* Rodapé: links mais fáceis de tocar */
@media (max-width: 520px) {
  .site-footer__links a {
    display: inline-block;
    padding: 8px 4px;
    min-height: 40px;
    line-height: 1.4;
  }

  .site-footer__contact-btn {
    min-height: 48px;
    padding: 12px 22px;
    justify-content: center;
  }
}
