/* Ynisek - Méga-menu, intégré au bandeau violet comme chez LDLC */

/* Le panneau se positionne par rapport à la barre, donc sous le bouton "Tous nos produits" */
#header .yn-mm {
  position: relative;
}

#header .yn-mm-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#header .yn-mm-bar > li {
  position: static;
  display: flex;
}

/* Bouton "Tous nos produits" : onglet arrondi en haut */
#header .yn-mm-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 2px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--yn-accent, #f08300);
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}

#header .yn-mm-all-btn > .material-icons:first-child {
  display: none;
}

#header .yn-mm-all-btn:hover {
  background: var(--yn-accent-hover, #d47300);
}

#header .yn-mm-all.is-open .yn-mm-all-btn {
  position: relative;
  z-index: 1001; /* recouvre la bordure haute du panneau : l'onglet et le panneau ne font qu'un */
  border-color: var(--yn-primary-light, #4e1c70);
  background: #fff;
  color: var(--yn-primary, #3b1151);
}

#header .yn-mm-caret {
  font-size: 20px;
  transition: transform .2s;
}

#header .yn-mm-all.is-open .yn-mm-caret {
  transform: rotate(180deg);
}

/* Onglets : majuscules blanches avec icône */
#header .yn-mm-tab > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border-bottom: 3px solid transparent;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

#header .yn-mm-tab > a .material-icons {
  font-size: 24px;
  color: #fff;
}

#header .yn-mm-tab > a:hover {
  color: var(--yn-accent, #f08300);
  border-bottom-color: var(--yn-accent, #f08300);
}

#header .yn-mm-tab > a:hover .material-icons {
  color: var(--yn-accent, #f08300);
}

/* ---------- Panneau : liste des catégories + sous-catégories en colonnes ---------- */

#header .yn-mm-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  margin-top: -2px;
  width: 100%;
  max-width: 1120px;
  min-height: 470px;
  border: 2px solid var(--yn-primary-light, #4e1c70);
  border-radius: 0 10px 10px 10px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .22);
  overflow: hidden;
}

#header .yn-mm-all.is-open .yn-mm-panel {
  display: block;
}

#header .yn-mm-cats {
  width: 250px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border-right: 1px solid var(--yn-border, #e5e5ea);
}

#header .yn-mm-cat {
  border-bottom: 1px solid var(--yn-border, #e5e5ea);
}

#header .yn-mm-cat-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  color: var(--yn-text, #1d1d1f);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}

#header .yn-mm-cat-link .material-icons {
  font-size: 26px;
  color: var(--yn-primary-light, #4e1c70);
}

#header .yn-mm-cat-link span {
  flex: 1 1 auto;
}

#header .yn-mm-chevron {
  font-size: 20px !important;
  color: var(--yn-text, #1d1d1f) !important;
}

#header .yn-mm-cat.is-active > .yn-mm-cat-link {
  color: var(--yn-accent, #f08300);
  font-weight: 600;
}

#header .yn-mm-cat.is-active > .yn-mm-cat-link .yn-mm-chevron {
  color: var(--yn-accent, #f08300) !important;
}

#header .yn-mm-expand {
  display: none;
}

/* Sous-catégories de la catégorie survolée */
#header .yn-mm-sub {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 250px;
  padding: 18px 8px 16px;
  overflow-y: auto;
  background: #f5f0f9;
}

#header .yn-mm-cat.is-active > .yn-mm-sub {
  display: block;
}

#header .yn-mm-cols {
  columns: 5;
  column-gap: 0;
  column-rule: 1px solid rgba(59, 17, 81, .14);
}

#header .yn-mm-col {
  break-inside: avoid;
  padding: 0 16px 22px;
}

#header .yn-mm-col-title {
  display: block;
  margin-bottom: 8px;
  color: var(--yn-primary, #3b1151);
  font-size: .9375rem;
  font-weight: 700;
}

#header .yn-mm-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#header .yn-mm-col li a {
  display: block;
  padding: 4px 0;
  color: #4a4a4f;
  font-size: .875rem;
}

#header .yn-mm-col li a.yn-mm-more {
  color: var(--yn-primary, #3b1151);
  font-weight: 700;
}

#header .yn-mm-sub a:hover,
#header .yn-mm-col li a:hover,
#header .yn-mm-col-title:hover {
  color: var(--yn-accent, #f08300);
}

#header .yn-mm-seeall {
  display: inline-block;
  margin: 4px 16px 0;
  color: var(--yn-accent, #f08300);
  font-size: .875rem;
  font-weight: 700;
}

/* Écrans moyens : onglets plus compacts */
@media (max-width: 1199px) {
  #header .yn-mm-all-btn {
    padding: 10px 14px;
  }

  #header .yn-mm-tab > a {
    gap: 4px;
    font-size: .8125rem;
  }

  #header .yn-mm-tab > a .material-icons {
    display: none;
  }

  #header .yn-mm-cols {
    columns: 3;
  }
}

/* ---------- Mobile : le thème déplace la barre dans le tiroir #_mobile_top_menu ---------- */

@media (max-width: 767px) {
  #header #_mobile_top_menu .yn-mm-bar {
    display: block;
    width: 100%;
    padding: 8px 0;
  }

  #header #_mobile_top_menu .yn-mm-bar > li {
    display: block;
  }

  #header #_mobile_top_menu .yn-mm-all-btn {
    width: 100%;
    margin: 0;
    border-radius: 8px;
    justify-content: flex-start;
  }

  #header #_mobile_top_menu .yn-mm-caret {
    margin-left: auto;
  }

  #header #_mobile_top_menu .yn-mm-panel {
    position: static;
    width: 100%;
    min-height: 0;
    margin-top: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #header #_mobile_top_menu .yn-mm-cats {
    width: 100%;
    border-right: 0;
  }

  #header #_mobile_top_menu .yn-mm-cat {
    position: relative;
  }

  #header #_mobile_top_menu .yn-mm-cat.is-active > .yn-mm-cat-link {
    color: var(--yn-text, #1d1d1f);
    font-weight: 500;
  }

  #header #_mobile_top_menu .yn-mm-chevron {
    display: none;
  }

  #header #_mobile_top_menu .yn-mm-cat-link {
    padding-right: 56px;
  }

  #header #_mobile_top_menu .yn-mm-expand {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 50px;
    border: 0;
    background: transparent;
    color: var(--yn-text, #1d1d1f);
  }

  #header #_mobile_top_menu .yn-mm-cat.is-expanded .yn-mm-expand .material-icons {
    transform: rotate(180deg);
  }

  #header #_mobile_top_menu .yn-mm-sub,
  #header #_mobile_top_menu .yn-mm-cat.is-active > .yn-mm-sub {
    display: none;
    position: static;
    padding: 8px 18px 16px 54px;
  }

  #header #_mobile_top_menu .yn-mm-cat.is-expanded > .yn-mm-sub {
    display: block;
  }

  #header #_mobile_top_menu .yn-mm-cols {
    columns: 1;
    column-rule: none;
  }

  #header #_mobile_top_menu .yn-mm-col {
    padding: 0 0 10px;
  }

  #header #_mobile_top_menu .yn-mm-col ul,
  #header #_mobile_top_menu .yn-mm-seeall {
    display: none;
  }

  #header #_mobile_top_menu .yn-mm-tab > a {
    padding: 12px 18px;
    border-bottom: 1px solid var(--yn-border, #e5e5ea);
    color: var(--yn-text, #1d1d1f);
  }

  #header #_mobile_top_menu .yn-mm-tab > a .material-icons {
    display: inline-block;
    color: var(--yn-primary-light, #4e1c70);
  }
}
