/* MGD Core 2.12.11 — standard mobile vérifié sur les familles de pages.
 * Référence du hero : Formation MGD PRO, variable --mgd-hero-offset-top: 34px.
 * Une colonne : UNIQUEMENT les grilles de cartes et les compositions
 * identifiées sur Accueil, À propos, Éducation, Troubles, Formation, Shop,
 * villes, troubles thématiques, Contact et FAQ.
 * Les carrousels .mgd-case-grid / .mgd-story-grid et les listes simples
 * sont intentionnellement EXCLUS afin de préserver leur fonctionnement.
 * Tous les réglages sont limités aux vrais smartphones <= 767 px.
 */
@media screen and (max-width: 767px) {
  /* Étend le repère de Formation aux autres héros, sans changer leur contenu.
   * Les héros à padding inline!important utilisent cette variable à l'affichage.
   * Formation (page-id-12101) est laissée telle quelle. */
  html body.mgd-core-body:not(.page-id-12101) .mgd-home-v2 {
    --mgd-hero-offset-top: 34px !important;
    --mgd-home-hero-top: 34px !important;
    --mgd-city-hero-padding-top: 34px !important;
  }
  /* Pages villes : l'ancien inline!important est déjà neutralisé par le thème. */
  html body.mgd-core-body .mgd-home-v2 .mgd-city-page.mgd-city-page.mgd-city-page > section.mgd-city-luxe[data-mgd-bg-home="hero"] {
    padding-top: 34px !important;
    margin-top: 0 !important;
  }
  /* Shop : héros indépendant, sans variable MGD PRO dans son HTML. */
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store > section.mgd-store-hero {
    padding-top: 34px !important;
    margin-top: 0 !important;
  }
  /* FAQ : possède son propre conteneur, mais garde le même repère. */
  html body.mgd-core-body .mgd-home-v2.mgd-faq-page.mgd-faq-page > section.mgd-faq-hero[data-mgd-bg-home="hero"] {
    --mgd-hero-offset-top: 34px !important;
  }

  /* Grilles dont les éléments sont réellement des cartes, informations ou étapes.
   * Le quadruple sélecteur d'ID est nécessaire : les anciennes pages possèdent
   * jusqu'à trois répétitions d'ID avec !important après les styles du thème. */
  html body.mgd-core-body .mgd-home-v2 #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content :is(
    .mgdp-facts,
    .mgd-duo-grid,
    .mgd-offer-grid,
    .mgd-journey-list,
    .mgdp-field-grid,
    .mgdp-fit-grid,
    .mgdp-v4-profiles,
    .mgdp-v4-phases,
    .mgdp-premium-steps,
    .mgdp-premium-partner-pair,
    .mgdp-application-flow,
    .mgd-comparison-duo-grid,
    .mgd-separation-duo-grid,
    .mgd-puppy-work-grid,
    .mgd-why-grid,
    .mgd-zone-grid,
    .mgd-content-luxe,
    .mgd-contact-intro-grid
  ),
  html body.mgd-core-body .mgd-home-v2 .mgd-city-page.mgd-city-page.mgd-city-page.mgd-city-page :is(
    .mgd-why-grid,
    .mgd-zone-grid,
    .mgd-content-luxe,
    .mgd-two-lists
  ),
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store :is(
    .mgd-store-grid,
    .mgd-store-partnergrid,
    .mgd-shop-advice-grid,
    .mgd-shop-hero-grid
  ) {
    box-sizing: border-box !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  /* Sections de cartes ou listes d'étapes qui peuvent utiliser flex en héritage. */
  html body.mgd-core-body .mgd-home-v2 #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content :is(
    section.mgd-pillars,
    .mgdp-v4-profiles,
    .mgdp-v4-phases,
    .mgdp-premium-steps,
    .mgdp-premium-partner-pair,
    .mgdp-application-flow,
    .mgdp-fit-grid
  ),
  html body.mgd-core-body .mgd-home-v2 .mgd-city-page.mgd-city-page.mgd-city-page.mgd-city-page > section.mgd-pillars {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  /* Les grands blocs contenant deux colonnes d'informations (non-carrousels). */
  html body.mgd-core-body .mgd-home-v2 #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content :is(
    .mgd-duo-grid,
    .mgd-comparison-duo-grid,
    .mgd-separation-duo-grid,
    .mgd-puppy-work-grid,
    .mgd-why-grid,
    .mgd-contact-intro-grid,
    .mgdp-field-grid
  ) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  /* Shop : les catégories sont en display:contents dans un parent 4 colonnes.
   * Modifier .mgd-store-grid seul ne suffit pas : c'est le panneau actif
   * qui doit avoir une seule colonne. Le sélecteur :not([hidden]) conserve
   * le masquage et la navigation du filtre produits. */
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store .mgd-store-sheet-panel:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-columns: minmax(0, 1fr) !important;
  }
  /* Boutique : pas de display:grid!important sur les grilles masquables
   * (filtres produits) : [hidden] et le JS continuent à fonctionner. */
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store .mgd-store-grid > .mgd-store-card,
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store .mgd-store-partnergrid > .mgd-store-partner,
  html body.mgd-core-body #mgd-store-root#mgd-store-root#mgd-store-root.mgd-store .mgd-shop-advice-grid > .mgd-shop-advice-card {
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  /* Même protection contre les cartes forcées à 50 % dans les pages historiques. */
  html body.mgd-core-body .mgd-home-v2 #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content :is(
    .mgdp-facts > .mgdp-fact,
    .mgd-duo-grid > .mgd-duo-card,
    .mgd-offer-grid > .mgd-offer-card,
    .mgdp-field-grid > .mgdp-field-card,
    .mgdp-fit-grid > .mgdp-fit-card,
    .mgdp-v4-profiles > .mgdp-v4-profile,
    .mgdp-v4-phases > .mgdp-v4-phase,
    .mgd-comparison-duo-grid > .mgd-comparison-duo-card,
    .mgd-separation-duo-grid > .mgd-separation-duo-card,
    .mgd-puppy-work-grid > .mgd-puppy-work-card,
    section.mgd-pillars > .mgd-pillar
  ),
  html body.mgd-core-body .mgd-home-v2 .mgd-city-page.mgd-city-page.mgd-city-page.mgd-city-page > section.mgd-pillars > .mgd-pillar {
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ================================================================
   MGD Core 2.12.12 — mobile corrections verified against source DOM.
   Only phone widths. Avoid touching the existing desktop layouts.
   ================================================================ */
@media screen and (max-width: 767px) {
  /* Le correctif sticky de l'accueil (tous écrans) est dans shell.css. */

  /* Formation / Méthode : the outer list was one column, but each `<li>`
     still used a 76px + 1fr nested grid, crushing the cards. Stack the
     badge, its label and the card in a single full-width vertical flow. */
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-steps,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-steps::before,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-list::before {
    content: none !important;
    display: none !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-step,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-step {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    gap: 16px !important;
    padding: 0 !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-step-head,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-station {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: stretch !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 10px !important;
    padding: 4px 0 0 !important;
    text-align: center !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-step-head .mgdp-premium-step-node,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-station .mgdp-application-node {
    flex: 0 0 72px !important;
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 auto !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-step-label,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-number {
    display: block !important;
    max-width: 100% !important;
    width: auto !important;
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    text-align: center !important;
  }
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-methode .mgdp-premium-step-card,
  html body.mgd-core-body.page-id-12101 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-pro-redesign
  #mgdp-candidature .mgdp-application-card {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* À propos / Mon parcours: the page CSS uses a 2-ID grid selector, so
     its 1-ID mobile override loses and leaves a narrow text column.
     Stack text and photo; do not change other page image layouts. */
  html body.mgd-core-body.page-id-12798 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-mgdpro-inspired
  .mgd-method-science {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 20px !important;
  }
  html body.mgd-core-body.page-id-12798 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-mgdpro-inspired
  .mgd-method-science > :is(.mgd-method-science__body, .mgd-method-science__media) {
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  html body.mgd-core-body.page-id-12798 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-mgdpro-inspired
  .mgd-method-science__text {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  html body.mgd-core-body.page-id-12798 .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content.mgd-mgdpro-inspired
  .mgd-method-science__media img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
  }
}


/* ================================================================
   MGD Core 2.12.13 — remediation mobile: colonnes compressees.
   Provenance: inspection des 20 pages WP, captures utilisateur
   2026-11-16, controles de cascade sur les composants partages.
   Point important : styles des pages en HTML apres CSS du theme.
   On cible les composants reels, sans bloquer le sticky global,
   sans modifier les carrousels ni les mises en page >=768px.
   ================================================================ */
@media screen and (max-width: 767px) {
  /* METHODE SCIENTIFIQUE: Accueil, Education, A propos.
     Une ancienne regle desktop a deux ID forcait un texte de ~140px
     et une image alignee a droite. Une seule colonne texte / photo. */
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    justify-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: clamp(18px, 5vw, 26px) !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science > :is(.mgd-method-science__body, .mgd-method-science__media) {
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    justify-self: stretch !important;
    margin-inline: 0 !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science :is(.mgd-method-science__text, .mgd-method-science__body, .mgd-block-head) {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science .mgd-eyebrow {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    text-wrap: wrap !important;
    letter-spacing: .075em !important;
    line-height: 1.4 !important;
    font-size: clamp(.76rem, 3.1vw, .9rem) !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science :is(h2, h3, p, li),
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science__media img {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-method-science__media img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  /* PANNEAUX CHIOT / CHIEN ADULTE: Education et autres mises en page
     utilisant mgd-split-block avec deux panneaux article.
     La declaration desktop !important forcait repeat(2,1fr), et
     le parent masquait les caracteres qui debordaient a droite. */
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-split-block:has(> .mgd-panel) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: clamp(12px, 3.5vw, 18px) !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-split-block:has(> .mgd-panel) > .mgd-panel {
    box-sizing: border-box !important;
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding-inline: clamp(17px, 5vw, 24px) !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-split-block:has(> .mgd-panel) > .mgd-panel :is(.mgd-eyebrow, h2, h3, h4, p, ul, ol, a) {
    box-sizing: border-box !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content#mgd-main-content#mgd-main-content
  .mgd-split-block:has(> .mgd-panel) > .mgd-panel .mgd-eyebrow {
    width: 100% !important;
    letter-spacing: .085em !important;
    font-size: clamp(.76rem, 3.1vw, .9rem) !important;
    line-height: 1.4 !important;
  }

  /* Controle preventif sur les conteneurs effectivement presents.
     Ne vise ni images de carrousels ni éléments du menu fixe. */
  html body.mgd-core-body .mgd-home-v2
  #mgd-main-content#mgd-main-content :is(.mgd-wrap, .mgd-wrap--content, .mgdp-wrap, .mgd-section-heading) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}
