/* ==========================================================================
   ACG RESPONSIVE — Audit & Corrections Pre-Deploiement Fornex
   AFRIC CONSULTING GROUP TELECOM BENIN
   Fichier : public/css/acg-responsive.css
   ========================================================================== */

/* ==========================================================================
   1. RESET GLOBAL ANTI-DEBORDEMENT
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
}

body > * { max-width: 100%; }


/* ==========================================================================
   2. NAVBAR — Logo ne depasse jamais, hamburger 44x44px
   ========================================================================== */
.navbar-custom { max-width: 100vw; overflow: visible; }
.navbar-custom .container,
.navbar-custom .acg-nav-shell { max-width: 100%; overflow: visible; }

.acg-brand { flex-shrink: 1; min-width: 0; overflow: hidden; }
.acg-brand-type { min-width: 0; overflow: hidden; }
.acg-brand-type strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.navbar-toggler.acg-menu-toggle {
  min-width: 44px;
  min-height: 44px;
  /* PAS de display:flex ici — cela ecrase le display:none de Bootstrap sur desktop */
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

/* Desktop >= 992px : hamburger TOUJOURS cache */
@media (min-width: 992px) {
  .navbar-toggler,
  .navbar-toggler.acg-menu-toggle {
    display: none !important;
  }
}

/* Mobile < 992px : hamburger visible en flex */
@media (max-width: 991.98px) {
  .navbar-toggler.acg-menu-toggle {
    display: flex !important;
  }
}


/* ==========================================================================
   3. MENU MOBILE — Dropdown "A propos" tactile + CTA pleine largeur
   ========================================================================== */
@media (max-width: 991.98px) {

  .navbar-collapse {
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .acg-nav-links .nav-item { width: 100%; }

  .acg-nav-links .nav-link {
    min-height: 48px;
    display: flex !important;
    align-items: center;
    padding: 14px 16px !important;
    font-size: 15px !important;
    border-radius: 10px;
    width: 100%;
  }

  /* Sous-menu A propos — inline dans le collapse Bootstrap */
  .acg-nav-links .dropdown-menu {
    position: static !important;
    float: none;
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    border-left: 3px solid rgba(0, 126, 137, 0.3) !important;
    border-radius: 0 10px 10px 10px !important;
    margin: 4px 0 4px 16px !important;
    padding: 6px 0 !important;
    background: transparent !important;
    animation: none !important;
  }

  .acg-nav-links .dropdown-item {
    min-height: 44px !important;
    padding: 11px 16px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    margin-bottom: 2px !important;
    display: flex;
    align-items: center;
  }

  /* CTA "Parlons de votre projet" — pleine largeur mobile */
  .acg-nav-cta { padding: 8px 0 12px; width: 100%; }

  .acg-nav-cta .nav-link-contact {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    padding: 13px 20px !important;
    font-size: 14px !important;
    gap: 8px;
    text-align: center;
    white-space: normal !important;
  }
}


/* ==========================================================================
   4. BOUTON CTA "PARLONS DE VOTRE PROJET" — Dark mode lisibilite
   ========================================================================== */
.acg-nav-cta .nav-link-contact {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark-mode .acg-nav-cta .nav-link-contact {
  background: #13aaa4 !important;
  color: #011a1f !important;
  font-weight: 800 !important;
}

body.dark-mode .acg-nav-links .nav-link.active {
  color: #8cddd3 !important;
  background: rgba(84, 213, 204, 0.15) !important;
  font-weight: 700;
}


/* ==========================================================================
   5. ELEMENTS FLOTTANTS — Pas de superposition mobile
   ========================================================================== */
.whatsapp-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9997;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9996;
}

.dark-mode-toggle { position: fixed; z-index: 9998; }

@media (max-width: 767px) {
  .dark-mode-toggle {
    bottom: 24px !important;
    right: auto !important;
    left: 16px !important;
    top: auto !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 17px !important;
  }
  .whatsapp-button { width: 52px; height: 52px; bottom: 16px; right: 16px; }
  .back-to-top { bottom: 78px; right: 16px; width: 44px; height: 44px; }
}

@media (max-width: 375px) {
  .dark-mode-toggle { left: 12px !important; bottom: 16px !important; width: 40px !important; height: 40px !important; }
  .whatsapp-button { bottom: 12px; right: 12px; }
  .back-to-top { bottom: 72px; right: 12px; }
}


/* ==========================================================================
   6. FORMULAIRE CONTACT — Anti-zoom iOS (font-size >= 16px)
   ========================================================================== */
.form-control,
.form-select,
.form-control-lg,
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  font-size: 16px !important;
}

@media (min-width: 768px) {
  .form-control,
  .form-select { font-size: 0.95rem !important; }
}

.form-control, .form-select { min-height: 48px; }
button[type="submit"], .btn-lg { min-height: 48px; }


/* ==========================================================================
   7. FOOTER — Petits ecrans (320px-575px)
   ========================================================================== */
@media (max-width: 575px) {
  .footer-custom { padding: 48px 0 24px; }
  .footer-custom .col-6 { width: 100% !important; flex: 0 0 100% !important; max-width: 100% !important; }
  .footer-links a, .footer-contact li span { font-size: 0.88rem; }
  .footer-title { font-size: 0.92rem; margin-top: 1.5rem; }
  .copyright { font-size: 0.8rem; text-align: center; }
}

@media (max-width: 375px) {
  .footer-custom { padding: 36px 0 20px; }
  .footer-contact li span { word-break: break-all; font-size: 0.82rem; }
}


/* ==========================================================================
   8. NAVIGATION INTERNE SERVICES — Scroll horizontal controle
   ========================================================================== */
.services-nav, .nav-pills, .nav-tabs { flex-wrap: wrap; }

@media (max-width: 767px) {
  .services-nav-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,126,137,0.4) transparent;
    padding-bottom: 4px;
  }
  .services-nav-scroll::-webkit-scrollbar { height: 3px; }
  .services-nav-scroll::-webkit-scrollbar-thumb { background: rgba(0,126,137,0.4); border-radius: 3px; }
  .services-nav-scroll .nav-pills,
  .services-nav-scroll .nav-tabs { flex-wrap: nowrap; min-width: max-content; }
}


/* ==========================================================================
   9. HERO ACCUEIL — Stabilite tous breakpoints
   ========================================================================== */
.acg-hero { width: 100%; max-width: 100vw; overflow: hidden !important; }

.acg-hero-inner {
  width: 100%;
  max-width: 100%;
  padding-left: clamp(16px, 4vw, 64px);
  padding-right: clamp(16px, 4vw, 64px);
}

@media (max-width: 575px) {
  .acg-hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 9px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 479px) {
  .acg-hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .acg-btn { width: 100% !important; justify-content: center !important; text-align: center; }
}


/* ==========================================================================
   10. CARROUSEL HERO — Responsive images
   ========================================================================== */
.acg-slide img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center; display: block;
}

@media (max-width: 767px) {
  .acg-hero-visual { height: 280px !important; max-width: 100% !important; border-radius: 60px 12px 12px 12px !important; }
}
@media (max-width: 480px) {
  .acg-hero-visual { height: 240px !important; border-radius: 48px 10px 10px 10px !important; }
}
@media (max-width: 360px) {
  .acg-hero-visual { height: 210px !important; border-radius: 36px 8px 8px 8px !important; }
}

@media (max-width: 575px) {
  .acg-slide-title { font-size: 13px !important; line-height: 1.3; }
  .acg-slide-service { font-size: 8.5px !important; }
  .acg-slide-info { padding: 14px 16px 12px !important; }
}


/* ==========================================================================
   11. PAGE HERO (sous-pages) — Responsive padding
   ========================================================================== */
.page-hero { padding-top: 140px; padding-bottom: 60px; }

@media (max-width: 991px) { .page-hero { padding-top: 120px; padding-bottom: 50px; } }

@media (max-width: 767px) {
  .page-hero { padding-top: 110px; padding-bottom: 40px; }
  .page-hero h1 { font-size: clamp(1.6rem, 6vw, 2.5rem) !important; }
  .page-hero p { font-size: 0.95rem !important; }
}

@media (max-width: 480px) {
  .page-hero { padding-top: 100px; padding-bottom: 30px; }
  .page-hero h1 { font-size: clamp(1.4rem, 7vw, 2rem) !important; }
}


/* ==========================================================================
   12. IMAGES — object-fit, jamais deformees
   ========================================================================== */
img { max-width: 100%; height: auto; }
.card img, .glass-card img, .service-card img, .partner-card img, .expertise-card img { width: 100%; object-fit: cover; }
.footer-logo { max-width: 48px; max-height: 48px; object-fit: contain; }
.acg-brand-mark { flex-shrink: 0; object-fit: contain; }


/* ==========================================================================
   13. CARDS & SECTIONS — Responsive generale
   ========================================================================== */
@media (max-width: 575px) {
  .stat-card { padding: 1.25rem !important; }
  .service-card-modern, .feature-card-modern, .expertise-card, .contact-card { padding: 1.5rem !important; }
  .section-padding { padding: 48px 0 !important; }
  .section-padding-sm { padding: 32px 0 !important; }
  .section-title { font-size: clamp(1.4rem, 6vw, 1.8rem) !important; }
}

@media (max-width: 360px) {
  .container, .container-fluid { padding-left: 14px !important; padding-right: 14px !important; }
  .section-padding { padding: 36px 0 !important; }
}


/* ==========================================================================
   14. ACCESSIBILITE — Focus visible, zones tactiles 44px
   ========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #36babe !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

.nav-link, .dropdown-item, .btn, button, .social-link,
.back-to-top, .whatsapp-button, .dark-mode-toggle { min-height: 44px; }

.footer-links a, .footer-link, .footer-contact a {
  min-height: auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .acg-slide { transition: none !important; }
}


/* ==========================================================================
   15. DARK MODE — Corrections couleurs liens nav
   ========================================================================== */
body.dark-mode .acg-nav-links .nav-link { color: #c8e8e5 !important; }
body.dark-mode .acg-nav-links .nav-link:hover { color: #8cddd3 !important; background: rgba(84, 213, 204, 0.1) !important; }

body.dark-mode .navbar-collapse .dropdown-menu {
  background: rgba(6, 18, 24, 0.97) !important;
  border-color: rgba(19, 170, 164, 0.2) !important;
}
body.dark-mode .navbar-collapse .dropdown-item { color: #c8e8e5 !important; }
body.dark-mode .navbar-collapse .dropdown-item:hover { color: #8cddd3 !important; background: rgba(84, 213, 204, 0.1) !important; }


/* ==========================================================================
   16. SECTIONS — Pas de scroll horizontal involontaire
   ========================================================================== */
section { max-width: 100%; overflow-x: hidden; }

.row {
  --bs-gutter-x: 1.5rem;
  margin-left: calc(var(--bs-gutter-x) * -0.5);
  margin-right: calc(var(--bs-gutter-x) * -0.5);
}
@media (max-width: 575px) { .row { --bs-gutter-x: 1rem; } }
@media (max-width: 360px) { .row { --bs-gutter-x: 0.75rem; } }


/* ==========================================================================
   17. GRANDE RESOLUTION (2K/4K) — Centrage et max-width
   ========================================================================== */
@media (min-width: 1920px) {
  .container, .acg-nav-shell, .acg-hero-inner { max-width: 1400px; }
}
@media (min-width: 2560px) {
  .container, .acg-nav-shell, .acg-hero-inner { max-width: 1600px; }
  body { font-size: 18px; }
}


/* ==========================================================================
   18. CONTACT — Cards info responsive
   ========================================================================== */
@media (max-width: 575px) {
  .contact-card { padding: 1.5rem !important; margin-bottom: 0.5rem; }
  .contact-icon { width: 52px !important; height: 52px !important; font-size: 22px !important; margin-bottom: 1rem !important; }
}


/* ==========================================================================
   19. ANIMATION INTRO ACG — Responsive
   ========================================================================== */
#acg-intro { max-width: 100vw; overflow: hidden; }

@media (max-width: 575px) {
  .acg-intro-logo { max-width: 80px !important; max-height: 80px !important; }
  .acg-intro-title { font-size: clamp(1.2rem, 7vw, 2rem) !important; }
  .acg-intro-subtitle { font-size: clamp(0.7rem, 3.5vw, 0.95rem) !important; }
}

#acg-intro-skip, .acg-intro-skip {
  min-width: 80px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  position: fixed; z-index: 100000;
}

@media (max-width: 575px) {
  #acg-intro-skip, .acg-intro-skip { font-size: 13px !important; padding: 8px 16px !important; }
}
