/* ==========================================================================
   NOVA - RESPONSIVE & ACCESSIBILITÉ (RESPONSIVE.CSS)
   Groupe Nova - Côte d'Ivoire
   Optimisé pour PC, Tablettes (Paysage/Portrait) et Smartphones
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. SÉCURITÉ RESPONSIVE GLOBALE (ANTI-DÉBORDEMENT HORIZONTAL)
   -------------------------------------------------------------------------- */
html, body {
  max-width: 100vw;
  overflow-x: clip;
}

img, video, iframe, svg {
  max-width: 100%;
}

h1, h2, h3, h4, h5, h6, p, a, span, button {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   1. LAPTOPS & PETITS ÉCRANS PC (1025px - 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .nav-links {
    gap: 1.25rem;
  }

  .nav-link {
    font-size: 0.825rem;
  }

  .hero-slide .slide-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  }

  .pole-card-featured {
    gap: 2rem;
    padding: 2.75rem;
  }
}

/* --------------------------------------------------------------------------
   2. TABLETTES PAYSAGE & PORTRAIT (max-width: 1024px)
   Transition nette vers la navigation mobile pour éviter tout débordement
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --nav-height: 76px;
  }

  /* Topbar masquée sur tablette et mobile */
  .topbar {
    display: none;
  }

  /* Activation du menu burger & navigation adaptée sur tablette */
  .nav-links {
    display: none;
  }

  .nav-cta-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .nav-desktop-cta {
    display: inline-flex;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  .burger-btn {
    display: inline-flex;
  }

  .mobile-nav {
    max-width: 500px;
  }

  /* Pôles d'activité en grille adaptée */
  .pole-card-featured {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2.5rem;
  }

  .pole-card-secondary {
    grid-column: span 6;
  }

  /* Grilles sur 2 colonnes */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 250px;
    gap: 1.25rem;
  }

  .service-subcards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Onglets de services : défilement horizontal fluide */
  .services-nav-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    max-width: 100%;
  }

  .services-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .service-tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.65rem 1.15rem;
    font-size: 0.85rem;
  }

  /* Filtres réalisations & galerie */
  .filter-tabs-container {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    width: 100%;
  }

  .filter-tabs-container::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Mot du PDG */
  .pdg-mot-card {
    grid-template-columns: 150px 1fr;
    gap: 2rem;
    padding: 2.25rem;
  }

  .pdg-mot-photo-wrap {
    width: 150px;
    height: 190px;
  }
}

/* --------------------------------------------------------------------------
   3. TABLETTES COMPACTES & MOBILES LARGES (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --nav-height: 70px;
  }

  .section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  /* Slider mobile : masquage des flèches latérales qui chevauchent le texte */
  .hero-slider-section {
    height: calc(100vh - var(--nav-height));
    min-height: 520px;
    max-height: 720px;
  }

  .slider-control-btn {
    display: none; /* Le swipe tactile natif & les puces en bas assurent le contrôle */
  }

  .slider-indicators {
    bottom: 1.25rem;
    gap: 0.5rem;
  }

  .indicator-dot {
    width: 32px;
    height: 4px;
  }

  .indicator-dot.active {
    width: 48px;
  }

  .hero-slide-content {
    padding: 1.5rem 0 3.5rem 0;
  }

  .hero-slide .slide-title {
    font-size: clamp(1.85rem, 6vw, 2.4rem);
    line-height: 1.2;
    margin-bottom: 1rem;
  }

  .hero-slide .slide-subtitle {
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1.5rem;
  }

  .hero-slide .slide-actions {
    gap: 0.85rem;
  }

  /* Pôles d'activité en pleine largeur */
  .pole-card-secondary {
    grid-column: span 12;
  }

  .pole-card {
    padding: 1.75rem;
  }

  /* Mot du PDG sur une colonne centrée */
  .pdg-mot-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    padding: 1.75rem;
  }

  .pdg-mot-photo-wrap {
    margin: 0 auto;
    width: 140px;
    height: 175px;
  }

  /* Frise Chronologique verticale à gauche */
  .timeline::before {
    left: 20px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 55px !important;
    padding-right: 0 !important;
    text-align: left !important;
    margin-bottom: 2rem;
  }

  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    left: 0;
  }

  .timeline-dot {
    left: 11px !important;
    right: auto !important;
  }

  /* Galerie Masonry sur mobile (1 colonne fluide) */
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 230px;
    gap: 1rem;
  }

  .gallery-item.span-2-row,
  .gallery-item.span-2-col {
    grid-row: span 1;
    grid-column: span 1;
  }

  /* Formulaires & Cartes Contact */
  .contact-form-card,
  .contact-info-card {
    padding: 1.75rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-subcards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .team-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .maps-container {
    height: 320px;
    margin-top: 2.5rem;
  }

  /* Modale Détails Projet */
  .project-modal {
    padding: 1rem;
  }

  .project-modal-header {
    height: 240px;
  }

  .project-modal-body {
    padding: 1.5rem;
  }

  .project-modal-meta {
    gap: 1.25rem;
  }

  /* Modale Devis Express */
  .quote-modal-box {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }

  .quote-modal-box > div {
    padding: 1.75rem 1.25rem !important;
  }

  /* Pied de page & CTA Banner */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .cta-banner-content {
    flex-direction: column;
    text-align: center;
    gap: 1.75rem;
  }

  .cta-banner-actions {
    justify-content: center;
  }

  .floating-actions {
    bottom: 1.25rem;
    right: 1.25rem;
    gap: 0.65rem;
  }

  .btn-whatsapp-float {
    width: 48px;
    height: 48px;
  }

  .btn-back-to-top {
    width: 42px;
    height: 42px;
  }

  /* Ajustements mobiles du menu tiroir luxe */
  .nav-desktop-cta {
    display: none;
  }

  .burger-pill {
    padding: 0.4rem 0.75rem;
    gap: 0.45rem;
  }

  .mobile-nav {
    max-width: 100%;
  }

  .mobile-nav-header {
    padding: 1rem 1.25rem;
  }

  .mobile-nav-body {
    padding: 1rem 1.25rem 2rem 1.25rem;
    gap: 1.35rem;
  }
}

/* --------------------------------------------------------------------------
   4. PETITS SMARTPHONES (max-width: 576px / 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  :root {
    --container-padding: 1.15rem;
  }

  /* Boutons du slider empilés proprement en pleine largeur sans débordement */
  .hero-slide .slide-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-slide .slide-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    font-size: var(--text-sm);
  }

  /* Boutons CTA bannière */
  .cta-banner-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-banner-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    padding: 1.5rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  /* Grilles 2 colonnes dans les formulaires réduites à 1 seule colonne */
  .quote-modal-box [style*="grid-template-columns:1fr 1fr"],
  .contact-form-card [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .quote-modal-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .modal-meta-item {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   5. SMARTPHONES TRÈS ÉTROITS (max-width: 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  :root {
    --container-padding: 0.85rem;
  }

  .hero-slide .slide-title {
    font-size: 1.65rem;
  }

  .hero-slide .slide-badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.85rem;
  }

  .contact-info-card,
  .contact-form-card {
    padding: 1.25rem 0.85rem;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.825rem;
  }
}

/* --------------------------------------------------------------------------
   6. ACCESSIBILITÉ : 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-behavior: auto !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-zoom {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero-slide {
    transition: opacity 0.2s ease !important;
  }

  .hero-slide-bg {
    transition: none !important;
    transform: none !important;
  }

  .btn-whatsapp-float::before {
    animation: none !important;
  }

  .indicator-dot.active .indicator-fill {
    animation: none !important;
    width: 100% !important;
  }

  #preloader {
    display: none !important;
  }
}
