

/* ------------------------------------------------------------
   Bloc nav menu mobile
   ------------------------------------------------------------ */

.c-mobile-menu{
  /* Tokens locaux du composant */
  --mm-top: var(--header-h);
  --mm-w: min(92vw, 360px);
  --mm-pad: 16px;
  --mm-gap: 8px;
  --mm-radius: 10px;
  --mm-z: 1000;

  --mm-bg: var(--color-bg);
  --mm-fg: var(--color-body);
  --mm-border: 1px solid transparent;
  --mm-hover: color-mix(in srgb, var(--smoke-80), #fff 94%);
  --mm-shadow: 0 10px 30px rgba(0,0,0,.12);

  position: fixed;
  top: var(--mm-top);
  left: 0;
  height: calc(100% - var(--mm-top));
  width: var(--mm-w);
  background: var(--mm-bg);
  color: var(--mm-fg);
  transform: translateX(-100%);
  transition: transform .4s cubic-bezier(0.00,0.00,0.20,1.00);
  z-index: var(--mm-z);
  box-shadow: var(--mm-shadow);
  will-change: transform;
}

.mobile-menu--open{ transform: translateX(0); }

/* Panneau interne */
.c-mobile-menu__panel{
  height: 100%;
  overflow: auto;
}

/* Liste */
.c-mobile-menu__list{ display: grid; }

/* Boutons/links */
.c-mobile-menu__link{
  display: inline-flex;
  align-items: center;
  padding: 20px;
  border-bottom: solid 1px #f5f4f2;
  cursor: pointer;
  width: 100%;
}

.c-mobile-menu__item--header-login i{
  font-size: var(--fs-600);
}

.c-mobile-menu__submenu-list li > a{
  padding: 20px 20px 20px 30px;
}

.c-mobile-menu__link:hover,
.c-mobile-menu__toggle:hover{
  background: var(--mm-hover);
}

.c-mobile-menu__toggle[aria-expanded="true"]{
  background: color-mix(in srgb, var(--on-surface), #fff 90%);
}

.c-mobile-menu__submenu-list{ display: grid; }

/* Animation d'ouverture/fermeture accordéon (max-height) */
.c-mobile-menu__submenu{
  overflow: hidden;
  transition: max-height .28s ease;
}

.c-mobile-menu__item.is-open > .c-mobile-menu__submenu{
  max-height: 600px;
}

/* Focus accessible */
.c-mobile-menu__link:focus-visible,
.c-mobile-menu__toggle:focus-visible{
  outline: 2px solid #4c9ffe;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Backdrop/overlay pour fermer au clic */
.c-mobile-menu-backdrop{
  position: fixed;
  inset: var(--mm-top) 0 0 0;
  background: rgb(0 0 0 / .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: calc(var(--mm-z) - 1);
}

.mobile-menu--open + .c-mobile-menu-backdrop{
  opacity: 1;
  pointer-events: auto;
}

/* Safe-area iOS */
@supports (padding: max(0px)){
  .c-mobile-menu__panel{
    padding-bottom: max(var(--mm-pad), env(safe-area-inset-bottom));
  }
}

/* Thème sombre (facultatif) */
body[data-theme="dark"] .c-mobile-menu{
  --mm-bg: #0f1720;
  --mm-fg: #e5e7eb;
  --mm-hover: color-mix(in srgb, var(--color-hightlight), #0f1720 85%);
  --mm-shadow: 0 12px 36px rgba(0,0,0,.5);
}

/* ===== mobile overlay ==>< =====*/
.c-mobile-overlay {
	position: fixed;
    visibility: hidden;
	opacity: 0;
    width: 100%;
    margin: 0;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    left: 0;
	bottom: 0;
    cursor: none;
	transition: opacity cubic-bezier(0, 0, 1, 1) 200ms;
	animation: mainCloseDrop 200ms;
	z-index: 1;
} 

/* ===== mobile overlay open ==>< ===== */
.c-mobile-overlay.is-visible{
  animation: mainOpenEnter 200ms;
  visibility: visible;
  cursor: pointer;
  opacity: 1;
  z-index: 1;
}

/* ===== keyframe ==>< ===== */
@keyframes mainOpenEnter {
	0% {
		visibility: hidden;
	}

	1% {
		visibility: visible;
	}
}
@keyframes mainCloseDrop {
	0%, 99% {
		visibility: visible;
	}
	100% {
		visibility: hidden;
	}
}
