/* AutoProgFrance.fr — étape 1 : bande supérieure Hummingbird 2 */
/* Ne modifie ni le menu, ni le logo, ni la recherche. */

@media (min-width: 768px) {
  #header .header-top {
    background-color: #202939;
    border-bottom: 0;
    min-height: 46px;
  }

  #header .header-top .row {
    min-height: 46px;
    align-items: center;
  }

  #header .header-top,
  #header .header-top * {
    color: #f8fafc !important;
  }

  #header .header-top a:hover,
  #header .header-top a:focus-visible {
    color: #39b6ff !important;
  }
}

/* Etape 2 : logo et recherche plus presents, sans toucher aux hooks. */
@media (min-width: 1200px) {
  #header .header-bottom__row {
    min-height: 106px;
    align-items: center !important;
  }

  #header .header-bottom__logo {
    flex: 0 0 268px;
    width: 268px;
    max-width: 268px;
    margin-right: 0 !important;
  }

  #header .header-bottom__logo img {
    display: block;
    width: 258px !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Identifiant de la recherche Hummingbird / ps_searchbar. */
  #header #_desktop_ps_searchbar {
    flex: 1 1 600px !important;
    width: auto !important;
    max-width: 810px !important;
    min-width: 0;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #header #_desktop_ps_searchbar form,
  #header #_desktop_ps_searchbar .ps-searchbar,
  #header #_desktop_ps_searchbar .ps-searchbar__form {
    width: 100% !important;
    max-width: none !important;
  }

  #header #_desktop_ps_searchbar .ps-searchbar__input,
  #header #_desktop_ps_searchbar input[type="search"] {
    width: 100% !important;
    min-height: 54px;
    background-color: #f7f5f2;
    border: 1px solid #dddfe4;
    border-radius: 12px;
    font-size: 16px;
  }
}

/* Etape 3 : alignement du vrai menu Hummingbird 2 (DOM verifie). */
@media (min-width: 1200px) {
  #header .header-nav-full-width {
    background: #ffffff;
    border-bottom: 1px solid #e6eaf0;
  }

  /* Le module Hummingbird n'utilise PAS l'ancien #_desktop_top_menu.
     La classe ps-mainmenu--desktop est le conteneur reel dans le header. */
  #header .header-nav-full-width > .ps-mainmenu--desktop {
    flex: 0 1 auto !important;
    width: fit-content !important;
    max-width: calc(100% - 32px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #header .header-nav-full-width #top-menu {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    gap: 2px;
  }

  #header .header-nav-full-width #top-menu .ps-mainmenu__tree-link {
    display: inline-flex;
    align-items: center;
    padding: 15px 8px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
  }

  #header .header-nav-full-width #top-menu .ps-mainmenu__tree-link:hover,
  #header .header-nav-full-width #top-menu .ps-mainmenu__tree-link:focus-visible {
    color: #087eee !important;
  }
}

/* Etape 4 : actions compte et panier a droite de la recherche.
   IMPORTANT : ps_customersignin et ps_shoppingcart doivent etre
   transplantes dans displayTop APRES ps_searchbar (et retires de displayNav2).
   Le CSS reste limite aux grands ecrans pour conserver le comportement
   mobile natif du theme Hummingbird. */
@media (min-width: 1200px) {
  #header .header-bottom__row {
    flex-wrap: nowrap;
    gap: 12px;
  }

  /* Les utilitaires Bootstrap de Hummingbird imposent parfois leur propre
     ordre, independamment de la position des modules dans displayTop. */
  #header .header-bottom__row > .header-bottom__logo {
    order: 0 !important;
  }

  #header .header-bottom__row > #_desktop_ps_searchbar {
    order: 1 !important;
    flex: 1 1 380px !important;
    width: auto !important;
    max-width: none !important;
    min-width: 240px;
    margin: 0 4px 0 22px !important;
  }

  #header .header-bottom__row > #_desktop_ps_customersignin,
  #header .header-bottom__row > #_desktop_ps_shoppingcart {
    display: flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
  }

  #header .header-bottom__row > #_desktop_ps_customersignin {
    order: 2 !important;
  }

  #header .header-bottom__row > #_desktop_ps_shoppingcart {
    order: 3 !important;
  }

  #header #_desktop_ps_customersignin .header-block__action-btn,
  #header #_desktop_ps_customersignin a.login,
  #header #_desktop_ps_customersignin a.account,
  #header #_desktop_ps_shoppingcart .header-block__action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 54px;
    padding: 0 15px;
    border: 1px solid #d9e1eb;
    border-radius: 12px;
    background: #ffffff;
    color: #14243b !important;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgb(20 36 59 / 4%);
    transition: background-color 0.2s ease, border-color 0.2s ease,
      box-shadow 0.2s ease;
  }

  #header #_desktop_ps_customersignin .header-block__action-btn:hover,
  #header #_desktop_ps_customersignin a.login:hover,
  #header #_desktop_ps_customersignin a.account:hover {
    border-color: #2a9cff;
    background: #f1f8ff;
    box-shadow: 0 3px 10px rgb(8 126 238 / 10%);
  }

  #header #_desktop_ps_shoppingcart .header-block__action-btn {
    border-color: #087eee;
    background: #087eee;
    color: #ffffff !important;
  }

  #header #_desktop_ps_shoppingcart .header-block__action-btn:hover {
    border-color: #006bd4;
    background: #006bd4;
  }

  #header #_desktop_ps_shoppingcart .header-block__action-btn .header-block__icon,
  #header #_desktop_ps_shoppingcart .header-block__action-btn .material-icons {
    color: #ffffff !important;
  }

  #header #_desktop_ps_shoppingcart .header-block__badge {
    background: #ffffff;
    color: #087eee !important;
  }
}
