/* Header Mon Millésime */

#header {
  position: relative;
  background-color: #000;
  color: #fff;
}

#header a {
  color: #fff;
}

/* Topbar */

.mm-header__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #fff;
}

.mm-header__topbar-left {
  text-align: left;
}

.mm-header__topbar-right {
  text-align: right;
}

/* Main */

.mm-header__main {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 20px 0;
}

.mm-header__logo {
  flex: 0 0 250px;
  max-width: 250px;
}

.mm-header__logo h1 {
  margin: 0;
}

.mm-header__logo img {
  max-width: 100%;
  height: auto;
}

.mm-header__tools {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-width: 0;
}

.mm-header__menu {
  flex: 1 1 auto;
  min-width: 0;
}

.mm-header__search,
.mm-header__account,
.mm-header__cart {
  flex: 0 0 auto;
}

/* Recherche */

.mm-search__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.mm-search__panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 100;
  padding: 20px 0;
  background-color: #fff;
}

.mm-search__panel[hidden] {
  display: none;
}

/* Neutralise le float: right de ps_searchbar.css (>= 768px).
   L'id snake_case vient du module ps_searchbar, il n'est pas renommable. */
/* stylelint-disable-next-line selector-id-pattern */
.mm-search__panel #search_widget {
  float: none;
}

.mm-search__form {
  position: relative;
}

.mm-search__form-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  pointer-events: none;
}

.mm-search__form input[type='text'] {
  width: 100%;
  padding: 12px 16px 12px 56px;
  border: 0;
  background-color: #f1f2f4;
  color: #1b2430;
}

.mm-search__form input[type='text']::placeholder {
  color: #7a8290;
}

/* Compte */

.mm-account {
  position: relative;
}

.mm-account__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.mm-account__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 100;
  width: 280px;
  padding: 20px;
  background-color: #fff;
  color: #1b2430;
  box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.mm-account__panel[hidden] {
  display: none;
}

/* Scopé sous #header pour battre `#header a` (spécificité ID).
   :not(.btn) pour ne pas repeindre les boutons. */
#header .mm-account__panel a:not(.btn) {
  color: #de2527;
}

#header .mm-account__panel a:not(.btn):hover {
  color: #000;
}

.mm-account__hello {
  margin: 0 0 12px;
  color: #000;
  font-weight: 700;
}

.mm-account__logout {
  display: block;
  margin-top: 16px;
}

.mm-account__section + .mm-account__section {
  margin-top: 20px;
}

.mm-account__title {
  margin: 0 0 10px;
  color: #000;
  font-weight: 700;
}

.mm-account__section .btn {
  display: block;
}

#header .mm-dropdown__panel .btn-secondary:hover {
  color: #000;
}

.mm-account__forgot {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* Socle : zone hook liste de liens (fond gris) */

.mm-account__socle {
  margin: 20px -20px -20px;
  padding: 16px 20px;
  background-color: #f1f2f4;
}

/* Panier */

.mm-cart {
  position: relative;
}

.mm-cart__toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.mm-cart__count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background-color: #de2527;
  color: #fff;
  font-size: 0.7rem;
  line-height: 18px;
  text-align: center;
}

.mm-cart__panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 100;
  width: 320px;
  padding: 20px;
  background-color: #fff;
  color: #1b2430;
  box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.mm-cart__panel[hidden] {
  display: none;
}

/* Scopé sous #header pour battre `#header a` (spécificité ID),
   :not(.btn) pour ne pas repeindre le bouton. */
#header .mm-cart__panel a:not(.btn) {
  color: #1b2430;
}

.mm-cart__products {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.mm-cart__products > li {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.mm-cart__product {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.mm-cart__product-img {
  flex: 0 0 48px;
  width: 48px;
  line-height: 0;
}

.mm-cart__product-img img {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

.mm-cart__product-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 2px;
}

.mm-cart__product-name {
  font-size: 0.85rem;
  line-height: 1.3;
}

.mm-cart__product-qty {
  color: #7a8290;
  font-size: 0.75rem;
}

.mm-cart__product-total {
  font-weight: 600;
  white-space: nowrap;
}

.mm-cart__product-remove {
  flex: 0 0 auto;
  display: flex;
  padding: 4px;
  line-height: 0;
}

.mm-cart__line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.mm-cart__line + .mm-cart__line {
  margin-top: 6px;
}

.mm-cart__total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-weight: 700;
}

.mm-cart__panel .btn {
  display: block;
  margin-top: 16px;
}

.mm-cart__empty {
  margin: 0;
}

/* Méga-menu (module mmmegamenu) */

.mm-megamenu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.75rem;
  margin: 0;

  /* Même écart après le dernier item qu'entre les items. */
  padding: 0 2.75rem 0 0;
  list-style: none;
}

.mm-megamenu__item {
  /* Panneau positionné par rapport à #header (plein largeur). */
  position: static;
}

.mm-megamenu__link {
  display: inline-block;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Scopé sous #header pour battre `#header a` (spécificité ID). La couleur par
   entrée est passée en variable inline pour laisser le `:hover` ci-dessous
   reprendre la main (une couleur inline sur `color` bloquerait le survol). */
#header .mm-megamenu__link {
  color: var(--mm-link-color, #fff);
}

#header .mm-megamenu__link:hover,
.mm-megamenu__item--mega.is-open .mm-megamenu__link {
  color: #de2527;
}

.mm-megamenu__panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 90;
  display: none;

  /* Largeur du contenu gérée par CE (kit : .elementor-section-boxed >
     .elementor-container { max-width: 1400px }), centrée sous le header. */
  max-width: 1400px;
  margin-inline: auto;
  background-color: #fff;
  color: #1b2430;
  box-shadow: 0 12px 24px rgb(0 0 0 / 10%);
}

.mm-megamenu__item--mega.is-open .mm-megamenu__panel {
  display: block;
}

/* Neutralise le blanc de `#header a` dans le panneau : les liens suivent la
   cascade du contenu Creative Elements plutôt que d'être blancs sur blanc. */
#header .mm-megamenu__panel a {
  color: inherit;
}

/* Dans le builder CE uniquement (jamais sur le front) : on aplatit les
   conteneurs flex du header pour que le panneau édité s'étale en pleine largeur
   et en flux, offrant une vraie zone de construction. */
body.elementor-editor-active .mm-header__main,
body.elementor-editor-active .mm-header__tools,
body.elementor-editor-active .mm-header__menu,
body.elementor-editor-active .mm-megamenu,
body.elementor-editor-active .mm-megamenu__item {
  display: block;
}

body.elementor-editor-active .mm-megamenu__panel {
  position: static;
  display: block;
  width: 100%;
}
