/* ATCT Customisations 1.1 — style du menu principal (desktop). */
@media (min-width:1025px) {
  .atct-head { position:relative !important; }
  .atct-head .atct-head-inner, .atct-head .atct-nav,
  .atct-head .atct-nav [id^="mega-menu-wrap-"],
  .atct-head .atct-nav [id^="mega-menu-wrap-"] > ul.mega-menu,
  .atct-head .atct-nav [id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-megamenu {
    position:static !important;
  }
  .atct-head .atct-nav [id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-megamenu > ul.mega-sub-menu {
    position:absolute !important;
    left:var(--atct-panel-left,0px) !important;
    right:auto !important;
    width:var(--atct-panel-width,calc(100% - 24px)) !important;
    max-width:none !important;
    box-sizing:border-box !important;
    transform:none !important;
    background:#fff !important;
    padding:30px clamp(30px,4vw,66px) 36px !important;
    border-radius:0 0 7px 7px !important;
    box-shadow:0 15px 30px rgba(9,44,97,.09) !important;
    min-height:0 !important;
  }
  .atct-head .atct-nav .mega-sub-menu .mega-menu-row,
  .atct-head .atct-nav .mega-sub-menu .mega-menu-row > ul.mega-sub-menu {
    width:100% !important;box-shadow:none !important;
  }
  .atct-head .atct-nav .mega-sub-menu .mega-menu-column,
  .atct-head .atct-nav .mega-sub-menu .mega-menu-column > ul.mega-sub-menu,
  .atct-head .atct-nav .atct-liens,
  .atct-head .atct-nav .atct-liens > ul.mega-sub-menu {
    background:transparent !important;box-shadow:none !important;border:0 !important;
  }
  .atct-head .atct-nav .mega-sub-menu .mega-menu-column > ul.mega-sub-menu > li.mega-menu-item {
    height:auto !important;min-height:0 !important;margin:0 !important;padding:0 !important;
  }
  .atct-head .atct-nav .mega-sub-menu .mega-menu-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
    display:block !important;height:auto !important;min-height:0 !important;
    padding:8px 0 !important;margin:0 !important;line-height:1.65 !important;
    font-size:16px !important;font-weight:400 !important;
    text-transform:none !important;white-space:normal !important;
  }
  /* La classe est ajoutée seulement à la 2e colonne du panneau ATCT. */
  html[lang^="fr"] .atct-head .atct-nav .atct-central-column::before {
    content:"ATCT";display:block;color:#003c88;font-weight:700;
    font-size:26px;line-height:1.25;margin:0 0 15px;
  }
  html[lang^="fr"] .atct-head .atct-nav .atct-central-column > ul.mega-sub-menu {
    display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 18px !important;background:#f1f1f1 !important;
    border-radius:4px !important;padding:12px !important;
  }
  html[lang^="fr"] .atct-head .atct-nav .atct-central-column > ul.mega-sub-menu > li.mega-menu-item {
    width:auto !important;float:none !important;
  }
  html[lang^="fr"] .atct-head .atct-nav .atct-central-column > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
    color:#003c88 !important;font-weight:600 !important;
  }
  html[lang^="ar"] .atct-head .atct-nav .mega-menu-megamenu > ul.mega-sub-menu {
    direction:rtl !important;text-align:right !important;
  }
  html[lang^="ar"] .atct-head .atct-nav .mega-sub-menu a.mega-menu-link {
    text-align:right !important;
  }
}

/* ATCT v1.2 — compact panel and social alignment */
@media (min-width:1025px) {
  .atct-head .atct-nav .atct-central-column > ul.mega-sub-menu {
    max-width:590px !important;
  }
  .atct-head .atct-nav .atct-social-column {
    text-align:center !important;
  }
  .atct-head .atct-nav .atct-social-column > ul.mega-sub-menu {
    text-align:center !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:flex-start !important;
  }
  .atct-head .atct-nav .atct-social-column .mega-menu-item-type-widget {
    width:100% !important;
    text-align:center !important;
  }
  .atct-head .atct-nav .atct-social-column .mega-menu-item-type-widget h2,
  .atct-head .atct-nav .atct-social-column .mega-menu-item-type-widget h3,
  .atct-head .atct-nav .atct-social-column .mega-menu-item-type-widget h4 {
    margin-top:0 !important;
    text-align:center !important;
  }
  /* Fallback when JS class assignment is blocked by cache or a menu markup variation. */
  html[lang^="fr"] .atct-head .atct-nav .mega-menu-megamenu > ul.mega-sub-menu .mega-menu-row > ul.mega-sub-menu > li.mega-menu-column:nth-child(2):not(.atct-central-column)::before {
    content:"ATCT";display:block;color:#003c88;font-size:26px;font-weight:700;
    line-height:1.25;margin:0 0 15px;
  }
  html[lang^="fr"] .atct-head .atct-nav .mega-menu-megamenu > ul.mega-sub-menu .mega-menu-row > ul.mega-sub-menu > li.mega-menu-column:nth-child(2):not(.atct-central-column) > ul.mega-sub-menu {
    display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 18px !important;background:#f1f1f1 !important;
    border-radius:4px !important;padding:12px !important;max-width:590px !important;
  }
}

/* v1.4 : UNIQUEMENT la barre de navigation principale (pas les panneaux). */
@media (min-width:1025px) {
  html:not([dir="rtl"]) .atct-head .atct-head-inner { justify-content:flex-start !important; }
  html:not([dir="rtl"]) .atct-head .atct-nav { margin-left:0 !important; margin-right:auto !important; }
  html[dir="rtl"] .atct-head .atct-head-inner,
  body.rtl .atct-head .atct-head-inner { justify-content:flex-start !important; direction:rtl !important; }
  html[dir="rtl"] .atct-head .atct-nav,
  body.rtl .atct-head .atct-nav { margin-right:0 !important; margin-left:auto !important; direction:rtl !important; }
}

/* v1.5 : RTL only. The French v1.4 layout remains unchanged. */
@media (min-width:1025px) {
  html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel,
  html[dir="rtl"] .atct-head .atct-nav .atct-rtl-panel,
  body.rtl .atct-head .atct-nav .atct-rtl-panel {
    direction:rtl !important;
    text-align:right !important;
  }
  html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .mega-menu-row > ul.mega-sub-menu,
  html[dir="rtl"] .atct-head .atct-nav .atct-rtl-panel .mega-menu-row > ul.mega-sub-menu,
  body.rtl .atct-head .atct-nav .atct-rtl-panel .mega-menu-row > ul.mega-sub-menu {
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    direction:rtl !important;
    align-items:flex-start !important;
    justify-content:space-between !important;
    gap:3% !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .mega-menu-row > ul.mega-sub-menu > li.mega-menu-column {
    float:none !important;
    margin:0 !important;
    padding:0 !important;
    min-width:0 !important;
    flex:0 1 auto !important;
    width:auto !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-links {
    order:1 !important;
    flex:0 0 28% !important;
    width:28% !important;
    text-align:right !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center {
    order:2 !important;
    flex:0 0 49% !important;
    width:49% !important;
    text-align:right !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social {
    order:3 !important;
    flex:0 0 16% !important;
    width:16% !important;
    text-align:center !important;
  }
  .atct-head .atct-nav .atct-rtl-panel:not(.atct-rtl-agency) .atct-rtl-links {
    flex:0 0 72% !important;
    width:72% !important;
  }
  .atct-head .atct-nav .atct-rtl-panel:not(.atct-rtl-agency) .atct-rtl-social {
    flex:0 0 18% !important;
    width:18% !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-links a.mega-menu-link {
    direction:rtl !important;
    text-align:right !important;
    font-weight:600 !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center::before {
    content:"الوكالة" !important;
    display:block !important;
    color:#003c88 !important;
    font-weight:700 !important;
    font-size:26px !important;
    line-height:1.25 !important;
    margin:0 0 15px !important;
    text-align:right !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center > ul.mega-sub-menu {
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    direction:rtl !important;
    gap:0 18px !important;
    background:#f1f1f1 !important;
    border-radius:4px !important;
    padding:12px !important;
    max-width:590px !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center > ul.mega-sub-menu > li.mega-menu-item {
    width:auto !important;
    float:none !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center a.mega-menu-link {
    direction:rtl !important;
    text-align:right !important;
    color:#003c88 !important;
    font-weight:600 !important;
  }
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social,
  .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social * {
    text-align:center !important;
  }
}

/* v1.6.1 : colonnes RTL publiques ; aucun CSS n'est chargé dans wp-admin. */
@media(min-width:1025px){
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .mega-menu-row > ul.mega-sub-menu {display:flex!important;direction:rtl!important;justify-content:space-between!important;gap:2.5%!important;align-items:flex-start!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-links {order:1!important;flex:0 0 24%!important;width:24%!important;direction:rtl!important;text-align:right!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel.atct-rtl-agency .atct-rtl-center {order:2!important;flex:0 0 52%!important;width:52%!important;text-align:right!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social {order:3!important;flex:0 0 16%!important;width:16%!important;text-align:center!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel:not(.atct-rtl-agency) .atct-rtl-links {flex:0 0 75%!important;width:75%!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-links a.mega-menu-link {display:block!important;width:100%!important;text-align:right!important;direction:rtl!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center > ul.mega-sub-menu {direction:rtl!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;max-width:590px!important;background:#f1f1f1!important}
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social > ul.mega-sub-menu {display:flex!important;flex-direction:column!important;align-items:center!important}
}

/* 1.7.0 — RTL: heading does not wrap; centered agency card uses full column. */
@media (min-width:1025px) {
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social {
   min-width:155px !important; flex-basis:18% !important; width:18% !important;
 }
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social h2,
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social h3,
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-social h4 {
   white-space:nowrap !important; overflow-wrap:normal !important; word-break:normal !important;
 }
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel.atct-rtl-agency .atct-rtl-center {
   flex-basis:49% !important; width:49% !important; min-width:0 !important;
 }
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center > ul.mega-sub-menu {
   max-width:none !important; width:100% !important; box-sizing:border-box !important;
   gap:8px 20px !important; padding:16px 20px !important;
 }
 html[lang^="ar"] .atct-head .atct-nav .atct-rtl-panel .atct-rtl-center a.mega-menu-link {
   white-space:normal !important; overflow-wrap:normal !important;
 }
}


/* v1.8.1 — Hide only the redundant black Max Mega Menu mobile toggle bar.
   Do not display:none the toggle: it must remain operable by the blue button. */
@media (max-width: 768px) {
  .atct-head.atct-unified-mobile-menu .atct-nav [id^="mega-menu-wrap-"] > .mega-menu-toggle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }
  .atct-head.atct-unified-mobile-menu .atct-nav [id^="mega-menu-wrap-"] {
    position: relative;
  }
}

/* 1.9.7 — alignement des liens du méga-menu arabe uniquement */
html[lang^="ar"] .atct-head .atct-nav .mega-sub-menu a.mega-menu-link,
html[dir="rtl"] .atct-head .atct-nav .mega-sub-menu a.mega-menu-link,
body.rtl .atct-head .atct-nav .mega-sub-menu a.mega-menu-link {
  direction:rtl !important; text-align:right !important; unicode-bidi:plaintext;
}
