/* =========================================================
   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;
}

/* =========================================================
   UNIVERSAL MOBILE TAP & BUTTON CLICKABILITY ENGINE
   Guarantees all buttons, links, inputs, and interactive
   elements respond instantly with zero delay and are never
   blocked by overlays, pseudo-elements, or bad touch-actions.
   ========================================================= */
button,
a,
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn,
.nav-btn,
.submit-btn,
.cta-btn1,
.cta-btn2,
.btn-primary,
.btn-secondary,
.btn-p,
.btn-s,
.btn-next,
.btn-back,
.pkg-btn,
.read-btn,
.filter-btn,
.hamburger,
.mob-close,
.mobile-close,
.wa,
.wa-float,
.back-top,
.aravali-chat-trigger,
.social-btn,
.job-apply-btn,
.coupon-apply-btn,
.area-step-btn,
.cqc-btn,
.csc-btn,
.svc-card,
.date-card,
.time-chip,
.pcat-btn,
.contact-form-wrap button,
#hSubmitBtn,
#submitAppBtn {
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(242, 101, 34, 0.2) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Preloader dismissal safety: once dismissed, never block touches */
#loader.veil-up,
#loader.hide {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* =========================================================
   UNIVERSAL MOBILE DRAWER / MENU VISIBILITY & ANIMATION
   Ensures hamburger toggles work instantaneously on all pages
   ========================================================= */
.mob-menu.open,
.mob-menu.active,
.mobile-menu.open,
.mobile-menu.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

.mob-menu:not(.open):not(.active),
.mobile-menu:not(.open):not(.active) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.mobile-nav-active {
  overflow: hidden !important;
  touch-action: manipulation !important;
}

.mob-menu a,
.mobile-menu a {
  padding: 12px 18px !important;
  font-size: 18px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  border-radius: 10px !important;
  transition: background 0.2s, color 0.2s !important;
}
.mob-menu a:active,
.mobile-menu a:active {
  background: rgba(242, 101, 34, 0.2) !important;
}

/* Close button on mobile menu */
.mob-close,
.mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 10001;
  transition: transform 0.2s, background 0.2s;
}
.mob-close:hover,
.mobile-close:hover {
  background: #F26522;
  transform: rotate(90deg);
}

/* 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 & CTAs - 48px minimum touch ergonomics */
  .submit-btn,
  .cta-btn1,
  .cta-btn2,
  .btn-primary,
  .btn-secondary,
  .btn-p,
  .btn-s,
  .btn-next,
  .btn-back,
  .pkg-btn,
  .read-btn,
  .filter-btn,
  .social-btn,
  .job-apply-btn,
  .coupon-apply-btn,
  .area-step-btn,
  .cqc-btn,
  .csc-btn,
  .contact-form-wrap button,
  #hSubmitBtn,
  #submitAppBtn {
    min-height: 48px !important;
    font-size: 15px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(242, 101, 34, 0.2) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }

  /* Button groups collapse to full-width stacked on mobile */
  .hero-btns,
  .cta-btns,
  .nav-btns,
  .s-btns,
  .res-btns {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 12px !important;
  }

  .hero-btns a,
  .hero-btns button,
  .cta-btns a,
  .cta-btns button,
  .nav-btns a,
  .nav-btns button {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !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 or page content */
  #aravali-chat-widget {
    bottom: 20px !important;
    right: 80px !important;
    pointer-events: none !important;
    z-index: 99999 !important;
  }
  .aravali-chat-trigger {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
  }
  .aravali-chat-window {
    width: calc(100vw - 24px) !important;
    right: 12px !important;
    bottom: 78px !important;
    max-height: 75vh !important;
    border-radius: 18px !important;
  }
  .aravali-chat-window:not(.open) {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  .aravali-chat-window.open {
    display: flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !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;
  }
}

/* =========================================================
   ADMIN DASHBOARD RESPONSIVE OFFCANVAS DRAWER & LAYOUT
   ========================================================= */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    z-index: 99999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    display: flex !important;
    box-shadow: 10px 0 35px rgba(0,0,0,0.5) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 16px 14px !important;
  }
  .topbar {
    padding: 12px 16px !important;
    gap: 12px !important;
  }
  .topbar-title h1 {
    font-size: 18px !important;
  }
  .topbar-title p {
    font-size: 11px !important;
  }
  .admin-mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #1e293b;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99998;
  }
  .admin-backdrop.active {
    display: block !important;
  }
  .table-responsive,
  .table-wrap,
  .overflow-table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* =========================================================
   LOGIN & ESTIMATOR MOBILE REFINEMENTS
   ========================================================= */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr !important;
    box-shadow: 4px 4px 0px var(--ink) !important;
    border-width: 2.5px !important;
    margin: 10px auto !important;
    width: 100% !important;
  }
  .visual-pane {
    border-right: none !important;
    border-bottom: 2.5px solid var(--ink) !important;
    padding: 24px 18px !important;
  }
  .form-pane {
    padding: 24px 18px !important;
  }
  .hero-txt h1 {
    font-size: clamp(2rem, 7.5vw, 2.6rem) !important;
  }
  .modal-card {
    max-width: 92vw !important;
    padding: 22px 16px !important;
    box-shadow: 4px 4px 0px var(--ink) !important;
  }
  .est-grid {
    grid-template-columns: 1fr !important;
  }
  .est-right, .result-panel {
    position: static !important;
    margin-top: 20px !important;
  }
  .svc-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .sub-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

