/*
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0
Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/


/* ==========================================================================
   TABLE DES MATIÈRES
   ==========================================================================
   1.  Variables & Base
   2.  Header — Sticky, logo swap, navigation
   3.  Megamenu — Max Mega Menu (desktop + mobile)
   4.  Domaines — Vignettes avec overlay
   5.  Cards — Hover effects
   6.  Slider — Boutons navigation
   7.  Shortcode — Taxonomies (terms_list)
   8.  Featured Image — Overlay
   9.  Articles — Contenu migré (Gutenberg / post-content)
   10. WPML — Language switcher pill
   11. Utilitaires & Pages spécifiques
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES & BASE
   ========================================================================== */

:root {
  /* Couleurs */
  --color-primary: #009ED3;
  --color-primary-dark: #007aa3;
  --color-primary-alt: #099ED3;
  --color-white: #ffffff;
  --color-dark: #111827;
  --color-border: #e7e7e7;

  /* Typo */
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-alt: "Source Sans Pro", sans-serif;

  /* Transitions */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.2s ease;

  /* Layout */
  --qd-header-h: 96px;
  --qd-container-w: 1200px;
  --qd-gutter: 20px;
  --qd-panel-minh: 260px;
  --qd-panel-vpad: 24px;
}


/* ==========================================================================
   2. HEADER — Sticky, logo swap, navigation
   ========================================================================== */

/* --- Header inner layout --- */
.site-header .header-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
}

.site-header {
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  z-index: 999;
  background: transparent;
  box-shadow: none;
}

/* --- Logo swap (light ↔ dark) --- */
.site-header .logo-dark {
  display: none;
}

.site-header.is-white .logo-dark {
  display: block;
}

.site-header.is-white .logo-light {
  display: none;
}

/* --- Navigation links (default = transparent header, white text) --- */
.site-header .site-nav .elementor-item {
  color: var(--color-white);
  transition: color 0.2s ease;
}

/* --- White mode (scrolled / burger open) --- */
.site-header.is-white {
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.site-header.is-white .site-nav .elementor-item {
  color: var(--color-primary);
}

.site-header.is-white .site-nav .elementor-item:hover,
.site-header.is-white .site-nav .elementor-item.elementor-item-active {
  color: var(--color-primary-dark);
}

/* --- Sub-menu (dropdown / mobile) --- */
.site-header.is-white .site-nav .sub-menu a {
  color: var(--color-dark);
}

.site-header.is-white .site-nav .sub-menu a:hover {
  color: var(--color-primary);
}

/* --- Elementor location overrides (specificity boost) --- */
header.elementor-location-header .site-header.is-white {
  background-color: var(--color-white) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}

header.elementor-location-header .site-header.is-white .site-nav nav.elementor-nav-menu--main a.elementor-item {
  color: var(--color-primary) !important;
}

header.elementor-location-header .site-header.is-white .site-nav nav.elementor-nav-menu--dropdown a.elementor-item,
header.elementor-location-header .site-header.is-white .site-nav nav.elementor-nav-menu--dropdown a.elementor-sub-item {
  color: var(--color-primary) !important;
}

header.elementor-location-header .site-header .logo-dark {
  display: none !important;
}

header.elementor-location-header .site-header.is-white .logo-dark {
  display: block !important;
}

header.elementor-location-header .site-header.is-white .logo-light {
  display: none !important;
}


/* ==========================================================================
   3. MEGAMENU — Max Mega Menu (desktop + mobile)
   ========================================================================== */

/* --- Supprimer le toggle + dropdown mobile natif Hello Elementor (doublon) --- */
.site-navigation-toggle-holder,
.site-navigation-dropdown {
  display: none !important;
}

/* --- Anti-clipping : overflow visible sur toute la chaîne --- */
#site-header,
#site-header .header-inner,
#site-header .site-navigation,
#site-header .mega-menu-wrap,
#site-header .mega-menu {
  overflow: visible !important;
}

/* --- Z-index au-dessus du hero --- */
#site-header {
  position: relative;
  z-index: 9999;
}

#site-header .mega-menu-wrap {
  position: relative;
  z-index: 9999;
}

/* ─── 3a. DESKTOP (min-width: 1025px) ─── */
@media only screen and (min-width: 1025px) {

  /* Panneau dropdown full-width fixed */
  #site-header #mega-menu-item-10006>.mega-sub-menu,
  #site-header #mega-menu-item-7595>.mega-sub-menu {
    width: 100vw !important;
    max-width: 100vw !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 132px !important;
    transform: none !important;
    margin: 0 !important;
    box-sizing: border-box;
    z-index: -1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: center !important;
    min-height: var(--qd-panel-minh) !important;
    padding: var(--qd-panel-vpad) 0 !important;
    border-top: 3px solid var(--color-primary) !important;
  }

  /* Pont invisible au-dessus du panneau (desktop) : couvre la zone comprise entre
     le bas du li parent et le haut du panneau. Le panneau restant un descendant du li,
     la souris ne « sort » plus de l'item pendant la descente vers les vignettes : Max
     Mega Menu ne retire donc plus mega-toggle-on et le panneau ne se ferme plus.
     z-index:-1 : la couche passe sous les items du header (aucun clic intercepté). */
  #site-header #mega-menu-item-10006>.mega-sub-menu::before,
  #site-header #mega-menu-item-7595>.mega-sub-menu::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 100% !important;
    height: 100vh !important;
    z-index: -1 !important;
  }

  /* Rows centrées dans le panneau */
  #site-header #mega-menu-item-10006>.mega-sub-menu>li.mega-menu-row,
  #site-header #mega-menu-item-7595>.mega-sub-menu>li.mega-menu-row {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto !important;
    padding-left: var(--qd-gutter);
    padding-right: var(--qd-gutter);
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    align-self: center !important;
    transform: translateX(-50%);
    left: 50%;
  }

  /* Container principal du panneau */
  #site-header #mega-menu-10006-0,
  #site-header #mega-menu-10006-1,
  #site-header #mega-menu-7595-0 {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--qd-gutter) !important;
    padding-right: var(--qd-gutter) !important;
    box-sizing: border-box;
  }

  /* Sub-menu items centrés */
  #site-header #mega-menu-10006-0>ul.mega-sub-menu,
  #site-header #mega-menu-10006-1>ul.mega-sub-menu,
  #site-header #mega-menu-7595-0>ul.mega-sub-menu {
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    justify-items: center;
  }

  /* Header hover : fond blanc + texte primary + logo 2026 */
  #site-header:has(#mega-menu-menu-1 > li.mega-menu-item:hover) {
    background-color: #fff !important;
  }

  #site-header:has(#mega-menu-menu-1 > li.mega-menu-item:hover) #mega-menu-menu-1>li.mega-menu-item>a.mega-menu-link {
    color: var(--color-primary) !important;
  }

  #site-header:has(#mega-menu-menu-1 > li.mega-menu-item:hover) .custom-logo {
    content: url('/wp-content/uploads/Logo-CMS-AUTOMATSIME-2026.png') !important;
  }

  /* Hover / focus / panneau ouvert : conserver la graisse Elementor (600) au lieu du
     `font-weight: normal` imposé par le CSS généré Max Mega Menu
     (uploads/maxmegamenu/style_fr.css, @media min-width:1025px l.217 :
      l.218-221  li.mega-menu-item > a.mega-menu-link:hover / :focus,
      l.226-229  li.mega-menu-item.mega-toggle-on > a.mega-menu-link).
     Spécificité MMM supérieure (2,3,2 contre 2,2,1) → !important nécessaire,
     même convention que la règle current/ancestor plus bas dans ce fichier. */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item>a.mega-menu-link:hover,
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item>a.mega-menu-link:focus,
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item.mega-toggle-on>a.mega-menu-link {
    font-weight: var(--e-global-typography-primary-font-weight) !important;
  }

  /* Menu principal centré entre le logo (gauche) et le sélecteur de langue (droite) */
  .site-header .header-inner>nav.site-navigation {
    display: flex;
    justify-content: center;
  }

  #mega-menu-wrap-menu-1 #mega-menu-menu-1 {
    width: 100%;
    position: relative;
    justify-content: center;
  }

  /* Sélecteur de langue WPML : élément FRÈRE de nav.site-navigation, rendu par
     template-parts/dynamic-header.php du thème enfant (il n'est plus un item de
     menu). La nav ci-dessus est en `flex: 1 1 auto` : elle occupe donc
     exactement l'espace libre entre le logo et le sélecteur ⇒ centrer les liens
     dans la nav équivaut à les centrer entre le logo et le sélecteur, sans
     réserve en pixels et sans position:absolute. */
  .site-header .header-inner>.cms-lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px;
  }

  .site-header .header-inner>.cms-lang-switcher .wpml-ls {
    position: unset;
  }

  /* La sortie mobile du sélecteur n'a pas sa place en desktop. */
  .site-header .header-inner .cms-lang-switcher--mobile {
    display: none;
  }

  /* Switcher de langue du MENU = celui qui alimente le TIROIR MOBILE (styles
     section 10b). Il est réactivé côté WPML pour être affiché sur mobile ;
     on le masque ici en desktop, où le header utilise son propre sélecteur
     (.cms-lang-switcher ci-dessus). Sans ce masquage, l'item reste dans le
     flux du ul et décale les liens du menu principal. */
  #mega-menu-item-wpml-ls-137-fr,
  #mega-menu-item-wpml-ls-137-de {
    display: none !important;
  }

  /* Switcher langue sorti du flux → n'influence plus le centrage des items */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.qdm-lang-switcher {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0 !important;
  }
}

/* --- "Nos expertises" plus léger que les autres entrées (desktop + mobile) ---
   Cause : style_fr.css (Max Mega Menu, généré, lecture seule, chargé après
   style.css) force font-weight:normal sur .mega-current-menu-item /
   .mega-current-menu-ancestor / .mega-current-page-ancestor, alors que tous
   les autres items utilisent --e-global-typography-primary-font-weight (600).
   "Nos expertises" est ancêtre de Machines spéciales / Robotique / Usinage /
   Solutions clé en main : sur ces pages il retombe donc à 400 pendant que les
   entrées inactives restent à 600. On ne met rien en gras : on réapplique la
   même valeur que les autres items, uniquement pour l'état actif/ancêtre.
   !important : conflit de spécificité égale avec style_fr.css chargé après
   style.css (même convention que la bordure .card_container_hover_animated
   plus bas). */
#mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item.mega-current-menu-item>a.mega-menu-link,
#mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item.mega-current-menu-ancestor>a.mega-menu-link,
#mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item.mega-current-page-ancestor>a.mega-menu-link {
  font-weight: var(--e-global-typography-primary-font-weight) !important;
}

/* --- Cacher les titres de bloc (h4) dans le megamenu --- */
#mega-menu-item-10006 .mega-block-title,
#mega-menu-item-7595 .mega-block-title {
  display: none;
}

/* --- Réduire les paddings des widgets et liens --- */
#mega-menu-item-10006 .widget_media_image,
#mega-menu-item-7595 .widget_media_image {
  padding-bottom: 0 !important;
}

li.mega-menu-item-object-page {
  padding-top: 0 !important;
}

/* --- Images megamenu : hauteur fixe, cover --- */
#mega-menu-item-10006 .widget_media_image img,
#mega-menu-item-7595 .widget_media_image img {
  width: 100%;
  min-height: 124px;
  height: 135px !important;
  object-fit: cover;
  border-radius: 0;
  min-width: 242px;
}

/* Image "Solutions clé en main" (ratio différent) */
#mega-menu-10006-0-3 .widget_media_image img,
#mega-menu-10006-1-3 .widget_media_image img,
#mega-menu-7595-0-3 .widget_media_image img {
  height: 124px;
  object-fit: cover;
}

/* --- Conteneur image megamenu : hauteur fixe --- */
#mega-menu-item-10006 .widget_media_image a,
#mega-menu-item-7595 .widget_media_image a {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 124px;
  height: 135px;
  max-height: 135px;
}

/* Liens megamenu : hauteur max cohérente */
#mega-sub-menu-10006 li a,
#mega-menu-item-7595 li a {
  max-height: 135px;
}

/* --- Overlay hover bleu sur les images --- */
#mega-menu-item-10006 .widget_media_image a::after,
#mega-menu-item-7595 .widget_media_image a::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #00A8D4;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 0;
  padding: 0;
}

#mega-menu-item-10006 .widget_media_image a:hover::after,
#mega-menu-item-7595 .widget_media_image a:hover::after {
  opacity: 0.6;
}

/* --- Ligne primary au-dessus de chaque lien du sous-menu --- */
#mega-menu-wrap-menu-1 li.mega-menu-column ul.mega-sub-menu>li.mega-menu-item>a.mega-menu-link::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  width: 80px !important;
  height: 2px !important;
  background: var(--color-primary) !important;
}

/* Interligne réduit dans les items du sous-menu (panneaux Nos expertises / Nos domaines) */
#mega-menu-wrap-menu-1 li.mega-menu-column ul.mega-sub-menu>li.mega-menu-item>a.mega-menu-link {
  line-height: 1.2 !important;
}

/* Espacement du 2e item sous-menu (après l'image) */
.mega-sub-menu .mega-menu-item:nth-of-type(2) {
  margin-top: 12px !important;
}

.mega-sub-menu .mega-menu-item:nth-of-type(2) a {
  padding-top: 8px !important;
}

/* ─── 3b. MOBILE / TABLETTE (max-width: 1024px) ─── */
@media (max-width: 1024px) {

  /* Menu MMM full width */
  #mega-menu-wrap-menu-1 {
    width: 100% !important;
  }

  /* Neutraliser le position:fixed du panneau desktop */
  #mega-menu-item-10006>.mega-sub-menu,
  #mega-menu-item-7595>.mega-sub-menu {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
  }

  /* Row full width */
  #mega-menu-item-10006>.mega-sub-menu>li.mega-menu-row,
  #mega-menu-item-7595>.mega-sub-menu>li.mega-menu-row {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  /* Vignettes en colonne */
  #mega-menu-10006-0>ul.mega-sub-menu,
  #mega-menu-10006-1>ul.mega-sub-menu,
  #mega-menu-7595-0>ul.mega-sub-menu {
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
  }

  #mega-menu-10006-0>ul.mega-sub-menu>li.mega-menu-column,
  #mega-menu-10006-1>ul.mega-sub-menu>li.mega-menu-column,
  #mega-menu-7595-0>ul.mega-sub-menu>li.mega-menu-column {
    max-width: none !important;
    flex: none !important;
    width: 100% !important;
  }

  /* Menu mobile scrollable */
  #mega-menu-wrap-menu-1 ul.mega-menu {
    max-height: calc(100vh - 90px) !important;
    max-height: calc(100dvh - 90px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* --- Header tablette/mobile --- */
  #site-header {
    background-color: #fff !important;
    padding: 0 !important;
    height: 90px !important;
  }

  #site-header .header-inner {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
  }

  /* Nav (hamburger) : carré bordé primary, à gauche */
  #site-header .header-inner>nav.site-navigation {
    order: -1 !important;
    flex-shrink: 0 !important;
    border: 1px solid var(--color-primary) !important;
    height: 90px !important;
    width: 90px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Sélecteur de langue : en ≤1024px la sortie desktop est masquée — la barre
     mobile a son propre agencement (hamburger à gauche, logo centré) et le
     sélecteur mobile a sa propre sortie dans le template du header. */
  #site-header .header-inner>.cms-lang-switcher {
    display: none !important;
  }

  /* MMM wrap : largeur auto dans le carré */
  #site-header .mega-menu-wrap {
    width: fit-content !important;
  }

  /* Logo centré absolument dans le header */
  #site-header .site-branding {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: block !important;
  }

  /* Logo 2026 */
  #site-header .custom-logo {
    display: none !important;
  }

  #site-header .custom-logo-link {
    display: block !important;
    width: 250px;
    height: 70px;
    background: url('/wp-content/uploads/Logo-CMS-AUTOMATSIME-2026.png') no-repeat center / contain;
  }

  /* Toggle bar : fond blanc */
  #mega-menu-wrap-menu-1 .mega-menu-toggle {
    background-color: #fff !important;
  }

  /* Toggle (hamburger) : couleur primary */
  #mega-menu-wrap-menu-1 .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner,
  #mega-menu-wrap-menu-1 .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner::before,
  #mega-menu-wrap-menu-1 .mega-menu-toggle .mega-toggle-block-0 .mega-toggle-animated-inner::after {
    background-color: var(--color-primary) !important;
  }

  /* --- Panneau off-canvas : 100vw, sous le header (90px) --- */
  #mega-menu-wrap-menu-1 .mega-menu-toggle+#mega-menu-menu-1 {
    top: 90px !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100dvh - 90px) !important;
    max-height: calc(100dvh - 90px) !important;
    left: -100vw !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 9999999999 !important;
  }

  /* --- Menu mobile ouvert : fond blanc, texte primary --- */
  #mega-menu-wrap-menu-1 .mega-menu-toggle.mega-menu-open+#mega-menu-menu-1 {
    left: 0 !important;
    width: 100vw !important;
    visibility: visible !important;
    z-index: 9999999999 !important;
    background-color: #fff !important;
    color: var(--color-primary) !important;
    align-items: center !important;
    padding-top: 40px;
  }

  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item>a.mega-menu-link {
    color: var(--color-primary) !important;
    border-bottom: solid 1px #9A9A9A !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
    text-transform: uppercase !important;
  }

  /* Ligne primary 80px au-dessus de chaque lien du sous-menu */
  #mega-menu-wrap-menu-1 li.mega-menu-column ul.mega-sub-menu>li.mega-menu-item>a.mega-menu-link {
    position: relative !important;
  }

  /* Chevron SVG sur les items SANS dropdown */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item:not(.mega-menu-item-has-children)>a.mega-menu-link::after {
    content: '' !important;
    display: inline-block !important;
    width: 13px !important;
    height: 18px !important;
    background: url('assets/chevron.svg') no-repeat center / contain !important;
    margin-left: auto !important;
  }

  /* Chevron SVG sur les items AVEC dropdown (remplace le dashicons) */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item-has-children>a.mega-menu-link>span.mega-indicator::after {
    content: '' !important;
    display: inline-block !important;
    width: 13px !important;
    height: 18px !important;
    background: url('assets/chevron.svg') no-repeat center / contain !important;
    font-family: inherit !important;
    transition: transform 0.3s ease !important;
  }

  /* Rotation 90° quand dropdown ouvert */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item-has-children.mega-toggle-on>a.mega-menu-link>span.mega-indicator::after {
    transform: rotate(90deg) !important;
  }

  .widget_media_image {
    max-width: 350px !important;
  }

  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item {
    width: 90% !important;
  }

  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.mega-menu-item.mega-toggle-on>a.mega-menu-link {
    background-color: #fff;
  }

  /* --- Menu ouvert : garder logo + hamburger visibles au-dessus du panneau --- */
  #site-header .mega-menu-toggle {
    position: relative !important;
    z-index: 3 !important;
  }

  #site-header .site-branding {
    z-index: 4 !important;
  }

  /* --- Overlay natif MMM : inutile en pleine largeur, on le supprime --- */
  #mega-menu-wrap-menu-1 .mega-menu-toggle.mega-menu-open::after {
    display: none !important;
    content: none !important;
  }

  /* --- Fond blanc forcé (menu + sous-menus) --- */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1,
  #mega-menu-wrap-menu-1 #mega-menu-menu-1 .mega-sub-menu {
    background-color: #fff !important;
  }

  /* --- Sélecteur de langue : conserver le pill sombre (#363636), pas de noir plein --- */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.qdm-lang-switcher {
    background: transparent !important;
  }

  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.qdm-lang-switcher .qdm-lang-current {
    background-color: #363636 !important;
  }

  /* --- Sélecteur de langue centré (mobile + tablette) --- */
  #mega-menu-wrap-menu-1 #mega-menu-menu-1>li.qdm-lang-switcher {
    width: auto !important;
    max-width: none !important;
    margin: 20px auto 0 !important;
    padding-top: 0 !important;
    align-self: center !important;
  }

  /* --- Second bouton Close (×) MMM : masqué, seul .mega-menu-toggle (animé en X) sert à fermer --- */
  #mega-menu-wrap-menu-1 .mega-menu-toggle~button.mega-close {
    display: none !important;
  }
}

/* ─── 3c. MOBILE PETIT ÉCRAN (max-width: 768px) ─── */
@media screen and (max-width: 768px) {
  #site-header .site-branding {
    left: 55% !important;
  }

  #site-header .custom-logo-link {
    height: 65px;
  }

  #site-header .header-inner {
    padding: 0;
  }

  /* Pas de bordure sur le panneau dropdown en mobile */
  #site-header #mega-menu-item-10006>.mega-sub-menu,
  #site-header #mega-menu-item-7595>.mega-sub-menu {
    border: none !important;
  }
}


/* ==========================================================================
   4. DOMAINES — Vignettes avec overlay
   ========================================================================== */

.domaine-item {
  position: relative;
  height: 417px;
  display: flex;
  align-items: flex-start;
  padding: 16px;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
  overflow: hidden;
  font-family: var(--font-base);
}

/* Overlay sombre */
.domaine-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.domaine-item:hover::before {
  opacity: 0;
}

/* Texte */
.domaine-item__text {
  position: relative;
  left: 0;
  margin: 0;
  z-index: 1;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.domaine-item__text p {
  margin: 0;
}

/* Tagline bandeau */
.domaine-item__tagline {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 24px 4px 10px;
  padding-left: 50px;
  background-color: var(--color-white);
  color: var(--color-primary);
  font-weight: 700;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.domaine-item:hover .domaine-item__tagline {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.domaine-item:hover .item__tagline h2 {
  background-color: var(--color-primary);
  color: var(--color-white);
  transition: all 0.25s ease;
}

.domaine-item__topline {
  padding-left: 50px;
}

/* Grille de cartes Domaines (accueil, index Domaines, Solutions clé en main) :
   le container Elementor qui enveloppe les .domaine-item n'a aucun gap défini
   (flex_gap absent côté _elementor_data) → l'espacement observé dépend du
   gap par défaut du kit, identique quelle que soit la page qui les affiche.
   Un seul gap horizontal/vertical, ici plutôt que dans Elementor (section
   réutilisée sur plusieurs pages) : source de vérité unique et responsive. */
*:has(> .domaine-item) {
  gap: 40px;
}

@media (max-width: 768px) {
  *:has(> .domaine-item) {
    gap: 20px;
  }
}

/* Floating title */
.floating-title-container {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.floating-title-container h2 {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 5px 5px 5px 0;
}

@media screen and (max-width: 768px) {


  .item__tagline {
    width: 324px;
  }
}


/* ==========================================================================
   5. CARDS — Hover effects
   ========================================================================== */

/* --- Card container (bordure → primary au hover) --- */
.card_container {
  border-color: var(--color-border);
  /* transition ciblée : `all` animait aussi width/height/padding/font-size des
     boutons contenus et transformait toute correction de dimension en flicker
     de 300 ms. Seule la bordure change réellement au hover de ce conteneur. */
  transition: border-color 0.3s ease;
}

.card_container:hover {
  border-color: var(--color-primary);
  cursor: pointer;
}

.card_container:hover .elementor-widget-icon-box {
  background: var(--color-white);
}

.card_container:hover path {
  fill: var(--color-primary);
}

.card_container:hover .elementor-icon-box-title {
  color: var(--color-primary) !important;
}

.card_container:hover .btn-card a {
  color: #fff !important;
  background-color: var(--e-global-color-primary) !important;
}

/* --- Boutons Elementor : n'animer que les propriétés visuelles ---
   Elementor core applique `.elementor-button{transition:all .3s}`
   (assets/css/frontend.min.css). `all` anime aussi width, height, padding,
   font-size et line-height : toute correction de taille intervenant après le
   premier paint (CSS de page, swap de police, reflow) devient une animation
   de 300 ms au lieu d'un ajustement instantané — c'est ce qui est perçu comme
   le flicker. On restreint aux propriétés réellement visuelles : le rendu
   final est inchangé, seules les animations non désirées disparaissent.
   Spécificité (0,1,0) identique à Elementor : style.css est enqueueé après le
   CSS Elementor (wp_enqueue_scripts priorité 20, plugins chargés avant le
   thème). Aucun CSS Elementor généré ne pose de `transition` sur
   `.elementor-button` (vérifié : post-*.css). */
.elementor-button {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, fill 0.3s ease;
}

/* Blue card title */
.blue_card_title {
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Card container animated (fond bleu au hover, texte blanc) --- */

/* Bordure Elementor sans couleur définie (currentColor ≈ noir) → gris.
   !important : Elementor génère .elementor-element-XXX{border-style;border-width}
   dans post-XXXX.css chargé après style.css (spécificité égale). */
.card_container_hover_animated {
  border-color: var(--color-border);
}

.card_container_hover_animated .elementor-heading-title {
  transition: color 0.3s ease, background-color 0.3s ease;
}

.card_container_hover_animated .elementor-icon svg path {
  transition: fill 0.3s ease;
}

.card_container_hover_animated .elementor-widget-text-editor {
  transition: color 0.3s ease, background-color 0.3s ease;
}

.card_container_hover_animated:hover {
  background: var(--color-primary);
  border-color: #009ed3;
}

.card_container_hover_animated:hover .elementor-heading-title {
  color: var(--color-primary) !important;
}

.card_container_hover_animated:hover .elementor-widget-heading {
  background-color: #fff !important;
}

.card_container_hover_animated:hover .elementor-icon svg path {
  fill: #fff;
}

.card_container_hover_animated:hover #Icon_metro-command {
  fill: #fff;
}

.card_container_hover_animated:hover .elementor-widget-text-editor {
  color: #fff;
}

/* --- Icon box (layout fixe) --- */
.icon_box_style {
  height: 69px;
  width: 100%;
  display: flex;
  align-items: center;
}

/* --- Titres des box pages Domaines (.card_container_hover_animated) ---
   Les widgets Heading de ces box ont un _padding vertical à 0 côté Elementor
   (identique sur toutes les pages Domaines) : le titre touche directement le
   haut de la carte. On ajoute un espace vertical minimal, globalement.
   !important : la valeur vient d'Elementor (post-XXXX.css, spécificité égale,
   chargé après style.css — même convention que .card_container_hover_animated
   ci-dessous). */
.card_container_hover_animated>.elementor-widget-heading .elementor-widget-container {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* --- Boxes "card_container_homepage" (ex. Dénudeuse, fiche/flyer accueil IWI) ---
   Les containers enfants (images/panneaux) ont une bordure solid sans couleur
   définie => noir par défaut (currentColor), au lieu du gris du design.
   Même cause/convention que .card_container_hover_animated : on passe tous
   les enfants directs en gris, sans effet sur ceux qui n'ont pas de bordure. */
.card_container_homepage>.elementor-element {
  border-color: var(--color-border) !important;
}

/* --- CTA "Demande de devis" (toutes pages Domaines + Machines spéciales) ---
   Le container de ce bloc a un min-height:185px fixé en dur côté Elementor,
   identique sur les 9 pages Domaines, qui dépasse la hauteur naturelle du
   contenu (2 titres + 1 bouton) → bloc plus haut que nécessaire.
   Ciblé par le lien du bouton (stable, pas d'ID Elementor) plutôt que par une
   classe absente de ces containers. */
div:has(> .elementor-widget-button a.elementor-button[href="/contact"]) {
  min-height: unset !important;
  height: auto;
}


/* ==========================================================================
   6. SLIDER — Boutons navigation
   ========================================================================== */

.elementor-swiper-button {
  border: 3px solid white !important;
  border-radius: 50px;
  padding: 1px;
}

.elementor-swiper-button:hover {
  background: white;
}

.elementor-widget-loop-carousel .elementor-swiper-button.elementor-swiper-button-prev:hover svg,
.elementor-widget-loop-carousel .elementor-swiper-button.elementor-swiper-button-next:hover svg {
  fill: var(--color-primary) !important;
}

/* --- Box actualités (loop-carousel — template "Actualité item footer" #7735) --- */

/* Hauteur uniforme des cards dans le slider */
.elementor-widget-loop-carousel .swiper-slide {
  height: auto;
}

.elementor-widget-loop-carousel .swiper-slide>.e-loop-item {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Body blanc de la card (2e conteneur : titre + extrait) → occupe l'espace restant */
.elementor-widget-loop-carousel .e-loop-item>.e-con:last-child {
  flex: 1 1 auto;
}

/* Date : centrée au lieu d'être collée à droite */
.elementor-widget-loop-carousel .elementor-widget-post-info .elementor-icon-list-item {
  justify-content: center;
}

/* Titre ↔ extrait : espacement réduit */
.elementor-widget-loop-carousel .elementor-widget-theme-post-title {
  margin-bottom: 4px;
}

/* Extrait : interligne resserré */
.elementor-widget-loop-carousel .elementor-widget-theme-post-excerpt {
  line-height: 1.3;
}

/* Bouton "Accéder à nos actualités" (frère du loop-carousel) : majuscules,
   et légèrement descendu (aucune marge actuellement entre le carousel et le
   bouton côté Elementor). */
.elementor-widget-loop-carousel~.elementor-widget-button .elementor-button {
  text-transform: uppercase;
}

.elementor-widget-loop-carousel~.elementor-widget-button {
  margin-top: 16px;
}

/* Flèches du carousel : légèrement plus petites (ajustement proportionnel,
   indépendant de la taille actuelle de l'icône). */
.elementor-widget-loop-carousel .elementor-swiper-button svg {
  transform: scale(0.85);
}


/* ==========================================================================
   7. SHORTCODE — Taxonomies (terms_list)
   ========================================================================== */

.qdv-terms-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.qdv-terms-list ul {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.qdv-terms-list li {
  display: flex;
}

.qdv-term-item {
  font-family: var(--font-alt);
  background: var(--color-primary-alt);
  border: 1px solid var(--color-primary-alt);
  border-radius: 29px;
  color: var(--color-white);
  font-size: 15px !important;
  text-transform: uppercase;
  height: 35px;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  width: fit-content;
  padding-left: 10px;
  padding-right: 10px;
  transition: var(--transition-base);
}

.qdv-term-item:hover {
  color: var(--color-primary-alt);
  background: var(--color-white);
}

/* Variante inversée (fond blanc, hover primary) — utilisée sur certaines pages */
.terms_links_style .qdv-term-item {
  background: #fff;
  color: var(--color-primary);
}

.terms_links_style .qdv-term-item:hover {
  color: #fff;
  background: var(--color-primary);
  border-color: #fff;
}


/* ==========================================================================
   8. FEATURED IMAGE — Overlay
   ========================================================================== */

.featured-image-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(41, 41, 41, 0.5);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
}


/* ==========================================================================
   9. ARTICLES — Contenu migré (Gutenberg / post-content)
   Cible le widget Elementor "Post Content" pour styliser le HTML
   des articles migrés depuis Muffin Builder.
   ========================================================================== */

/* --- Container article --- */
.elementor-widget-theme-post-content {
  max-width: var(--qd-container-w);
  margin: 0 auto;
  padding: 0 var(--qd-gutter);
  font-family: var(--font-base);
  color: var(--color-dark);
  line-height: 1.7;
  font-size: 16px;
}

/* --- Titres --- */
.elementor-widget-theme-post-content h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-dark);
  margin: 40px 0 16px;
}

.elementor-widget-theme-post-content h2:first-child {
  margin-top: 0;
}

.elementor-widget-theme-post-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-dark);
  margin: 32px 0 12px;
}

/* Titres des articles migrés : couleur primary */
.mfn-text h2,
.mfn-heading h2 {
  color: var(--color-primary);
}

/* --- Paragraphes --- */
.elementor-widget-theme-post-content p {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.7;
}

.elementor-widget-theme-post-content p:last-child {
  margin-bottom: 0;
}

.elementor-widget-theme-post-content p:empty {
  display: none;
}

/* --- Listes --- */
.elementor-widget-theme-post-content ul,
.elementor-widget-theme-post-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.elementor-widget-theme-post-content li {
  margin-bottom: 6px;
  line-height: 1.6;
}

/* --- Liens --- */
.elementor-widget-theme-post-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: var(--transition-fast);
}

.elementor-widget-theme-post-content a:hover {
  color: var(--color-primary-dark);
}

/* --- Gras --- */
.elementor-widget-theme-post-content b,
.elementor-widget-theme-post-content strong {
  font-weight: 600;
}

/* --- Images / Figures --- */
.elementor-widget-theme-post-content figure {
  margin: 24px 0;
}

.elementor-widget-theme-post-content figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.elementor-widget-theme-post-content figcaption {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
  font-style: italic;
  line-height: 1.4;
}

/* Images seules (sans figure) */
.elementor-widget-theme-post-content>img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 24px 0;
}

/* --- Séparateurs --- */
.elementor-widget-theme-post-content hr,
.elementor-widget-theme-post-content hr.mfn-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

/* --- Blockquotes --- */
.elementor-widget-theme-post-content blockquote {
  border-left: 4px solid var(--color-primary);
  background: #f0f9fc;
  margin: 24px 0;
  padding: 20px 24px;
  border-radius: 0 6px 6px 0;
}

.elementor-widget-theme-post-content blockquote p {
  margin: 0;
  font-size: 16px;
  font-style: italic;
  line-height: 1.6;
  color: #374151;
}

/* --- Blocs Gutenberg --- */

/* Image */
.elementor-widget-theme-post-content .wp-block-image {
  margin: 24px 0;
}

.elementor-widget-theme-post-content .wp-block-image img {
  border-radius: 6px;
}

.elementor-widget-theme-post-content .wp-block-image figcaption {
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
  font-style: italic;
}

/* Colonnes */
.elementor-widget-theme-post-content .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 24px 0;
}

.elementor-widget-theme-post-content .wp-block-column {
  flex: 1;
  min-width: 0;
}

/* Bouton */
.elementor-widget-theme-post-content .wp-block-button__link {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-base);
}

.elementor-widget-theme-post-content .wp-block-button__link:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

/* Séparateur */
.elementor-widget-theme-post-content .wp-block-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

/* --- Articles responsive — tablette --- */
@media (max-width: 1024px) {
  .elementor-widget-theme-post-content {
    padding: 0 16px;
  }

  .elementor-widget-theme-post-content h2 {
    font-size: 24px;
    margin: 32px 0 14px;
  }

  .elementor-widget-theme-post-content h3 {
    font-size: 18px;
  }

  .elementor-widget-theme-post-content .wp-block-columns {
    gap: 24px;
  }
}

/* --- Articles responsive — mobile --- */
@media (max-width: 768px) {
  .elementor-widget-theme-post-content {
    padding: 0 12px;
    font-size: 15px;
  }

  .elementor-widget-theme-post-content h2 {
    font-size: 22px;
    margin: 28px 0 12px;
  }

  .elementor-widget-theme-post-content figure {
    margin: 16px 0;
  }

  .elementor-widget-theme-post-content blockquote {
    padding: 16px 18px;
  }

  .elementor-widget-theme-post-content .wp-block-columns {
    gap: 20px;
  }

  .elementor-widget-theme-post-content .wp-block-column {
    flex: 0 0 100%;
  }

  .elementor-widget-theme-post-content .wp-block-button__link {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}


/* ==========================================================================
   10. WPML — Language switcher pill
   Sélecteur de langue FR/DE en pill sombre, dropdown vers le haut.
   Deux contextes : footer (wpml-ls-statics-footer) et megamenu (wpml-ls-137).
   ========================================================================== */

/* ─── 10a. FOOTER — Pill statique ─── */
body {
  position: relative;
}

.wpml-ls {
  position: absolute;
  display: inline-block;
}

.wpml-ls ul {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.wpml-ls-current-language {
  position: relative;
}

/* Override WPML par défaut */
.wpml-ls-legacy-list-horizontal.wpml-ls-statics-footer {
  margin-bottom: 0;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  background: transparent;
  border: none;
}

/* Tablette/mobile : rapproche le switcher du bas du footer (validé visuellement) */
@media (max-width: 1024px) {
  .wpml-ls-statics-footer {
    bottom: 30px !important;
  }
}

/* Pill visible (langue courante) */
.wpml-ls-statics-footer .wpml-ls-current-language>.wpml-ls-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #363636;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.wpml-ls-statics-footer .wpml-ls-current-language>.wpml-ls-link:hover {
  background-color: #4a4a4a;
}

/* Flèche avant le texte */
.wpml-ls-statics-footer .wpml-ls-current-language>.wpml-ls-link::before {
  content: "\25B6";
  color: #fff;
  font-size: 10px;
}

/* Texte langue courante */
.wpml-ls-statics-footer .wpml-ls-current-language .wpml-ls-native {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  order: 0;
}

/* Drapeaux agrandis */
.wpml-ls-statics-footer .wpml-ls-flag {
  width: 32px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  order: 1;
}

/* Dropdown vers le haut (langues non-courantes) — caché par défaut */
.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  transform: translateY(4px);
  transition: all 0.2s ease;
  z-index: 100;
  padding-bottom: 4px;
}

.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) .wpml-ls-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #363636;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) .wpml-ls-link::before {
  content: "\25B6";
  color: #fff;
  font-size: 10px;
}

.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) .wpml-ls-link:hover {
  background: #4a4a4a;
}

.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) .wpml-ls-native {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.wpml-ls-statics-footer .wpml-ls-item:not(.wpml-ls-current-language) .wpml-ls-flag {
  width: 32px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

/* Masquer "(Allemand)" */
.wpml-ls-statics-footer .wpml-ls-display {
  display: none;
}

/* Dropdown visible au hover */
.wpml-ls-statics-footer:hover .wpml-ls-item:not(.wpml-ls-current-language) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ─── 10b. MEGAMENU — Pill FR/DE dans le menu principal ─── */

/* Styles communs pill (desktop + mobile) */
#mega-menu-item-wpml-ls-137-fr {
  position: relative !important;
}

#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  background-color: #363636 !important;
  border: 1px solid #fff !important;
  border-radius: 0 !important;
  padding: 10px 16px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
}

#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link:hover {
  background-color: #4a4a4a !important;
}

#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link::before {
  content: "\25B6" !important;
  color: #fff !important;
  font-size: 10px !important;
}

#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link .wpml-ls-native,
.wpml-ls-native {

  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link .wpml-ls-flag,
.wpml-ls-flag {
  width: 32px !important;
  height: 24px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  object-fit: cover !important;
}

#mega-menu-item-wpml-ls-137-fr .mega-indicator {
  display: none !important;
}

/* Dropdown pill — caché par défaut */
#mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 4px !important;
  position: absolute !important;
  bottom: 100% !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(4px) !important;
  transition: all 0.2s ease !important;
  z-index: 9999 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  width: auto !important;
}

/* Item DE (langue secondaire) */
#mega-menu-item-wpml-ls-137-de {
  display: block !important;
}

#mega-menu-item-wpml-ls-137-de>a.mega-menu-link {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: #363636 !important;
  border: 1px solid #fff !important;
  border-radius: 0 !important;
  padding: 10px 16px !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
}

#mega-menu-item-wpml-ls-137-de>a.mega-menu-link:hover {
  background: #4a4a4a !important;
}

#mega-menu-item-wpml-ls-137-de>a.mega-menu-link .wpml-ls-native,
.wpml-ls-native {
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}

#mega-menu-item-wpml-ls-137-de>a.mega-menu-link .wpml-ls-flag,
.wpml-ls-flag {
  width: 32px !important;
  height: 24px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  object-fit: cover !important;
}

/* Desktop : dropdown vers le BAS au hover */
@media (min-width: 769px) {
  #mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu {
    bottom: auto !important;
    top: 100% !important;
    padding-bottom: 0 !important;
    padding-top: 4px !important;
    transform: translateY(-4px) !important;
  }

  #mega-menu-item-wpml-ls-137-fr:hover>ul.mega-sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
}

/* Mobile : dropdown au clic (toggle) */
@media (max-width: 768px) {

  #mega-menu-item-wpml-ls-137-fr.mega-toggle-on>ul.mega-sub-menu,
  #mega-menu-item-wpml-ls-137-fr[aria-expanded="true"]>ul.mega-sub-menu,
  #mega-menu-item-wpml-ls-137-fr>a.mega-menu-link[aria-expanded="true"]+ul.mega-sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  /* Pill centrée et compacte en mobile */
  #mega-menu-item-wpml-ls-137-fr {
    display: flex !important;
    justify-content: center;
    text-align: center !important;
    width: 165px !important;
    max-width: 165px !important;
    padding-top: 20px !important;
  }

  #mega-menu-item-wpml-ls-137-fr a {
    width: 165px !important;
    text-align: center !important;
    margin: auto;
  }
}


/* ─── 10c. SÉLECTEUR DE LANGUE DU HEADER — style actuel appliqué au shortcode ───
   Le sélecteur n'est plus un item de menu : il est rendu par
   [wpml_language_switcher] dans template-parts/dynamic-header.php.
   On réapplique ici, à l'identique, le style de la pill qui existait dans le
   menu (section 10b) : fond #363636, bordure blanche, ▶, drapeau, nom natif,
   hover #4a4a4a. Valeurs inchangées — aucun nouveau design. */
.cms-lang-switcher {
  display: flex;
  align-items: center;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions ul {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions li {
  display: block;
  margin: 0;
  padding: 0;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions a.wpml-ls-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #363636;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions a.wpml-ls-link:hover,
.cms-lang-switcher .wpml-ls-statics-shortcode_actions a.wpml-ls-link:focus-visible {
  background-color: #4a4a4a;
}

/* Flèche ▶ uniquement sur la pill de la langue courante, comme à l'origine */
.cms-lang-switcher .wpml-ls-statics-shortcode_actions .wpml-ls-current-language a.wpml-ls-link::before {
  content: "\25B6";
  color: #fff;
  font-size: 10px;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions .wpml-ls-flag {
  width: 32px;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.cms-lang-switcher .wpml-ls-statics-shortcode_actions .wpml-ls-native {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Masquer la mention « (Allemand) » quand WPML l'ajoute */
.cms-lang-switcher .wpml-ls-statics-shortcode_actions .wpml-ls-display {
  display: none;
}

/* Les langues sont affichées EN LIGNE (flex, gap 12px) : mêmes pills, côte à
   côte — aucune position:absolute, aucune superposition, aucun hover à gérer.
   La liste du shortcode WPML est rendue telle quelle, dans l'ordre WPML. */

/* Mobile / tablette : version centrée, même esprit que le sélecteur du menu
   mobile actuel (pill centrée en colonne + espacement au-dessus). */
@media (max-width: 1024px) {
  .cms-lang-switcher--mobile {
    justify-content: center;
    padding-top: 20px;
  }

  .cms-lang-switcher--mobile .wpml-ls-statics-shortcode_actions ul {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
}

#lang_sel {
  width: 100%;
}

/* ==========================================================================
   11. UTILITAIRES & PAGES SPÉCIFIQUES
   ========================================================================== */

/* --- Page "Qui sommes-nous" (ID 2288) : icônes cerclées --- */
.page-id-2288 .elementor-icon {
  border: 3px solid #fff;
  padding: 35px;
  border-radius: 50%;
}

/* --- Bouton "Découvrez toutes nos compétences métiers" (Machines spéciales) ---
   _padding à 0 sur les 4 côtés côté Elementor pour ce bouton (texte 38px/700),
   le texte touche directement la bordure blanche.
   Ciblage par classe métier dédiée portée par le widget Elementor 0ad6099
   (_css_classes = "btn-competences-metiers") : ne dépend plus de l'URL du lien
   /nos-expertises/, qui n'est pas un contrat stable pour du CSS.
   !important conservé : la règle du Kit `.elementor-kit-7544 .elementor-button`
   (padding:0) a une spécificité égale (0,2,0) et vit dans un fichier
   régénéré par Elementor — le !important garantit le rendu sans dépendre de
   l'ordre de chargement. */
.btn-competences-metiers .elementor-button {
  padding: 16px 28px !important;
}


/* ==========================================================================
   12. QDM LANGUAGE SWITCHER — Pill custom injectée par PHP
   Généré par qdm_wpml_mega_menu_switcher() dans functions.php.
   Utilise <button> pour l'accessibilité (clavier + lecteur d'écran).
   ========================================================================== */

/* --- Conteneur --- */
.qdm-lang-switcher {
  position: relative !important;
  list-style: none !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
}

/* --- Pill (bouton langue active) --- */
.qdm-lang-current {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  background-color: #363636 !important;
  border: 1px solid #fff !important;
  padding: 10px 16px !important;
  cursor: pointer !important;
  transition: background 0.2s !important;
  font-family: inherit;
  border-radius: 0;
}

.qdm-lang-current:hover,
.qdm-lang-current:focus-visible {
  background-color: #4a4a4a !important;
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Drapeau */
.qdm-lang-flag {
  width: 32px !important;
  height: 24px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  object-fit: cover !important;
}

/* Nom langue */
.qdm-lang-current .qdm-lang-name {
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

/* Flèche */
.qdm-lang-arrow {
  color: #fff !important;
  font-size: 10px !important;
}

/* --- Dropdown (caché par défaut) --- */
.qdm-lang-dropdown {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 4px !important;
  position: absolute !important;
  bottom: 100% !important;
  left: 0 !important;
  right: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(4px) !important;
  transition: all 0.2s ease !important;
  z-index: 9999 !important;
}

/* Dropdown visible (via JS .open ou hover desktop) */
.qdm-lang-switcher:hover .qdm-lang-dropdown,
.qdm-lang-switcher.open .qdm-lang-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Items dropdown */
.qdm-lang-dropdown li {
  display: block !important;
}

.qdm-lang-dropdown a {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  background: #363636 !important;
  border: 1px solid #fff !important;
  padding: 10px 16px !important;
  text-decoration: none !important;
  transition: background 0.2s !important;
}

.qdm-lang-dropdown a:hover,
.qdm-lang-dropdown a:focus-visible {
  background: #4a4a4a !important;
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.qdm-lang-dropdown .qdm-lang-name {
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}

/* Mobile : désactiver le hover CSS, utiliser uniquement le JS (.open) */
@media (max-width: 768px) {
  .qdm-lang-switcher:hover .qdm-lang-dropdown {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  .qdm-lang-switcher.open .qdm-lang-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }
}

/* ==========================================================================
   13. CORRECTIFS RECETTE — CTA / mega-menu desktop étroit / flèches footer
   Ne cible que des éléments existants et vérifiés :
     .btn-devis                        → widget Elementor de la page 5927
     #mega-menu-item-10006 / 7595      → panneaux Max Mega Menu
     .elementor-7550 ...element-20324d7f → loop-carousel du footer
   Aucun CSS généré (Elementor / Max Mega Menu) n'est modifié.
   ========================================================================== */

/* CTA global */
.btn-devis .elementor-button {
  max-width: 100%;
}

/* Mega menu desktop étroit */
@media (min-width: 1025px) and (max-width: 1359px) {

  #mega-menu-item-10006 .widget_media_image img,
  #mega-menu-item-7595 .widget_media_image img {
    min-width: 0;
  }
}

/* Flèches actualités footer sur desktop étroit */
@media (min-width: 1025px) and (max-width: 1299px) {
  .elementor-7550 .elementor-element.elementor-element-20324d7f {
    --arrow-prev-left-position: -30px;
    --arrow-next-right-position: -30px;
  }
}

/* ==========================================================================
   14. CORRECTIFS RECETTE PLAYWRIGHT — débordements 1025 px & mobile 430 px
   Causes GLOBALES uniquement (aucune exception par page). Aucun CSS généré
   (Elementor / Max Mega Menu) n'est modifié. Toutes les règles sont bornées à
   la bande de largeurs concernée : le rendu à 1440 px et au-delà est inchangé.
   ========================================================================== */

/* ─── Bande desktop étroite 1025-1359 px ─── */
@media (min-width: 1025px) and (max-width: 1359px) {

  /* 1. CTA à largeur fixe (382 px définis côté Elementor) : ne peuvent plus
     dépasser leur colonne. Corrige le débordement droit des 24 pages. */
  .elementor-widget-button.elementor-widget__width-initial {
    max-width: 100%;
  }

  .elementor-widget-button .elementor-button {
    max-width: 100%;
  }

  /* 2. Colonnes de grille Elementor : autorisées à rétrécir sous leur largeur
     fixe (cause des grilles jusqu'à 1185 px sur Machines spéciales et
     Lignes de production). */
  .e-con.e-grid>.e-con-full,
  .e-grid>.e-con-full {
    min-width: 0;
  }

  /* 3. Panneaux mega-menu : plus aucune largeur minimale imposée, colonnes
     rétrécissables et libellés qui peuvent passer à la ligne
     (chevauchement « AUTOMATISME – ROBOTIQUE » / « ROBOTIQUE MOBILE »,
     colonnes masquées s'étendant jusqu'à ~1065 px). */
  #site-header #mega-menu-10006-0>ul.mega-sub-menu>li.mega-menu-column,
  #site-header #mega-menu-10006-1>ul.mega-sub-menu>li.mega-menu-column,
  #site-header #mega-menu-7595-0>ul.mega-sub-menu>li.mega-menu-column {
    min-width: 0;
  }

  #mega-menu-item-10006 .widget_media_image img,
  #mega-menu-item-7595 .widget_media_image img {
    min-width: 0;
  }

  #site-header #mega-menu-item-10006 .mega-menu-link,
  #site-header #mega-menu-item-7595 .mega-menu-link {
    white-space: normal;
  }

  /* 3b. Panneau : jamais plus large que le viewport, quel que soit son contenu */
  #site-header #mega-menu-item-10006>.mega-sub-menu,
  #site-header #mega-menu-item-7595>.mega-sub-menu,
  #site-header #mega-menu-item-10006>.mega-sub-menu>li.mega-menu-row,
  #site-header #mega-menu-item-7595>.mega-sub-menu>li.mega-menu-row {
    max-width: 100vw !important;
    box-sizing: border-box;
  }
}

/* ─── Mobile étroit ≤480 px ─── */
@media (max-width: 480px) {

  /* 4. Span décoratif `.border-top` : ne dépasse plus le document
     (largeur réelle 438 px pour 430 px sur Actualités et les articles). */
  .border-top {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 5. Titres longs : césure autorisée au lieu de sortir du conteneur
     (Documentation : jusqu'à +74 px à 430 px). */
  .elementor-heading-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}



/* ==========================================================================
   15. DERNIER BATCH RECETTE — bande desktop étroite 1025-1359 px + mobile ≤480 px
   Toutes les règles sont bornées : le rendu ≥1360 px et ≤1024 px est inchangé.
   Aucun CSS généré (Elementor / Max Mega Menu) n'est modifié.
   ========================================================================== */

@media (min-width: 1025px) and (max-width: 1359px) {

  /* 1. Footer des pages Domaines (Elementor 11198) : mêmes variables de
     flèches que le footer 7550 déjà corrigé (e17416a et 20324d7f sont tous
     deux des loop-carousel) → les flèches ne dépassent plus le viewport. */
  .elementor-11198 .elementor-element.elementor-element-e17416a {
    --arrow-prev-left-position: -20px;
    --arrow-next-right-position: -20px;
  }

  /* 2. Cartes de réalisations de Machines spéciales (classe
     .positionned_button_card) : suppression du positionnement absolu dans la
     bande étroite (fin du chevauchement liste / « DÉCOUVRIR EN VIDÉO ») et de
     la largeur minimale de 230 px.
     !important : la largeur mini vient du Custom CSS du container
     (min-width:230px !important) et les largeurs de règles générées par élément.
     NE PAS étendre cette règle à .btn-card : sur Lignes de production ces
     boutons sont en flux normal (233 px) et le position:unset les cassait. */
  .positionned_button_card {
    position: unset !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* 2b. Grilles « Support & SAV » (5927) et Lignes de production (2188) :
     `1fr` = minmax(auto, 1fr) → la taille intrinsèque du contenu empêchait les
     colonnes de rétrécir (débordement à 1185 px). minmax(0, 1fr) les contraint. */
  .elementor-5927 .elementor-element.elementor-element-0d69036,
  .elementor-2188 .elementor-element.elementor-element-76b8717 {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .elementor-5927 .elementor-element.elementor-element-0d69036>.e-con-full,
  .elementor-2188 .elementor-element.elementor-element-76b8717>.e-con-full {
    min-width: 0;
  }

  .elementor-5927 .elementor-element.elementor-element-0d69036 img,
  .elementor-2188 .elementor-element.elementor-element-76b8717 img {
    max-width: 100%;
    height: auto;
  }

  /* 2c. Lignes de production : les boutons .btn-card restent en flux normal,
     on les borne simplement à leur colonne (aucun repositionnement). */
  .elementor-2188 .btn-card {
    max-width: 100%;
  }

  /* 3. Automatisme / Robotique (5978) : le CTA croisait encore le titre.
     Vérifié côté données : le bouton (63c31b1) est bien dans le flux (aucun
     _position/_offset, marges à 0) — la cause est le titre qui déborde de sa
     propre boîte. On force donc les DEUX éléments en flux normal, hauteur auto,
     titre autorisé à passer à la ligne, + séparation explicite. */
  .elementor-5978 .elementor-element.elementor-element-f600063 {
    row-gap: 16px;
  }

  .elementor-5978 .elementor-element.elementor-element-7b37457,
  .elementor-5978 .elementor-element.elementor-element-63c31b1 {
    position: static;
    height: auto;
    max-width: 100%;
  }

  .elementor-5978 .elementor-element.elementor-element-7b37457 .elementor-heading-title {
    white-space: normal;
    overflow-wrap: anywhere;
    height: auto;
  }

  /* 4. Footer Contact : la pill langue quitte le positionnement absolu dans
     cette bande → elle ne recouvre plus le numéro de fax.
     (Spécificité 0,2,0 = celle de la règle d'origine, style.css chargé après.) */
  /* 5. Galeries WordPress (shortcode [gallery]) : les colonnes passent en
     border-box → plus de dépassement (1040 px pour 1025 px). */
  #gallery-1,
  .gallery {
    max-width: 100%;
    box-sizing: border-box;
  }

  #gallery-1 .gallery-item,
  .gallery .gallery-item {
    box-sizing: border-box;
    max-width: 100%;
  }

  /* 6. Blocs CTA (« Vous avez un projet… », « Contactez un chargé
     d'affaires… ») : marge latérale cohérente, 20 px = valeur déjà utilisée
     par les bandeaux correctement intégrés. Une seule règle pour toutes les
     pages (ciblage par le CTA de contact, pas par page). */
  .elementor .e-con:has(> .elementor-widget-button a.elementor-button[href="/contact"]) {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* 7. Mobile ≤480 px : cartes « Les attentes de nos clients » — le composant vit
   dans le FOOTER GLOBAL (Elementor 7550, présent sur toutes les pages) et
   l'image est un widget distinct du titre : le gap du container ne suffit pas,
   on agit donc sur le sous-élément image (cause réelle du contact). */
@media (max-width: 480px) {

  .elementor-7550 .elementor-element.elementor-element-74d9fea {
    row-gap: 8px;
  }

  .elementor-7550 .elementor-element.elementor-element-74d9fea>.elementor-widget-image {
    position: static;
    margin-bottom: 8px;
  }

  .elementor-7550 .elementor-element.elementor-element-74d9fea>.elementor-widget-image img {
    max-width: 100%;
    height: auto;
  }

  /* Même logique pour les icon-box utilisées comme cartes sur mobile. */
  .elementor-widget-icon-box .elementor-icon-box-wrapper {
    row-gap: 8px;
  }
}


/* ==========================================================================
   16. ULTIME BATCH — 3 causes résiduelles, bornées à leur bande
   ========================================================================== */

/* 1. Grilles Machines spéciales (5927) et Lignes de production (2188) : chaque
   carte porte une bordure de 1 px (border-width:1px 1px 1px 1px) et Elementor
   ne définit pas box-sizing sur les .e-con (une seule occurrence de
   border-box dans frontend.min.css) → en content-box, bordures + paddings
   s'ajoutent aux pistes `1fr` et débordent du viewport (dernière carte à
   1033 px pour un viewport de 1025). border-box sur le sous-arbre des 2
   grilles : opération monotone (ne peut que réduire la boîte des éléments),
   donc aucun risque de régression. */
@media (min-width: 1025px) and (max-width: 1359px) {

  .elementor-5927 .elementor-element.elementor-element-0d69036,
  .elementor-5927 .elementor-element.elementor-element-0d69036 *,
  .elementor-2188 .elementor-element.elementor-element-76b8717,
  .elementor-2188 .elementor-element.elementor-element-76b8717 * {
    box-sizing: border-box;
  }

  /* 2. Lignes de production : ces 2 boutons sont mis en absolu par le Custom
     CSS de LEUR PROPRE widget (selector{position:absolute; bottom:40px;
     left:50%; transform:translateX(-50%); height:55px; width:233px}) → ils
     recouvrent la liste. On les remet dans le flux, centrés sous le contenu,
     en conservant leur boîte 233×55 px définie par ce même Custom CSS.
     Spécificité identique au CSS généré et style.css chargé après → aucune
     priorité forcée. Uniquement ces 2 widgets, uniquement sur cette page. */
  .elementor-2188 .elementor-element.elementor-element-2d2d10e,
  .elementor-2188 .elementor-element.elementor-element-7d180d6 {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 12px auto 0;
  }
}

/* 3. Cartes « Les attentes de nos clients » (footer global 7550), 3ᵉ carte :
   elle possède un niveau .e-con-inner supplémentaire et son titre est un
   text-editor (pas un widget heading) → les sélecteurs « enfant direct » qui
   corrigent les 2 autres cartes ne l'atteignent pas. Ciblage par le container
   de la carte, en descendant. */
@media (max-width: 480px) {

  .elementor-7550 .elementor-element.elementor-element-01ba340 .e-con-inner>.elementor-widget-image {
    margin-bottom: 8px;
  }
}

/* ==========================================================
   FINAL WPML SWITCHER ALIGNMENT
   Footer = visual source of truth
   ========================================================== */
@media (min-width: 1025px) {
  #site-header .cms-lang-switcher #lang_sel {
    position: relative;
    width: auto;
  }

  .site-header .cms-lang-switcher .wpml-ls-statics-shortcode_actions>ul {
    display: block;
  }

  .site-header .cms-lang-switcher .wpml-ls-current-language>a.wpml-ls-item-toggle,
  .site-header .cms-lang-switcher .wpml-ls-sub-menu>li>a.wpml-ls-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #363636;
    border: 1px solid #fff;
    border-radius: 0;
    padding: 10px 16px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease;
  }

  .site-header .cms-lang-switcher .wpml-ls-current-language>a.wpml-ls-item-toggle:hover,
  .site-header .cms-lang-switcher .wpml-ls-current-language>a.wpml-ls-item-toggle:focus,
  .site-header .cms-lang-switcher .wpml-ls-sub-menu>li>a.wpml-ls-link:hover,
  .site-header .cms-lang-switcher .wpml-ls-sub-menu>li>a.wpml-ls-link:focus {
    background: #4a4a4a;
  }

  .site-header .cms-lang-switcher .wpml-ls-current-language>a.wpml-ls-item-toggle::before {
    content: "\25B6";
    color: #fff;
    font-size: 10px;
  }

  .site-header .cms-lang-switcher .wpml-ls-native {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .02em;
    order: 0;
  }

  .site-header .cms-lang-switcher .wpml-ls-flag {
    width: 32px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 3px;
    object-fit: cover;
    order: 1;
  }

  .site-header .cms-lang-switcher .wpml-ls-current-language>.wpml-ls-sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 4px 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
    z-index: 9999;
  }

  .site-header .cms-lang-switcher .wpml-ls-current-language:hover>.wpml-ls-sub-menu,
  .site-header .cms-lang-switcher .wpml-ls-current-language:focus-within>.wpml-ls-sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  #site-header #mega-menu-item-wpml-ls-137-fr {
    width: auto !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-fr>a.mega-menu-link,
  #site-header #mega-menu-item-wpml-ls-137-de>a.mega-menu-link {
    width: auto !important;
    max-width: none !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu {
    top: 100% !important;
    bottom: auto !important;
    padding-top: 4px !important;
    padding-bottom: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-4px) !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-fr:hover>ul.mega-sub-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-fr.mega-toggle-on>ul.mega-sub-menu,
  #site-header #mega-menu-item-wpml-ls-137-fr[aria-expanded="true"]>ul.mega-sub-menu,
  #site-header #mega-menu-item-wpml-ls-137-fr>a.mega-menu-link[aria-expanded="true"]+ul.mega-sub-menu {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

  /* Neutralise les règles générales du menu mobile sur cette seule pill. */
  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link,
  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu>#mega-menu-item-wpml-ls-137-de>a.mega-menu-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    background: #363636 !important;
    border: 1px solid #fff !important;
    border-radius: 0 !important;
    padding: 10px 16px !important;
    color: #fff !important;
    text-transform: none !important;
    transition: background .2s ease !important;
  }

  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link:hover,
  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>a.mega-menu-link:focus,
  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu>#mega-menu-item-wpml-ls-137-de>a.mega-menu-link:hover,
  #site-header #mega-menu-wrap-menu-1 #mega-menu-menu-1>#mega-menu-item-wpml-ls-137-fr>ul.mega-sub-menu>#mega-menu-item-wpml-ls-137-de>a.mega-menu-link:focus {
    background: #4a4a4a !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-de .wpml-ls-display {
    display: none !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-de>a.mega-menu-link::before {
    content: "\25B6" !important;
    color: #fff !important;
    font-size: 10px !important;
  }

  #site-header #mega-menu-item-wpml-ls-137-fr:focus-within>ul.mega-sub-menu,
  #site-header #mega-menu-item-wpml-ls-137-fr>a.mega-menu-link:focus+ul.mega-sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
  }

}

.site-header .cms-lang-switcher .wpml-ls-legacy-dropdown a.wpml-ls-item-toggle::after {
  display: none !important;
  content: none !important;
}

/* Menu allemand : reprise des styles FR, 30 octobre 2026. */
@media only screen and (min-width: 1025px) {

  #site-header #mega-menu-item-3711>.mega-sub-menu,
  #site-header #mega-menu-item-11925>.mega-sub-menu {
    box-sizing: border-box;
    width: 100vw !important;
    max-width: 100vw !important;
    position: fixed !important;
    left: 0px !important;
    right: 0px !important;
    top: 132px !important;
    transform: none !important;
    margin: 0px !important;
    z-index: -1 !important;
    display: flex !important;
    place-content: center !important;
    align-items: center !important;
    min-height: var(--qd-panel-minh) !important;
    padding: var(--qd-panel-vpad) 0 !important;
    border-top: 3px solid var(--color-primary) !important;
  }

  #site-header #mega-menu-item-3711>.mega-sub-menu::before,
  #site-header #mega-menu-item-11925>.mega-sub-menu::before {
    content: "" !important;
    position: absolute !important;
    left: 0px !important;
    right: 0px !important;
    bottom: 100% !important;
    height: 100vh !important;
    z-index: -1 !important;
  }

  #site-header #mega-menu-item-3711>.mega-sub-menu>li.mega-menu-row,
  #site-header #mega-menu-item-11925>.mega-sub-menu>li.mega-menu-row {
    width: 100%;
    max-width: 1400px;
    padding-left: var(--qd-gutter);
    padding-right: var(--qd-gutter);
    padding-top: 0px;
    padding-bottom: 0px;
    box-sizing: border-box;
    transform: translateX(-50%);
    left: 50%;
    margin: 0px auto !important;
    align-self: center !important;
  }

  #site-header #mega-menu-3711-0,
  #site-header #mega-menu-3711-1,
  #site-header #mega-menu-11925-0 {
    box-sizing: border-box;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: var(--qd-gutter) !important;
    padding-right: var(--qd-gutter) !important;
  }

  #site-header #mega-menu-3711-0>ul.mega-sub-menu,
  #site-header #mega-menu-3711-1>ul.mega-sub-menu,
  #site-header #mega-menu-11925-0>ul.mega-sub-menu {
    justify-items: center;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
  }
}

#mega-menu-item-3711 .mega-block-title,
#mega-menu-item-11925 .mega-block-title {
  display: none;
}

#mega-menu-item-3711 .widget_media_image,
#mega-menu-item-11925 .widget_media_image {
  padding-bottom: 0px !important;
}

#mega-menu-item-3711 .widget_media_image img,
#mega-menu-item-11925 .widget_media_image img {
  width: 100%;
  min-height: 124px;
  object-fit: cover;
  border-radius: 0px;
  min-width: 242px;
  height: 135px !important;
}

#mega-menu-3711-0-3 .widget_media_image img,
#mega-menu-3711-1-3 .widget_media_image img,
#mega-menu-11925-0-3 .widget_media_image img {
  height: 124px;
  object-fit: cover;
}

#mega-menu-item-3711 .widget_media_image a,
#mega-menu-item-11925 .widget_media_image a {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 124px;
  height: 135px;
  max-height: 135px;
}

#mega-sub-menu-3711 li a,
#mega-menu-item-11925 li a {
  max-height: 135px;
}

#mega-menu-item-3711 .widget_media_image a::after,
#mega-menu-item-11925 .widget_media_image a::after {
  content: "";
  position: absolute;
  inset: 0px;
  background-color: rgb(0, 168, 212);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 0px;
  padding: 0px;
}

#mega-menu-item-3711 .widget_media_image a:hover::after,
#mega-menu-item-11925 .widget_media_image a:hover::after {
  opacity: 0.6;
}

@media (max-width: 1024px) {

  #mega-menu-item-3711>.mega-sub-menu,
  #mega-menu-item-11925>.mega-sub-menu {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    min-height: 0px !important;
    padding: 0px !important;
    border-width: medium !important;
    border-style: none !important;
    border-color: currentcolor !important;
    border-image: none !important;
  }

  #mega-menu-item-3711>.mega-sub-menu>li.mega-menu-row,
  #mega-menu-item-11925>.mega-sub-menu>li.mega-menu-row {
    width: 100% !important;
    max-width: none !important;
    padding: 0px !important;
  }

  #mega-menu-3711-0>ul.mega-sub-menu,
  #mega-menu-3711-1>ul.mega-sub-menu,
  #mega-menu-11925-0>ul.mega-sub-menu {
    flex-direction: column !important;
    gap: 0px !important;
    width: 100% !important;
  }

  #mega-menu-3711-0>ul.mega-sub-menu>li.mega-menu-column,
  #mega-menu-3711-1>ul.mega-sub-menu>li.mega-menu-column,
  #mega-menu-11925-0>ul.mega-sub-menu>li.mega-menu-column {
    max-width: none !important;
    flex: 0 0 auto !important;
    width: 100% !important;
  }
}

@media screen and (max-width: 768px) {

  #site-header #mega-menu-item-3711>.mega-sub-menu,
  #site-header #mega-menu-item-11925>.mega-sub-menu {
    border-width: medium !important;
    border-style: none !important;
    border-color: currentcolor !important;
    border-image: none !important;
  }
}

@media (min-width: 1025px) and (max-width: 1359px) {

  #mega-menu-item-3711 .widget_media_image img,
  #mega-menu-item-11925 .widget_media_image img {
    min-width: 0px;
  }
}

@media (min-width: 1025px) and (max-width: 1359px) {

  #site-header #mega-menu-3711-0>ul.mega-sub-menu>li.mega-menu-column,
  #site-header #mega-menu-3711-1>ul.mega-sub-menu>li.mega-menu-column,
  #site-header #mega-menu-11925-0>ul.mega-sub-menu>li.mega-menu-column {
    min-width: 0px;
  }

  #mega-menu-item-3711 .widget_media_image img,
  #mega-menu-item-11925 .widget_media_image img {
    min-width: 0px;
  }

  #site-header #mega-menu-item-3711 .mega-menu-link,
  #site-header #mega-menu-item-11925 .mega-menu-link {
    white-space: normal;
  }

  #site-header #mega-menu-item-3711>.mega-sub-menu,
  #site-header #mega-menu-item-11925>.mega-sub-menu,
  #site-header #mega-menu-item-3711>.mega-sub-menu>li.mega-menu-row,
  #site-header #mega-menu-item-11925>.mega-sub-menu>li.mega-menu-row {
    max-width: 100vw !important;
    box-sizing: border-box;
  }
}

/* Domaines DE : cinq colonnes comme la grille FR, retour automatique à la ligne. */
@media (min-width: 1025px) {
  #site-header #mega-menu-item-3711 .mega-menu-row>ul.mega-sub-menu {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  #site-header #mega-menu-item-3711 .mega-menu-column {
    min-width: 0;
  }
}
