/* ====================================================================
   VSAA — MOBILE & TABLET RESPONSIVE SYSTEM
   Breakpoints: 1100px (tablet-lg) | 820px (tablet) | 600px (mobile) | 400px (xs)
   V-SAT Solutions 2026
==================================================================== */

/* ── GLOBAL RESET — ensure no browser default spacing causes gaps ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0 !important; padding: 0 !important; }

/* ── 1. PREVENT iOS INPUT ZOOM ─────────────────────────────────── */
@media (max-width: 820px) {
  input, select, textarea,
  .m-input, .m-select,
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
  }
}

/* ── 2. GLOBAL TOUCH ────────────────────────────────────────────── */
html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

@media (max-width: 820px) {
  a, button,
  .btn, .navbar-link, .footer-links a,
  .m-submit, .service-card {
    -webkit-tap-highlight-color: rgba(201,166,70,0.15);
    touch-action: manipulation;
  }
  body, html { overflow-x: hidden; max-width: 100vw; }
  section, .section-padding {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  .container, .container-sm {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }
  .section-heading { margin-bottom: 2rem !important; }
  .section-title { font-size: clamp(1.6rem, 6vw, 2.2rem) !important; }
}

/* ── 3. NAVBAR MOBILE ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .navbar-container { padding: 0 1rem !important; }
  .navbar-toggle {
    width: 44px; height: 44px;
    padding: 10px !important; display: flex !important;
  }
  .theme-toggle-btn {
    min-width: 72px !important;
    height: 44px !important;
    padding: 0 14px !important;
    font-size: 0.95rem !important;
    border-radius: 999px !important;
  }
  .navbar-brand-name { font-size: 0.88rem !important; }
  .navbar-brand-tagline { display: none; }
  .navbar-link {
    padding: 0.9rem 1rem !important;
    font-size: 1rem !important;
    min-height: 48px; display: flex !important; align-items: center;
  }
  .btn-nav-client, .btn-nav-admin {
    min-height: 48px !important; font-size: 0.9rem !important;
  }
}
@media (max-width: 400px) {
  .navbar-brand-name { font-size: 0.8rem !important; }
  .navbar-logo img { width: 38px !important; height: 38px !important; }
}

/* ── 4. HERO MOBILE ─────────────────────────────────────────────── */
@media (max-width: 820px) {
  .hero-section { min-height: auto !important; padding-top: 68px !important; padding-bottom: 2rem !important; }
  .hero-container {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    padding: 2.5rem 1.25rem 3.5rem !important;
    gap: 2.5rem !important;
  }
  .hero-badge { margin: 0 auto 1.25rem; font-size: 0.65rem !important; }
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.1 !important;
    word-break: break-word;
  }
  .hero-tagline { font-size: 0.7rem !important; letter-spacing: 3px !important; }
  .hero-subtitle { font-size: clamp(1.05rem, 3.5vw, 1.35rem) !important; margin-bottom: 1.25rem !important; }
  .hero-description {
    font-size: 0.93rem !important; line-height: 1.75 !important;
    margin: 0 auto 1.75rem !important; max-width: 100% !important;
  }
  .hero-buttons {
    flex-direction: column !important; align-items: center !important;
    gap: 0.75rem !important; margin-bottom: 1.75rem !important; width: 100%;
  }
  .hero-buttons a, .hero-buttons .btn {
    width: 100% !important; max-width: 300px !important;
    justify-content: center !important; padding: 0.9rem 1.5rem !important;
    font-size: 0.95rem !important; text-align: center !important;
  }
  .hero-trust-badges {
    justify-content: center !important; gap: 1rem !important; flex-wrap: wrap !important;
  }
  .hero-logo-container { width: 220px !important; height: 220px !important; margin: 0 auto !important; }
  .hero-logo-image-v2 { width: 120px !important; height: 120px !important; }
  .hero-deco-1 { width: 185px !important; height: 185px !important; }
  .hero-deco-2 { width: 260px !important; height: 260px !important; }
  .hero-particles, .hero-bg-wave, .hero-grid-lines { display: none; }
}
@media (max-width: 480px) {
  .hero-title { font-size: clamp(1.75rem, 7.5vw, 2.4rem) !important; }
  .hero-logo-container { width: 180px !important; height: 180px !important; }
  .hero-logo-image-v2 { width: 100px !important; height: 100px !important; }
}

/* ── 5. TRUST BAR ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .trust-bar-section { padding: 0.85rem 0; }
  .trust-item { font-size: 0.72rem !important; gap: 0.5rem !important; }
}

/* ── 6. SERVICES GRID ───────────────────────────────────────────── */
@media (max-width: 1024px) { .services-grid { grid-template-columns: repeat(2,1fr) !important; } }
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr !important; }
  .service-card { padding: 1.5rem !important; }
  .service-card h3 { font-size: 1.05rem !important; }
}

/* ── 7. SOFTWARE SECTION ────────────────────────────────────────── */
@media (max-width: 820px) {
  .software-grid { grid-template-columns: 1fr !important; gap: 1.75rem !important; }
  .software-card { padding: 1.75rem !important; }
  .software-card:hover { transform: none !important; }
  .software-card h3 { font-size: 1.2rem !important; }
}

/* ── 8. FEATURES GRID ───────────────────────────────────────────── */
@media (max-width: 1024px) { .features-grid { grid-template-columns: repeat(2,1fr) !important; } }
@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .feature-card { padding: 1.5rem 1.25rem !important; }
  .feature-card:hover { transform: none !important; }
}

/* ── 9. WHY CHOOSE US ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .why-grid { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .why-card { padding: 1.25rem !important; }
  .why-card:hover { transform: none !important; }
}

/* ── 10. ABOUT SECTION ──────────────────────────────────────────── */
@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr !important; gap: 2.5rem !important; text-align: center; }
  .about-stats { justify-content: center !important; }
  .about-image-block { max-width: 360px; margin: 0 auto; }
  .about-accent-card { display: none !important; }
  .about-content-text h2 { font-size: clamp(1.5rem, 5vw, 2rem) !important; }
}

/* ── 11. GALLERY ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: repeat(3, 150px) !important;
  }
  .gallery-grid .gallery-item:first-child { grid-column: 1 / 3 !important; grid-row: 1 !important; }
  .gallery-overlay { opacity: 1 !important; }
}

/* ── 12. CTA SECTION ────────────────────────────────────────────── */
@media (max-width: 820px) {
  .cta-section { padding: 4rem 0 !important; }
  .cta-buttons { flex-direction: column !important; align-items: center !important; gap: 0.75rem !important; }
  .cta-buttons .btn, .cta-buttons a {
    width: 100% !important; max-width: 280px !important; text-align: center !important;
  }
}

/* ── 13. PORTAL SECTION ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .portal-grid { grid-template-columns: 1fr !important; gap: 2.5rem !important; text-align: center; }
  .portal-feature { justify-content: flex-start; text-align: left; }
  .portal-mockup { max-width: 380px; margin: 0 auto; }
}

/* ── 14. CONTACT SECTION ────────────────────────────────────────── */
@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
  .contact-form-box { padding: 1.75rem 1.25rem !important; border-radius: 16px !important; }
  .form-input, .form-select, .form-textarea { font-size: 16px !important; padding: 0.8rem 1rem !important; }
}

/* ── 15. MODAL — BOTTOM SHEET ON MOBILE ────────────────────────── */
@media (max-width: 600px) {
  #mOverlay { padding: 0 !important; align-items: flex-end !important; }
  #mBox {
    max-width: 100% !important; width: 100% !important;
    max-height: 90vh !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 1.75rem 1.25rem 2rem !important;
    margin: 0 !important;
  }
  .m-title { font-size: 1.35rem !important; }
  .m-input, .m-select { font-size: 16px !important; padding: 0.85rem 1rem !important; }
  .m-submit { padding: 1rem !important; font-size: 1rem !important; min-height: 52px; }
  .m-close-btn { width: 40px !important; height: 40px !important; }
}

/* ── 16. FOOTER ─────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .footer { padding: 3.5rem 0 2rem !important; }
  .footer-container { padding: 0 1.25rem !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 2.25rem !important; }
  .footer-desc { max-width: 100% !important; }
  .footer-bottom { flex-direction: column !important; text-align: center !important; gap: 0.5rem !important; }
  .footer-links a {
    padding: 0.35rem 0 !important; font-size: 0.88rem !important;
    min-height: 40px; display: flex; align-items: center;
  }
}
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
}

/* ── 17. WHATSAPP + BACK TO TOP ─────────────────────────────────── */
@media (max-width: 600px) {
  .whatsapp-float {
    bottom: 20px !important; right: 16px !important;
    width: 50px !important; height: 50px !important;
  }
  .back-to-top { bottom: 80px !important; right: 16px !important; width: 40px !important; height: 40px !important; }
}

/* ── 18. ANIMATIONS — MOBILE PERFORMANCE ───────────────────────── */
@media (max-width: 820px) {
  .software-card:hover, .feature-card:hover,
  .why-card:hover, .service-card:hover,
  .portal-feature:hover { transform: none !important; }

  .scroll-animate, .fade-up, .fade-up-delay-1,
  .fade-up-delay-2, .fade-up-delay-3, .fade-up-delay-4,
  .fade-in, .fade-in-down, .fade-in-left, .fade-in-right {
    transition-duration: 0.35s !important;
  }
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-animate, .fade-up, .fade-in, .fade-in-left, .fade-in-right, .fade-in-down {
    opacity: 1 !important; transform: none !important;
  }
}

/* ── 19. TYPOGRAPHY — FLUID ──────────────────────────────────────  */
@media (max-width: 820px) {
  h1 { font-size: clamp(1.8rem, 7vw, 2.8rem) !important; }
  h2 { font-size: clamp(1.4rem, 5.5vw, 2.2rem) !important; }
  h3 { font-size: clamp(1.1rem, 4vw, 1.6rem) !important; }
  p  { font-size: 0.93rem; line-height: 1.75; }
}

/* ── 20. TABLET — 821px to 1100px ──────────────────────────────── */
@media (min-width: 821px) and (max-width: 1100px) {
  .container { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
  section, .section-padding { padding-top: 4.5rem !important; padding-bottom: 4.5rem !important; }
  .hero-title { font-size: clamp(2.5rem, 5.5vw, 4rem) !important; }
  .features-grid { grid-template-columns: repeat(2,1fr) !important; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr !important; gap: 2rem !important; }
}

/* ── 21. SW3 CARDS ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .sw3-grid { grid-template-columns: 1fr !important; gap: 1.25rem !important; }
  .sw3-card { padding: 1.5rem !important; }
}

/* ── 22. MAP SECTION ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .map-wrapper iframe { height: 280px !important; }
}

/* ── 23. NAVBAR BACKDROP ────────────────────────────────────────── */
.navbar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5,13,26,0.6);
  /* No backdrop-filter — Opera Mini fallback */
  z-index: 198;
  opacity: 0;
  transition: opacity 0.3s ease;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .navbar-backdrop {
    background: rgba(5,13,26,0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
}
.navbar-backdrop.active {
  display: block;
  opacity: 1;
}
