html.app-installed body {
  overscroll-behavior-y: contain;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    -webkit-tap-highlight-color: transparent;
    padding-bottom: 0;
  }

  .get-started-btn,
  .cta-btn,
  .service-btn,
  .services-btn {
    min-height: 44px;
  }

  /* Evite les debordements des elements decoratifs hors-cadre */
  main,
  section,
  header,
  footer,
  .container,
  .container-fluid,
  .hero-new,
  .services-section,
  .services-intro,
  .modern-header,
  .about-section,
  .testimonials-section,
  .cta-section,
  .footer-modern {
    max-width: 100%;
    overflow-x: clip;
  }

  /* Supprime les marges/vides lateraux excessifs de certaines grilles */
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Corrige le vide avant footer (causé par section-padding margin-bottom) */
  .section-padding {
    margin-bottom: 20px !important;
  }

  main > section:last-of-type {
    margin-bottom: 0 !important;
  }

  /* Footer compact et propre sur mobile */
  #footer.footer-modern {
    margin-top: 0 !important;
    padding-top: 48px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom) + 66px) !important;
  }

  #footer .footer-content {
    margin-bottom: 24px !important;
    gap: 24px !important;
  }

  #footer .footer-section {
    margin-bottom: 12px !important;
    padding-right: 0 !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    background: rgba(10, 23, 44, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 16px;
    padding: 6px 6px 5px;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 28px rgba(2, 10, 22, 0.45);
  }

  .mobile-bottom-item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.84);
    min-height: 56px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  }

  .mobile-bottom-item i {
    font-size: 17px;
  }

  .mobile-bottom-item.active {
    color: #8bf1cc;
    background: rgba(94, 227, 179, 0.16);
    transform: translateY(-1px);
  }
}

@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }
}

@media all and (display-mode: standalone) {
  html,
  body {
    background-color: #0b1b34;
  }

  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background: #0b1b34;
    z-index: 9999;
    pointer-events: none;
  }

  .fixed-top {
    padding-top: env(safe-area-inset-top);
  }

  @media (max-width: 768px) {
    .mobile-bottom-nav {
      bottom: calc(10px + env(safe-area-inset-bottom));
    }
  }
}
