/* =========================================================
   MTLS — Responsive Overrides
   Breakpoints follow Bootstrap 5: xl 1200, lg 992, md 768, sm 576
   ========================================================= */

/* -----------------------------------------------------------
   Large Desktops (below 1399.98px)
   ----------------------------------------------------------- */
@media (max-width: 1399.98px) {
  .mega-menu.dropdown-menu-wide { min-width: 620px; }
}

/* -----------------------------------------------------------
   Small Desktops / Laptops (below 1199.98px)
   ----------------------------------------------------------- */
@media (max-width: 1199.98px) {
  :root { --header-height: 84px; }
  .hero-slider, .hero-slide { min-height: 640px; }
  .main-nav .nav-link { padding: 12px 11px !important; font-size: 14px; }
  .quick-strip { padding: 24px; }
}

/* -----------------------------------------------------------
   Tablets (below 991.98px)
   ----------------------------------------------------------- */
@media (max-width: 991.98px) {
  .topbar .d-none-lg { display: none !important; }
  .navbar-brand img { height: 44px; }

  /* Offcanvas style mobile nav */
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 86%;
    height: 100vh;
    background: var(--color-white);
    box-shadow: var(--shadow-lg);
    padding: 90px 24px 30px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: var(--transition);
    z-index: 1100;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav .navbar-nav { gap: 0; flex-direction: column; }
  .main-nav .nav-link { padding: 14px 6px !important; border-bottom: 1px solid var(--color-border); }
  .main-nav .dropdown-menu, .main-nav .mega-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border: 1px solid var(--color-border);
    width: 100%;
    min-width: 100%;
    margin-top: 6px !important;
  }
  .mega-menu .row > div { margin-bottom: 18px; }

  .mobile-nav-toggle {
    display: flex !important;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1.5px solid var(--color-border);
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 15, 33, 0.6);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }
  .nav-backdrop.show { opacity: 1; visibility: visible; }

  .hero-slider, .hero-slide { min-height: 560px; }
  .hero-quick-form { margin-top: -50px; }
  .quick-strip .row > div { margin-bottom: 20px; }
  .quick-strip .row > div:last-child { margin-bottom: 0; }

  .section-title h2 { font-size: 1.9rem; }
  .service-sidebar { position: static; margin-top: 50px; }
  .timeline { padding-left: 30px; }
  .cta-section { padding: 46px 28px; text-align: center; }
  .footer-top { padding: 60px 0 30px; }
}

/* -----------------------------------------------------------
   Large Mobiles (below 767.98px)
   ----------------------------------------------------------- */
@media (max-width: 767.98px) {
  body { font-size: 15px; }
  .hero-slide h1 { font-size: 2rem; }
  .hero-cta-group { flex-direction: column; }
  .hero-cta-group .btn { width: 100%; text-align: center; }

  .page-banner { padding: 140px 0 60px; }
  .tracking-box { padding: 26px; margin-top: -70px; }
  .tracking-steps { flex-wrap: wrap; gap: 20px 0; }
  .tracking-steps::before { display: none; }
  .tracking-steps .track-step { width: 33.33%; }

  .mega-menu.dropdown-menu-wide { min-width: 100%; }

  .cta-section { padding: 36px 20px; }
  .contact-info-card { padding: 28px; }

  .slider-arrow { width: 42px; height: 42px; font-size: 15px; }
  .slider-arrow.prev { left: 12px; }
  .slider-arrow.next { right: 12px; }

  .back-to-top, .float-whatsapp { width: 44px; height: 44px; font-size: 18px; }
  .back-to-top { bottom: 20px; right: 20px; }
  .float-whatsapp { bottom: 76px; right: 20px; }
}

/* -----------------------------------------------------------
   Small Mobiles (below 575.98px)
   ----------------------------------------------------------- */
@media (max-width: 575.98px) {
  .section-padding { padding: 56px 0; }
  .section-padding-top { padding-top: 56px; }
  .section-padding-bottom { padding-bottom: 56px; }

  .eyebrow { font-size: 12px; }
  .section-title h2 { font-size: 1.6rem; }

  .hero-slide .hero-badge { font-size: 12px; padding: 6px 14px; }
  .hero-slide p { font-size: 1rem; }

  .btn { padding: 12px 24px; font-size: 14px; }

  .industry-card { height: 240px; }
  .gallery-item { height: 200px; }
  .team-card .team-img { height: 260px; }

  .tracking-steps .track-step { width: 50%; }
  .tracking-steps .track-step span { font-size: 11.5px; }

  .footer-newsletter { flex-direction: column; }
  .footer-newsletter input { border-radius: var(--radius-sm); margin-bottom: 10px; }
  .footer-newsletter button { border-radius: var(--radius-pill); width: 100%; }

  .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
  .lightbox-nav.prev { left: 10px; }
  .lightbox-nav.next { right: 10px; }
  .lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; }
}

/* -----------------------------------------------------------
   Print
   ----------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .back-to-top, .float-whatsapp, .hero-slider { display: none !important; }
}

/* -----------------------------------------------------------
   Mobile Polish v3 — extra responsiveness fixes
   ----------------------------------------------------------- */
@media (max-width: 767.98px) {

  /* Show a slim topbar on mobile with tap-to-call numbers */
  .topbar { display: block !important; padding: 8px 0; }
  .topbar .container-xl-custom > div:last-child { display: none; } /* socials/track hidden */
  .topbar .container-xl-custom > div:first-child { width: 100%; text-align: center; }
  .topbar .topbar-item { margin-right: 0; font-size: 12.5px; }

  /* Hero: remove overlapping controls, keep dots */
  .slider-arrow { display: none; }
  .scroll-indicator { display: none; }
  .hero-slider, .hero-slide { min-height: 520px; }
  .hero-slide .hero-content { padding: 44px 0 64px; } /* clear of dots */

  /* Prevent iOS auto-zoom on input focus */
  .mtls-form .form-control,
  .mtls-form .form-select { font-size: 16px; }

  /* Maps & banners tighter on phones */
  .map-wrapper iframe { height: 320px; }
  .page-banner { padding: 120px 0 52px; }

  /* Footer bottom centered */
  .footer-bottom .container-xl-custom { justify-content: center !important; text-align: center; }

  /* Video showcase breathing room */
  .section-title h2 { line-height: 1.3; }
}

@media (max-width: 575.98px) {
  .hero-slide h1 { font-size: 1.75rem; }
  .hero-slide p { font-size: 0.95rem; margin-bottom: 26px; }
  .hero-slide .hero-badge { max-width: 100%; white-space: normal; text-align: left; }

  .quick-strip { padding: 20px; }
  .quick-strip-item i { width: 46px; height: 46px; font-size: 20px; }

  .city-card { padding: 18px 10px; }
  .city-card h4 { font-size: 0.82rem; letter-spacing: 0.5px; }
  .city-card span { font-size: 11.5px; }
  .city-card .city-icon { width: 42px; height: 42px; font-size: 18px; }

  .stat-card .counter-number { font-size: 2rem; }

  .service-detail-content h2 { font-size: 1.35rem; }
  .sidebar-widget { padding: 20px; }

  .testimonial-card { padding: 24px 20px; }
  .value-card { padding: 26px 20px; }

  .contact-info-card { background-size: 300px; }
}

/* -----------------------------------------------------------
   Mobile Polish v4 — topbar override + overflow guards
   ----------------------------------------------------------- */
@media (max-width: 767.98px) {
  /* Beat Bootstrap's .d-flex !important on the topbar right column */
  .topbar .container-xl-custom > div:last-child { display: none !important; }
  .topbar .container-xl-custom { justify-content: center !important; }
  .topbar .container-xl-custom > div:first-child {
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
  .topbar .topbar-item { white-space: nowrap; }
  .topbar .topbar-item:not(:first-child) { display: none; } /* keep only the phone line */

  /* Global horizontal-overflow guards */
  html, body { max-width: 100%; overflow-x: hidden; }
  img, video, iframe { max-width: 100%; }
  .row { --bs-gutter-x: 1.5rem; }

  /* Long headings must never clip */
  h1, h2, h3, .hero-slide h1 { overflow-wrap: break-word; word-break: break-word; }

  /* Hero badge shouldn't force width */
  .hero-slide .hero-badge { white-space: normal; }

  /* Buttons full width feel on small screens for key CTAs */
  .cta-section .btn { width: 100%; }
}
