/* ===== RESPONSIVE STYLES ===== */
/* Mobile-first approach avec breakpoints */

/* ===== BREAKPOINTS ===== */
/*
  - Mobile: < 768px (default)
  - Tablet: 768px - 1023px
  - Desktop: ≥ 1024px
*/

/* ===== TABLET (768px - 1023px) ===== */
@media (max-width: 1023px) {

  /* Typography */
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
  }

  /* Container */
  .container,
  .container-wide {
    padding: 0 var(--spacing-md);
  }

  /* Section Spacing */
  section {
    padding: var(--spacing-3xl) 0;
  }

  /* Grids */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  /* Process Steps */
  .process-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xl);
  }

  .step::after {
    display: none;
  }
}

/* ===== MOBILE (< 768px) ===== */
@media (max-width: 767px) {

  /* Typography */
  :root {
    --text-6xl: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  html {
    font-size: 16px;
    /* Increased from 14px for better readability */
  }

  body {
    line-height: 1.5;
    /* Improved readability */
  }

  /* Spacing */
  section {
    padding: var(--spacing-2xl) 0;
  }

  /* ===== HEADER / NAVIGATION ===== */
  .header-content {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: var(--text-xl);
    gap: var(--spacing-sm);
  }

  .logo-image {
    height: 40px;
    max-width: 100px;
  }

  .logo-text {
    font-size: var(--text-base);
  }

  /* Mobile Menu */
  .menu-toggle {
    display: flex;
    z-index: var(--z-header);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--color-bg-darker);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-4xl) var(--spacing-xl);
    gap: var(--spacing-lg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    transition: right var(--transition-normal);
    z-index: calc(var(--z-header) - 1);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    font-size: var(--text-lg);
    width: 100%;
    padding: var(--spacing-sm) 0;
  }

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

  /* Dropdown in Mobile */
  .nav-item {
    width: 100%;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    padding-left: var(--spacing-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }

  .nav-item.active .nav-dropdown {
    max-height: 500px;
  }

  .nav-dropdown-link {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-base);
  }

  .dropdown-arrow {
    margin-left: auto;
  }

  .nav-link.has-dropdown {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Menu Toggle Animation */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Overlay when menu is open */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: calc(var(--z-header) - 2);
  }

  .nav-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  /* ===== HERO SECTION (OPTIMIZED) ===== */
  .hero {
    min-height: auto;
    padding-top: 80px;
    padding-bottom: var(--spacing-3xl);
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 32px);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
  }

  .hero-title br {
    display: none;
  }

  .hero-subtitle {
    font-size: 15px;
    margin-bottom: var(--spacing-lg);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-cta {
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
  }

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

  .hero-cta .btn-outline {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-sm);
  }

  /* Réduire confetti sur mobile */
  #confettiCanvas {
    opacity: 0.3;
  }

  /* Trust chips mobile */
  .trust-chips {
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
  }

  .chip {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .btn-link {
    font-size: var(--text-sm);
  }

  /* ===== BUTTONS ===== */
  .btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-sm);
  }

  .btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--text-base);
  }

  /* ===== SECTION HEADERS ===== */
  .section-header {
    margin-bottom: var(--spacing-2xl);
  }

  .section-tag {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
  }

  .section-title {
    font-size: clamp(var(--text-2xl), 6vw, var(--text-4xl));
    margin-bottom: var(--spacing-sm);
  }

  .section-description {
    font-size: var(--text-base);
  }

  /* ===== GRIDS ===== */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  /* ===== SERVICES CAROUSEL (MOBILE) ===== */
  .services-carousel-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 0 var(--spacing-md);
  }

  .services-carousel-wrapper::-webkit-scrollbar {
    display: none;
  }

  .services-carousel {
    display: flex;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-md);
  }

  .service-card-mobile {
    flex: 0 0 75%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  .service-card-mobile .card {
    height: 100%;
    padding: var(--spacing-lg);
  }

  .service-card-mobile .service-description {
    font-size: var(--text-sm);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .service-card-mobile .service-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  .carousel-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-lg);
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all var(--transition-fast);
  }

  .carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--color-cyan);
  }

  .view-all-services {
    display: block;
    text-align: center;
    margin-top: var(--spacing-xl);
  }

  /* ===== STICKY BOTTOM CTA BAR (MOBILE) ===== */
  .sticky-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 11, 16, 0.98);
    backdrop-filter: blur(10px);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(0, 217, 255, 0.1);
    z-index: var(--z-header);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
  }

  .sticky-cta-bar.visible {
    transform: translateY(0);
  }

  .sticky-cta-bar .btn {
    flex: 1;
    padding: var(--spacing-sm);
    font-size: var(--text-sm);
    justify-content: center;
  }

  .sticky-cta-bar .btn-whatsapp {
    background: #25D366;
    color: white;
  }

  /* ===== 2-COLUMN GALLERY GRID ===== */
  .gallery-grid-mobile {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .gallery-grid-mobile .gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: var(--radius-md);
  }

  .gallery-grid-mobile .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ===== SERVICE CARDS ===== */
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
  }

  .service-title {
    font-size: var(--text-lg);
  }

  .service-description {
    font-size: var(--text-sm);
  }

  /* ===== FEATURE CARDS ===== */
  .feature-card {
    padding: var(--spacing-lg);
  }

  .feature-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
  }

  /* ===== PROCESS STEPS ===== */
  .process-steps {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .step {
    padding: var(--spacing-lg);
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: var(--text-xl);
    margin-bottom: var(--spacing-md);
  }

  .step::after {
    display: none;
  }

  /* ===== GALLERY ===== */
  .gallery-slider {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* ===== TESTIMONIALS ===== */
  .testimonial-card {
    padding: var(--spacing-lg);
  }

  .testimonial-text {
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-lg);
  }

  .author-avatar {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }

  /* ===== CTA SECTION ===== */
  .cta-title {
    font-size: clamp(var(--text-2xl), 6vw, var(--text-3xl));
  }

  .cta-text {
    font-size: var(--text-base);
    margin-bottom: var(--spacing-xl);
  }

  .cta-buttons {
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
  }

  .cta-buttons .btn {
    width: 100%;
  }

  /* ===== FOOTER ===== */
  .footer {
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .footer-section h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--spacing-md);
  }

  .footer-links {
    gap: var(--spacing-xs);
  }

  .social-links {
    justify-content: center;
  }

  .footer-bottom {
    font-size: 0.75rem;
    padding-top: var(--spacing-md);
  }

  /* ===== CARDS (OPTIMIZED PADDING) ===== */
  .card {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
  }

  /* ===== WHY US - 3 POINTS ONLY ON MOBILE ===== */
  .why-us-section .grid-4>*:nth-child(n+4) {
    display: none;
  }

  .why-us-section .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* ===== TESTIMONIALS SLIDER (MOBILE) ===== */
  .testimonials-slider {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--spacing-md));
    padding: 0 var(--spacing-md);
  }

  .testimonials-slider::-webkit-scrollbar {
    display: none;
  }

  .testimonials-grid {
    display: flex;
    gap: var(--spacing-md);
  }

  .testimonial-card-wrapper {
    flex: 0 0 90%;
    scroll-snap-align: center;
  }

  /* ===== WHATSAPP FLOAT ===== */
  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    bottom: 20px;
    right: 20px;
  }

  /* ===== FLOATING BALLOONS (reduce on mobile) ===== */
  .balloon {
    width: 40px;
    height: 50px;
  }
}

/* ===== VERY SMALL MOBILE (< 480px) ===== */
@media (max-width: 479px) {
  :root {
    --spacing-4xl: 3rem;
    --spacing-3xl: 2.5rem;
    --spacing-2xl: 2rem;
  }

  .container,
  .container-wide {
    padding: 0 var(--spacing-sm);
  }

  section {
    padding: var(--spacing-xl) 0;
  }

  /* Hero */
  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-sm);
  }

  /* Buttons */
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
  }

  /* Cards */
  .card {
    padding: var(--spacing-md);
  }

  /* Process */
  .step {
    padding: var(--spacing-md);
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }

  /* Testimonials */
  .testimonial-card {
    padding: var(--spacing-md);
  }

  .stars {
    font-size: var(--text-sm);
  }
}

/* ===== LARGE DESKTOP (≥ 1400px) ===== */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }

  .container-wide {
    max-width: 1600px;
  }

  /* Hero */
  .hero-title {
    font-size: var(--text-6xl);
  }

  /* Grids */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== LANDSCAPE ORIENTATION (mobile/tablet) ===== */
@media (max-width: 1023px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--spacing-4xl) 0;
  }

  section {
    padding: var(--spacing-2xl) 0;
  }
}

/* ===== TOUCH DEVICES ===== */
@media (hover: none) and (pointer: coarse) {

  /* Augmenter la taille des zones cliquables */
  .btn,
  .nav-link,
  .social-link {
    min-height: 44px;
    min-width: 44px;
  }

  /* Désactiver certains effets hover */
  .card:hover,
  .feature-card:hover,
  .testimonial-card:hover {
    transform: none;
  }

  /* Garder les effets au tap */
  .card:active {
    transform: scale(0.98);
  }
}

/* ===== PRINT STYLES ===== */
@media print {

  .header,
  .whatsapp-float,
  .floating-balloons,
  .hero-background,
  .footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero {
    min-height: auto;
    page-break-after: always;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  /* Optimiser les images et bordures pour Retina */
  .card {
    border-width: 0.5px;
  }
}

/* ===== DARK MODE SUPPORT (future) ===== */
@media (prefers-color-scheme: light) {
  /* Si on veut supporter le mode clair automatiquement */
  /* body {
    --color-bg-dark: #f5f5f5;
    --color-text-primary: #0B0B10;
  } */
}