/* ==========================================================================
   PADEL-RAQUETTE — MOBILE OPTIMISATIONS
   Chargé en dernier. Standardise les breakpoints et corrige les problèmes mobile.
   Stratégie mobile-first : ce fichier ne corrige QUE ce qui ne va pas.
   ==========================================================================

   BREAKPOINTS STANDARDS DU PROJET :
   - Mobile (XS) : 0-479px       → adaptation lourde
   - Mobile (S)  : 480-767px     → adaptation moyenne
   - Tablette    : 768-1023px    → adaptation légère
   - Desktop     : 1024px+       → layout pleine largeur

   ========================================================================== */


/* ==========================================================================
   GLOBAL — Empêcher tout débordement horizontal
   ========================================================================== */

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

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

/* Touch targets ≥ 44px sur mobile */
@media (max-width: 1024px) {
  button, a.btn, .btn, .pill, .header-nav a, .footer-col a,
  .header-cta, .filter-reset {
    min-height: 44px;
  }
}


/* ==========================================================================
   TYPO RESPONSIVE — Tailles ajustées par breakpoint
   ========================================================================== */

@media (max-width: 767px) {
  :root {
    --text-2xl: 32px;
    --text-3xl: 40px;
    --text-4xl: 56px;
    --text-5xl: 64px;
    --gutter: 16px;
  }

  /* H1 hero : ne jamais dépasser la largeur */
  .home-hero__title,
  .home-hero h1,
  .clubs-hero h1,
  .club-detail-hero h1 {
    font-size: clamp(40px, 13vw, 72px) !important;
    line-height: 0.95 !important;
    letter-spacing: -0.02em !important;
  }

  /* H2 sections */
  h2,
  .section-head h2,
  .feature-card h3,
  .tactic-feature h3,
  .newsletter-text h2 {
    font-size: clamp(28px, 7vw, 40px) !important;
    line-height: 1 !important;
  }

  /* Lede plus lisible */
  .lede {
    font-size: 17px !important;
    line-height: 1.5 !important;
  }

  /* Stats : éviter que les chiffres soient trop gros */
  .stat-item .stat-num,
  .hero-stat .num {
    font-size: clamp(32px, 9vw, 48px) !important;
  }
}

@media (max-width: 479px) {
  :root {
    --text-2xl: 28px;
    --text-3xl: 36px;
    --text-4xl: 48px;
    --text-5xl: 56px;
    --gutter: 14px;
  }

  /* Marges sections plus serrées */
  .section,
  .home-hero,
  .clubs-hero,
  .club-detail-hero,
  .feature-block,
  .tests-section,
  .tactic-section,
  .clubs-section,
  .articles-section,
  .newsletter-section,
  .clubs-listing,
  .regions-section,
  .nearby-section,
  .stats-strip {
    padding-block: var(--space-7);
  }
}


/* ==========================================================================
   HEADER — Optimisations mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  /* Logo plus compact en mobile */
  .header-logo svg,
  .brand__symbol {
    width: 32px !important;
    height: 32px !important;
  }

  .header-logo-text .pad,
  .brand__text {
    font-size: 18px !important;
  }

  .header-logo-text .raq {
    font-size: 12px !important;
  }
}

@media (max-width: 767px) {
  .header-inner,
  .site-header__inner {
    padding-block: var(--space-3) !important;
  }
}


/* ==========================================================================
   HERO HOME — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .home-hero-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-5) !important;
  }

  .home-hero-meta,
  .home-hero__meta {
    text-align: left !important;
    padding-bottom: 0 !important;
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .home-hero {
    padding-block: var(--space-7) var(--space-6) !important;
  }

  .home-hero-actions,
  .home-hero__actions {
    width: 100%;
  }

  .home-hero-actions .btn,
  .home-hero__actions .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
    text-align: center;
  }
}


/* ==========================================================================
   STATS STRIP — Adaptation mobile
   ========================================================================== */

@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-5) !important;
    text-align: left;
  }

  .stat-item {
    text-align: center;
  }
}


/* ==========================================================================
   FEATURE BLOCKS / PILIERS — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .feature-grid,
  .piliers__grid {
    grid-template-columns: 1fr !important;
  }

  .feature-card,
  .piliers__card {
    border-right: none !important;
  }
}


/* ==========================================================================
   TESTS RAQUETTES — Adaptation mobile
   ========================================================================== */

@media (max-width: 767px) {
  .tests-grid {
    grid-template-columns: 1fr !important;
  }

  .racket-card {
    padding: var(--space-4) !important;
  }

  .racket-img {
    aspect-ratio: 4/3 !important;
  }

  .racket-img img,
  .racket-img svg {
    width: 50% !important;
  }

  .racket-score {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .tests-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   TACTIQUE — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .tactic-grid {
    grid-template-columns: 1fr !important;
  }

  .tactic-feature {
    min-height: 240px !important;
  }
}

@media (max-width: 767px) {
  .tactic-feature h3 {
    font-size: clamp(28px, 7vw, 40px) !important;
  }

  .tactic-section::before {
    font-size: 60vw !important;
  }
}


/* ==========================================================================
   CLUBS — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .clubs-hero-content {
    grid-template-columns: 1fr !important;
  }

  .clubs-hero-stats {
    border-left: none !important;
    border-top: 1px solid var(--color-line-dark) !important;
    padding-left: 0 !important;
    padding-top: var(--space-5) !important;
  }

  .club-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .club-info-card {
    position: static !important;
  }
}

@media (max-width: 767px) {
  /* Carte plus haute pour la lisibilité */
  .clubs-map {
    height: 360px !important;
  }

  .club-mini-map {
    height: 240px !important;
  }

  /* Hero stats : 2 colonnes au lieu de 4 */
  .clubs-hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Filtres : scroll horizontal fluide */
  .filters-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  .filter-group {
    flex-shrink: 0 !important;
  }

  .filter-pills {
    flex-wrap: nowrap !important;
  }

  .pill {
    white-space: nowrap;
  }

  /* Cards clubs : 1 colonne */
  .clubs-grid {
    grid-template-columns: 1fr !important;
  }

  /* Régions : 2 colonnes mini */
  .regions-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3) !important;
  }

  .region-card {
    min-height: 130px !important;
    padding: var(--space-4) !important;
  }

  .region-card h3 {
    font-size: 18px !important;
  }

  /* Fiche club : breadcrumb scroll */
  .club-detail-breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  /* Fiche club : info card en bas, pas en sticky */
  .club-info-card {
    margin-top: var(--space-6);
  }

  /* Info row : labels en haut, valeurs en dessous */
  .club-info-row {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .clubs-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   ARTICLES — Adaptation mobile
   ========================================================================== */

@media (max-width: 767px) {
  .articles-grid {
    grid-template-columns: 1fr !important;
  }

  .article-card h4 {
    font-size: 18px !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   NEWSLETTER — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .newsletter-inner {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  .newsletter-form {
    padding: var(--space-5) !important;
  }

  .newsletter-form input[type="email"] {
    font-size: 16px !important; /* iOS zoom prevention */
  }
}


/* ==========================================================================
   FOOTER — Adaptation mobile
   ========================================================================== */

@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: var(--space-5) !important;
  }

  .footer-brand {
    grid-column: 1 / -1 !important;
  }

  .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-3) !important;
  }

  .footer-legal {
    flex-wrap: wrap;
    gap: var(--space-3) !important;
  }
}

@media (max-width: 479px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   POPUPS LEAFLET — Plus compactes sur mobile
   ========================================================================== */

@media (max-width: 767px) {
  .leaflet-popup-content {
    width: 240px !important;
  }

  .leaflet-popup-content .popup-title {
    font-size: 18px !important;
  }
}


/* ==========================================================================
   FILTERS — Sticky qui ne casse pas avec un header mobile
   ========================================================================== */

@media (max-width: 767px) {
  .clubs-filters {
    top: 60px !important; /* Ajusté pour header mobile plus court */
  }
}


/* ==========================================================================
   ACCESSIBILITÉ — Touch & focus
   ========================================================================== */

/* Désactiver le hover effects qui restent collés sur mobile */
@media (hover: none) {
  .article-card:hover,
  .racket-card:hover,
  .club-card:hover,
  .feature-card:hover,
  .tactic-feature:hover,
  .tactic-side:hover,
  .region-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }
}

/* Empêcher le double-tap zoom sur les boutons et cards */
button, a.btn, .btn, .pill, .article-card, .racket-card, .club-card, .feature-card {
  touch-action: manipulation;
}


/* ==========================================================================
   TECHNIQUES — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .tech-hero-content {
    grid-template-columns: 1fr !important;
  }

  .tech-hero-stats {
    border-left: none !important;
    border-top: 1px solid rgba(245, 241, 232, 0.15) !important;
    padding-left: 0 !important;
    padding-top: var(--space-5) !important;
  }

  .tech-pillars-grid {
    grid-template-columns: 1fr !important;
  }

  .tech-pillar-feature {
    min-height: 240px !important;
  }

  .tech-detail-grid {
    grid-template-columns: 1fr !important;
  }

  .tech-sidebar {
    position: static !important;
  }
}

@media (max-width: 767px) {
  /* Hero compact sur mobile */
  .tech-hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Tech cards en 1 colonne */
  .tech-grid {
    grid-template-columns: 1fr !important;
  }

  /* Cat grid en 2 colonnes */
  .cat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3) !important;
  }

  .cat-card {
    min-height: 110px !important;
    padding: var(--space-4) !important;
  }

  /* Meta bar du hero détail : passe en grille */
  .tech-detail-meta-bar {
    gap: var(--space-4) !important;
  }

  .tech-meta-item {
    flex: 1 1 calc(50% - var(--space-2));
    min-width: 130px;
  }

  /* Breadcrumb scrollable */
  .tech-detail-breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  /* Erreurs : 1 colonne */
  .tech-errors ul {
    grid-template-columns: 1fr !important;
  }

  /* Filtres : scroll horizontal */
  .tech-filters .filters-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   RÈGLES — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .regles-hero-content {
    grid-template-columns: 1fr !important;
  }

  .regles-hero-stats {
    border-left: none !important;
    border-top: 1px solid rgba(245, 241, 232, 0.15) !important;
    padding-left: 0 !important;
    padding-top: var(--space-5) !important;
  }
}

@media (max-width: 767px) {
  .regles-hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .summary-grid {
    grid-template-columns: 1fr !important;
  }

  .regles-grid {
    grid-template-columns: 1fr !important;
  }

  .regle-card {
    min-height: 180px !important;
  }

  .regle-compare {
    grid-template-columns: 1fr !important;
  }

  .regle-detail-breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  .regle-key-box {
    padding: var(--space-5) !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .regles-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   PAGES MARQUES — Adaptation mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .marque-hero-content {
    grid-template-columns: 1fr !important;
  }

  .marque-hero-stats {
    border-left: none !important;
    border-top: 1px solid rgba(245, 241, 232, 0.15) !important;
    padding-left: 0 !important;
    padding-top: var(--space-5) !important;
  }

  .marque-philosophy-grid {
    grid-template-columns: 1fr !important;
  }

  .marque-strengths {
    position: static !important;
  }
}

@media (max-width: 767px) {
  .marque-hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .marque-meta-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-3) !important;
  }

  .marque-hero-breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
  }

  .marque-players-list {
    grid-template-columns: 1fr !important;
  }

  .marque-others-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--space-2) !important;
  }
}

@media (max-width: 479px) {
  .marque-meta-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}


/* ==========================================================================
   UTILITIES MOBILE
   ========================================================================== */

@media (max-width: 767px) {
  .hide-on-mobile { display: none !important; }
}

@media (min-width: 768px) {
  .show-on-mobile { display: none !important; }
}
