/*!
 * Défi Clean Mega Menu + Recherche IA — v1.1.4
 * Refonte design clair, assortie au site defi-clean.fr
 * Palette : header blanc, topbar bleu nuit en dégradé, accent doré #FEAB0B,
 * texte bleu marine #0a2346, ombres bleutées douces, radius 10–14px.
 * v1.1.3 : CTA "devis" masqué en mobile, hamburger aligné tout à droite.
 * v1.1.4 : topbar-right (intervention 7j/7 + téléphone) masquée en mobile.
 */

.ws-mms,
.ws-mms *,
.ws-mms *:before,
.ws-mms *:after { box-sizing: border-box; }

.ws-mms {
  /* Variables overridables via les réglages WP (accent / blue / dark) */
  --ws-mms-accent: #FEAB0B;
  --ws-mms-blue: #011E44;
  --ws-mms-dark: #022352;

  /* Variables internes au plugin */
  --ws-mms-accent-ink: #1B1403;
  --ws-mms-accent-soft: #FFF7E6;
  --ws-mms-accent-border: #FFE0A8;
  --ws-mms-blue-deep-2: #083969;
  --ws-mms-bg: #ffffff;
  --ws-mms-bg-alt: #f6f8fb;
  --ws-mms-border: #e7eef6;
  --ws-mms-text: #0a2346;
  --ws-mms-text-soft: #5F6E83;
  --ws-mms-radius: 14px;
  --ws-mms-radius-sm: 10px;
  --ws-mms-shadow: 0 6px 18px rgba(1,30,68,.06);
  --ws-mms-shadow-lg: 0 18px 40px rgba(15,30,60,.14);
  --ws-mms-shadow-cta: 0 6px 18px rgba(254,171,11,.35);

  position: sticky;
  top: 0;
  z-index: 9999;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  background: var(--ws-mms-bg);
  border-bottom: 1px solid var(--ws-mms-border);
  transition: box-shadow .25s ease;
}
.ws-mms.is-scrolled { box-shadow: 0 8px 28px rgba(1,30,68,.08); }

/* ===== Topbar bleu nuit (pleine largeur) ===== */
.ws-mms-topbar {
  background: linear-gradient(180deg, var(--ws-mms-dark) 0%, var(--ws-mms-blue-deep-2) 100%);
  color: #D7E6FF;
  font-size: 13px;
  line-height: 1.3;
}
.ws-mms-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.ws-mms-topbar-left,
.ws-mms-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ws-mms-topbar-left { color: rgba(215,230,255,.85); font-weight: 600; }
.ws-mms-topbar-right { color: #fff; font-weight: 600; }
.ws-mms-topbar-right a { color: #fff; text-decoration: none; transition: color .2s ease; }
.ws-mms-topbar-right a:hover { color: var(--ws-mms-accent); }
.ws-mms-topbar-sep { color: rgba(255,255,255,.35); }

/* ===== Barre principale blanche ===== */
.ws-mms-bar {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: var(--ws-mms-bg);
  transition: padding .25s ease;
}
.ws-mms.is-scrolled .ws-mms-bar { padding-top: 10px; padding-bottom: 10px; }

.ws-mms-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  flex: 0 0 auto;
  text-decoration: none;
  transition: transform .25s ease;
}
.ws-mms-brand:hover { transform: translateY(-1px); }
.ws-mms-brand img {
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.ws-mms-logo-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--ws-mms-radius-sm);
  background: var(--ws-mms-blue);
  color: var(--ws-mms-accent);
  font-weight: 900;
  font-size: 22px;
}
.ws-mms.is-scrolled .ws-mms-brand { height: 46px; }
.ws-mms.is-scrolled .ws-mms-brand img { max-height: 46px; }

/* ===== Navigation principale ===== */
.ws-mms-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}
.ws-mms-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.ws-mms-item { position: relative; }
.ws-mms-item > a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--ws-mms-radius-sm);
  text-decoration: none;
  color: var(--ws-mms-text);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .005em;
  position: relative;
  transition: color .2s ease, background .2s ease;
}
.ws-mms-item > a:after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: var(--ws-mms-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.ws-mms-item > a:hover,
.ws-mms-item.has-mega:hover > a {
  color: var(--ws-mms-blue);
  background: rgba(1,30,68,.04);
}
.ws-mms-item.current-menu-item > a,
.ws-mms-item.current-menu-ancestor > a { color: var(--ws-mms-blue); }
.ws-mms-item.current-menu-item > a:after,
.ws-mms-item.current-menu-ancestor > a:after,
.ws-mms-item > a:hover:after { transform: scaleX(1); }

/* ===== Mega menu déroulant ===== */
.ws-mms-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(940px, calc(100vw - 32px));
  padding-top: 14px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
}
.ws-mms-item:hover .ws-mms-mega,
.ws-mms-item:focus-within .ws-mms-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ws-mms-mega-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--ws-mms-border);
  border-radius: 18px;
  background: var(--ws-mms-bg);
  box-shadow: var(--ws-mms-shadow-lg);
}
.ws-mms-mega-col {
  padding: 16px;
  border: 1px solid var(--ws-mms-border);
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-bg-alt);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.ws-mms-mega-col:hover {
  border-color: rgba(254,171,11,.45);
  background: #fff;
  transform: translateY(-2px);
}
.ws-mms-mega-title {
  display: block;
  color: var(--ws-mms-blue);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 8px;
  transition: color .2s ease;
}
.ws-mms-mega-title:hover { color: var(--ws-mms-accent); }
.ws-mms-mega-col p {
  margin: 0;
  color: var(--ws-mms-text-soft);
  font-size: 13px;
  line-height: 1.5;
}
.ws-mms-mega-col ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.ws-mms-mega-col li a {
  display: block;
  padding: 6px 0;
  color: var(--ws-mms-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .2s ease, padding-left .2s ease;
}
.ws-mms-mega-col li a:hover { color: var(--ws-mms-accent); padding-left: 4px; }

/* Bloc highlight (encadré doré pâle façon .note du site) */
.ws-mms-mega-highlight {
  padding: 18px;
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-accent-soft);
  border: 1px solid var(--ws-mms-accent-border);
  color: #6a5127;
}
.ws-mms-mega-highlight strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ws-mms-blue);
  font-size: 15px;
  font-weight: 800;
}
.ws-mms-mega-highlight span {
  color: #6a5127;
  font-size: 13px;
  line-height: 1.5;
}

/* ===== Actions (lang / search / CTA / hamburger) ===== */
.ws-mms-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-mms-search-btn,
.ws-mms-toggle {
  border: 1px solid var(--ws-mms-border);
  background: #fff;
  color: var(--ws-mms-blue);
  border-radius: var(--ws-mms-radius-sm);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.ws-mms-search-btn {
  width: 42px;
  height: 42px;
  font-size: 22px;
  line-height: 1;
  font-family: inherit;
}
.ws-mms-search-btn:hover {
  border-color: var(--ws-mms-accent);
  color: var(--ws-mms-accent);
  background: var(--ws-mms-accent-soft);
}

/* CTA principal doré */
.ws-mms-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: var(--ws-mms-radius-sm);
  background: var(--ws-mms-accent);
  color: var(--ws-mms-accent-ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .005em;
  white-space: nowrap;
  box-shadow: var(--ws-mms-shadow-cta);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.ws-mms-cta:hover {
  transform: translateY(-1px);
  background: #ffb828;
  box-shadow: 0 10px 28px rgba(254,171,11,.42);
}
.ws-mms-cta:focus-visible {
  outline: 3px solid rgba(1,30,68,.35);
  outline-offset: 3px;
}

/* Sélecteur de langue (Polylang / WPML) */
.ws-mms-lang,
.ws-mms-lang ul {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: row !important;
  gap: 6px !important;
}
.ws-mms-lang ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.ws-mms-lang li { list-style: none !important; margin: 0 !important; padding: 0 !important; display: flex !important; }
.ws-mms-lang a {
  display: flex !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ws-mms-border);
  background: #fff;
  opacity: .72;
  transition: opacity .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.ws-mms-lang a:hover,
.ws-mms-lang .current-lang a { opacity: 1; }
.ws-mms-lang a:hover { transform: translateY(-1px); }
.ws-mms-lang .current-lang a {
  border-color: var(--ws-mms-accent) !important;
  box-shadow: 0 0 0 3px rgba(254,171,11,.16);
}
.ws-mms-lang img {
  width: 18px !important;
  height: 18px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  display: block !important;
}

/* Hamburger animé */
.ws-mms-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.ws-mms-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ws-mms-blue);
  border-radius: 999px;
  transition: transform .3s ease, opacity .2s ease, background .2s ease;
}
.ws-mms-toggle:hover {
  border-color: var(--ws-mms-accent);
  background: var(--ws-mms-accent-soft);
}
.ws-mms-toggle[aria-expanded="true"] {
  background: var(--ws-mms-accent-soft);
  border-color: var(--ws-mms-accent);
}
.ws-mms-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--ws-mms-accent); }
.ws-mms-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ws-mms-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--ws-mms-accent); }

/* Focus visible global */
.ws-mms-search-btn:focus-visible,
.ws-mms-search-close:focus-visible,
.ws-mms-toggle:focus-visible,
.ws-mms-item > a:focus-visible {
  outline: 3px solid rgba(254,171,11,.45);
  outline-offset: 3px;
}

/* ===== Search panel (overlay) ===== */
.ws-mms-search-panel {
  position: fixed;
  inset: 0;
  background: rgba(2,15,40,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 16px;
  z-index: 99999;
}
.ws-mms-search-panel[hidden] { display: none !important; }
body.ws-mms-search-open { overflow: hidden; }

.ws-mms-search-box {
  width: min(760px, 100%);
  border-radius: 20px;
  border: 1px solid var(--ws-mms-border);
  background: #fff;
  box-shadow: 0 30px 90px rgba(2,15,40,.35);
  padding: 22px;
}
.ws-mms-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: var(--ws-mms-blue);
  font-size: 16px;
}
.ws-mms-search-head strong { font-weight: 800; }
.ws-mms-search-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ws-mms-border);
  background: #fff;
  color: var(--ws-mms-blue);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.ws-mms-search-close:hover {
  border-color: var(--ws-mms-accent);
  color: var(--ws-mms-accent);
  background: var(--ws-mms-accent-soft);
}
.ws-mms-search-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--ws-mms-border);
  background: var(--ws-mms-bg-alt);
  color: var(--ws-mms-text);
  outline: none;
  font-size: 16px;
  font-family: inherit;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ws-mms-search-input::placeholder { color: var(--ws-mms-text-soft); }
.ws-mms-search-input:focus {
  border-color: var(--ws-mms-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(254,171,11,.16);
}
.ws-mms-search-results {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: 60vh;
  overflow: auto;
}
.ws-mms-result {
  display: block;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ws-mms-bg-alt);
  border: 1px solid var(--ws-mms-border);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.ws-mms-result:hover {
  border-color: rgba(254,171,11,.55);
  background: #fff;
  transform: translateX(2px);
}
.ws-mms-result strong {
  display: block;
  color: var(--ws-mms-blue);
  font-size: 15px;
  font-weight: 800;
}
.ws-mms-result span {
  display: block;
  color: var(--ws-mms-accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 4px 0;
}
.ws-mms-result p {
  margin: 0;
  color: var(--ws-mms-text-soft);
  font-size: 13px;
  line-height: 1.5;
}
.ws-mms-empty {
  color: var(--ws-mms-text);
  font-size: 13px;
  padding: 12px 16px;
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-bg-alt);
  border: 1px solid var(--ws-mms-border);
}

/* ===== Drawer mobile plein écran ===== */
.ws-mms-fullscreen[hidden] { display: none !important; }
body.ws-mms-menu-open { overflow: hidden; }
.ws-mms-toggle { z-index: 10002; }

.ws-mms-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(2,15,40,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.ws-mms-fullscreen.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ws-mms-fullscreen-inner {
  width: min(88vw, 440px);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 92px 22px 28px;
  overflow: auto;
  text-align: left;
  background: #fff;
  border-left: 1px solid var(--ws-mms-border);
  box-shadow: -30px 0 90px rgba(2,15,40,.18);
  transform: translateX(100%);
  opacity: 1;
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
}
.ws-mms-fullscreen.open .ws-mms-fullscreen-inner { transform: translateX(0); }

.ws-mms-fullscreen-list,
.ws-mms-fullscreen-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ws-mms-fullscreen-list {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}
.ws-mms-fullscreen-list > li {
  margin: 0;
  opacity: 1;
  transform: none;
}
.ws-mms-fullscreen-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-bg-alt);
  border: 1px solid var(--ws-mms-border);
  color: var(--ws-mms-blue);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.005em;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.ws-mms-fullscreen-link:hover,
.ws-mms-fullscreen-link:focus-visible {
  color: var(--ws-mms-accent);
  border-color: rgba(254,171,11,.45);
  background: var(--ws-mms-accent-soft);
  transform: translateX(2px);
}
.ws-mms-fullscreen-link:after { display: none; }
.ws-mms-fullscreen-sub {
  display: grid;
  gap: 4px;
  margin: 6px 0 10px;
  padding: 10px;
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-bg-alt);
  border: 1px solid var(--ws-mms-border);
}
.ws-mms-fullscreen-sub a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--ws-mms-radius-sm);
  color: var(--ws-mms-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s ease, color .2s ease;
}
.ws-mms-fullscreen-sub a:hover {
  color: var(--ws-mms-blue);
  background: #fff;
}
.ws-mms-fullscreen-cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 20px;
  border-radius: var(--ws-mms-radius);
  background: var(--ws-mms-accent);
  color: var(--ws-mms-accent-ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--ws-mms-shadow-cta);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ws-mms-fullscreen-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(254,171,11,.42);
}
.ws-mms-fullscreen-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--ws-mms-border);
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--ws-mms-text-soft);
  font-size: 14px;
}
.ws-mms-fullscreen-foot a {
  color: var(--ws-mms-blue);
  text-decoration: none;
  font-weight: 600;
}
.ws-mms-fullscreen-foot a:hover { color: var(--ws-mms-accent); }
.ws-mms-fullscreen-empty {
  padding: 18px;
  border-radius: var(--ws-mms-radius);
  border: 1px solid var(--ws-mms-accent-border);
  background: var(--ws-mms-accent-soft);
  color: #6a5127;
  margin-bottom: 20px;
}

/* Sous-toggle (legacy) caché : sous-menus toujours visibles */
.ws-mms-sub-toggle { display: none !important; }
.ws-mms-fullscreen-sub,
.ws-mms-fullscreen-sub[hidden] {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== Responsive ===== */
@media (max-width: 1020px) {
  .ws-mms-bar { gap: 12px; padding-left: 16px; padding-right: 16px; }
  .ws-mms-item > a { padding: 10px 11px; font-size: 14px; }
}

@media (max-width: 920px) {
  .ws-mms-toggle { display: flex; }
  .ws-mms-nav { display: none; }

  .ws-mms-bar {
    padding: 10px 14px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
  }
  /* Réordonnancement mobile : brand à gauche, actions au centre, hamburger tout à droite */
  .ws-mms-brand { order: 1; height: 48px; margin-right: auto; }
  .ws-mms-actions { order: 2; margin-left: 0; gap: 8px; }
  .ws-mms-toggle { order: 3; margin-left: 4px; }

  .ws-mms-brand img { max-height: 48px; }
  .ws-mms-search-btn,
  .ws-mms-toggle { width: 42px; height: 42px; }
  /* CTA devis masqué en mobile : il reste accessible dans le drawer hamburger */
  .ws-mms-cta { display: none !important; }
  .ws-mms-lang { display: none; }

  .ws-mms-topbar-inner {
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    justify-content: flex-start;
  }
  .ws-mms-topbar-left {
    width: auto;
    flex-wrap: wrap;
  }
  /* Bloc droit (intervention 7j/7 + téléphone) masqué en mobile pour libérer la topbar */
  .ws-mms-topbar-right { display: none !important; }
}

@media (max-width: 520px) {
  .ws-mms-topbar-inner {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  .ws-mms-topbar-left {
    width: 100%;
    justify-content: flex-start;
  }
  .ws-mms-bar { padding: 8px 12px; }
  .ws-mms-brand { height: 44px; }
  .ws-mms-brand img { max-height: 44px; }
  .ws-mms-search-btn,
  .ws-mms-toggle { width: 40px; height: 40px; }
  .ws-mms-search-panel { padding: 80px 12px; }
  .ws-mms-fullscreen-inner { width: min(92vw, 440px); padding-left: 18px; padding-right: 18px; }
  .ws-mms-fullscreen-link { font-size: 17px; min-height: 50px; }
}
