/* =========================================================
   ARAVALI HOMECARE - GLOBAL MOBILE RESPONSIVE OPTIMIZATIONS
   Ensures unified font sizes, comfortable tap targets,
   proper alignment, zero horizontal overflow, and no iOS zoom.
   ========================================================= */

/* Prevent iOS text inflation and horizontal window shake */
html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

/* Ensure all images and media are cleanly contained */
img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Base typography line height for readability */
body {
  line-height: 1.6;
}

/* Tablet & Mobile Navigation Breakpoint (<= 880px) */
@media (max-width: 880px) {
  .nav-links {
    display: none !important;
  }
  .hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 1001;
  }
  .navbar {
    padding: 12px 18px !important;
  }
  .logo-img, .nav-logo img, .f-logo img, .footer-logo-text img {
    max-height: 38px !important;
    width: auto !important;
  }
  .nav-btn {
    padding: 8px 16px !important;
    font-size: 12.5px !important;
  }
  .nav-account {
    width: 34px !important;
    height: 34px !important;
    font-size: 13px !important;
  }
  .mob-menu, .mobile-menu {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 80px 24px 40px !important;
    gap: 16px !important;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  /* Prevent iOS Safari / Chrome auto-zoom on inputs by enforcing 16px base font */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  /* Custom dropdown chevron */
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23F26522'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 15px 15px !important;
    padding-right: 38px !important;
    cursor: pointer;
  }

  /* Form layouts collapse to clean single-column */
  .form-row,
  .inp-row,
  .field-row,
  .form-grid-2,
  .form-grid-3,
  .row-2,
  .lp-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Form container card padding */
  .contact-form-wrap,
  .form-card,
  .contact-card,
  .contact-main,
  .newsletter,
  .login-card {
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }

  /* Action buttons - 48px minimum touch ergonomics */
  .submit-btn,
  .cta-btn1,
  .cta-btn2,
  .btn-next,
  .btn-back,
  .pkg-btn,
  .contact-form-wrap button,
  #hSubmitBtn,
  #submitAppBtn {
    min-height: 48px !important;
    font-size: 14.5px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Headings fluid scaling - prevents clipped words */
  h1,
  .hero h1,
  .hero-inner h1,
  .art-hero-content h1,
  .form-header h1 {
    font-size: clamp(24px, 6.8vw, 36px) !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
    letter-spacing: -0.3px !important;
  }

  h2,
  .section-h2,
  .s-h2,
  .sec-title h2,
  .cta-box h2,
  .cta-card h2,
  .newsletter h2 {
    font-size: clamp(21px, 5.8vw, 29px) !important;
    line-height: 1.3 !important;
  }

  h3,
  .pkg h3,
  .service-card h3,
  .blog-card h3,
  .award-card h3,
  .usp-card h3 {
    font-size: clamp(17px, 4.8vw, 21px) !important;
    line-height: 1.35 !important;
  }

  /* Descriptions & Lead text */
  p,
  .hero p,
  .sec-p,
  .s-p,
  .cta-box p,
  .sec-title p {
    font-size: 14px !important;
    line-height: 1.65 !important;
  }

  /* Hero buttons alignment */
  .hero-buttons,
  .cta-btns,
  .cta-card-btns,
  .s-btns {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .hero-buttons a,
  .cta-btns a,
  .cta-card-btns a,
  .s-btns a,
  .s-btns button {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 13px 20px !important;
  }

  /* Section padding normalization */
  .sec,
  .services,
  .about,
  .why,
  .testimonials,
  .faq,
  .sponsors,
  .estimator-preview,
  .contact,
  .stats {
    padding: 50px 18px !important;
  }

  /* Footers - single column stack */
  .f-grid,
  .footer-container,
  footer .f-grid,
  footer .footer-container {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 0 20px 36px !important;
    margin: 0 auto 30px !important;
  }
  .f-about p,
  .footer-about p {
    max-width: 100% !important;
  }
  .f-bot,
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    padding: 20px 18px !important;
  }
  .f-social,
  .footer-social {
    justify-content: flex-start !important;
  }

  /* Comparison table horizontal scrolling */
  .compare-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px !important;
  }
  table.compare {
    min-width: 480px !important;
  }

  /* Stats grid alignment */
  .stats-container,
  .s-grid,
  .hero-stats-strip,
  .proj-stats,
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .stat-box h2,
  .s-grid h2 {
    font-size: 30px !important;
  }

  /* Horizontal Filter and Tab bars */
  .filter-bar,
  .section-tabs,
  .policies-nav,
  .cp-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 8px !important;
    padding: 4px 2px 8px 2px !important;
    margin-bottom: 20px !important;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar,
  .section-tabs::-webkit-scrollbar,
  .policies-nav::-webkit-scrollbar {
    display: none;
  }
  .filter-btn,
  .sec-tab,
  .policies-nav-btn {
    flex-shrink: 0 !important;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    white-space: nowrap !important;
  }

  /* Blog and Card grids */
  .blog-grid,
  .packages-grid,
  .services-grid,
  .benefits-grid,
  .awards-grid,
  .process-timeline,
  .before-after,
  .grid-2,
  .founder-wrap,
  .contact-cards,
  .contact-main {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .founder-main-img {
    height: 320px !important;
    border-radius: 20px !important;
  }
  .ba-card img {
    height: 220px !important;
  }

  /* Modals on mobile */
  .modal-box,
  .modal-content,
  .swal2-popup {
    max-width: 92vw !important;
    padding: 22px 18px !important;
    border-radius: 18px !important;
    margin: 16px auto !important;
  }

  /* Chatbot widget mobile ergonomics - prevents covering WhatsApp button */
  #aravali-chat-widget {
    bottom: 20px !important;
    right: 80px !important;
  }
  .aravali-chat-trigger {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
  .aravali-chat-window {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    bottom: 78px !important;
    max-height: 75vh !important;
    border-radius: 18px !important;
  }

  /* Floating WhatsApp button clean sizing and positioning */
  .wa,
  .wa-float {
    bottom: 20px !important;
    right: 18px !important;
    left: auto !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    z-index: 9999 !important;
  }
  .btt,
  .back-top {
    bottom: 80px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 15px !important;
  }
}

/* Extra small phones (<= 400px) */
@media (max-width: 400px) {
  .stats-container,
  .s-grid,
  .hero-stats-strip,
  .proj-stats,
  .stats-row {
    grid-template-columns: 1fr !important;
  }
  .sec, .services, .about, .why, .contact {
    padding: 40px 14px !important;
  }
  .navbar {
    padding: 10px 14px !important;
  }
  .logo-img, .nav-logo img {
    max-height: 32px !important;
  }
}
