/* ══════════════════════════════════════════════════════
   MONTEBELLO MOBILE EXPRESS SYSTEM — MOBILE-ONLY STYLES
   Este arquivo aplica-se exclusivamente a telas < 768px.
   ══════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* Prevent horizontal overflow and enable smooth native rubber-banding */
  html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* Safe Area & App feel */
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 16px)) !important;
  }

  body.pwa-mode {
    background: #ffffff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Hide default floating WhatsApp as bottom navigation is used instead */
  .whatsapp-float {
    display: none !important;
  }

  /* Optimize button touches */
  button, a {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }

  /* Inputs optimized for mobile keyboard */
  input, select, textarea {
    font-size: 16px !important; /* Prevents iOS auto-zoom on focus */
    min-height: 48px;
    padding: 12px 16px !important;
    border-radius: 12px !important;
  }

  /* Header adjustments in Standalone PWA mode */
  body.pwa-mode .header {
    background: rgba(255, 255, 255, 0.98);
    position: sticky;
    top: 0;
    padding-top: calc(env(safe-area-inset-top, 12px) + 6px) !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  }

  /* Custom modal layout alignment and scroll safety */
  .pwa-modal-box {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    margin: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 32px !important;
    border-top-right-radius: 32px !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.15) !important;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  /* Scroll locking when modal is open */
  body.modal-open-lock {
    overflow: hidden !important;
    height: 100vh !important;
    height: 100dvh !important;
    position: fixed !important;
    width: 100% !important;
  }

  /* Better spacing for mobile display categories / product sections */
  .section-padding-mobile {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
  }
}
