/* ===================== */
/*  VARIABLES / GLOBAL   */
/* ===================== */
:root{
  --nav-h: 90px;
  --nav-bg: #2f4a3a;     /* vert foncé */
  --nav-text: #fff;
  --nav-hover: #8dc63f;  /* vert clair */
  --container: 1240px;
}

html, body {
  margin: 0;
}

body {
  padding-top: var(--nav-h);
}


/* ===================== */
/*        TOPBAR         */
/* ===================== */
.topbar{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 9999;
  background: rgba(47, 74, 58, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.topbar .topbar-content{
  position: relative;
  max-width: var(--container);
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.topbar-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-left: -20px;
}

.topbar-brand img {
  height: 55px;
  width: auto;
}


/* ===================== */
/*         MENU          */
/* ===================== */

.menu{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu_li{
  position: relative;
  padding-bottom: 0;
}

.menu_bouton{
  position: relative;
  display: inline-block;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 0;
  transition: color .2s ease;
}

.menu_bouton:hover {
  color: var(--nav-hover);
}

/* Soulignement animé */
#mainMenu .menu_bouton::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: var(--nav-hover);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: opacity .2s ease, transform .2s ease;
}

#mainMenu .menu_bouton:hover::after,
#mainMenu .menu_bouton:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}


/* ===================== */
/*   BOUTON BURGER BASE  */
/* ===================== */

.topbar-burger{
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--nav-hover);
  background: rgba(0, 0, 0, .10);
  cursor: pointer;
}

/* lignes du burger */
.topbar-burger span {
  background: #fff;
  transition: transform .25s ease, opacity .25s ease;
  width: 22px;
  height: 2px;
}

.topbar-burger span + span{
  margin-top: 5px;
}

/* Burger → croix quand le menu est ouvert */
.topbar.menu-open .topbar-burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.topbar.menu-open .topbar-burger span:nth-child(2) {
  opacity: 0;
}

.topbar.menu-open .topbar-burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ===================== */
/*   BOUTON TELEPHONE    */
/* ===================== */

.phone-btn {
  background: transparent;
  color: var(--nav-hover);
  border: 1px solid rgba(141, 198, 63, 0.5);
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-transform: none;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.phone-btn:hover {
  background: var(--nav-hover);
  border-color: var(--nav-hover);
  color: #1e3d26;
}


/* ===================== */
/*      RESPONSIVE       */
/* ===================== */

@media (max-width: 1024px){

  :root{
    --nav-h: 70px;
  }

  .topbar{
    box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
  }

  .topbar .topbar-content{
    max-width: 100%;
    padding: 0 16px;
    justify-content: space-between;
  }

  /* Logo */
  .topbar-brand {
    margin-left: 0;
  }

  .topbar-brand img{
    height: 40px;
  }

  /* Cacher le menu horizontal */
  .menu {
    display: none;
  }

  /* Burger visible, tout à droite */
  .topbar-burger{
    display: flex;
    flex-direction: column;
    justify-content: center;
    order: 3;
  }

  /* Téléphone compact entre logo et burger */
  .phone-btn {
    order: 2;
    height: 36px;
    font-size: 13px;
    padding: 0 12px;
    margin-left: auto;
    margin-right: 10px;
  }

  /* Conteneur du menu burger */
  #mainMenu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 14px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #1e3d26;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: none;
    pointer-events: none;
    z-index: 9998;
    transition: max-height .3s ease, opacity .25s ease;
  }

  /* Menu ouvert */
  #mainMenu.menu-open {
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
    padding-bottom: 16px;
  }

  .menu_li {
    position: static;
  }

  #mainMenu .menu_bouton {
    display: block;
    width: 100%;
    font-size: 16px;
    text-align: center;
    padding: 14px 0;         /* zones tactiles généreuses */
    color: var(--nav-text);
  }

  #mainMenu .menu_bouton:active {
    background: rgba(141, 198, 63, 0.15);
  }

  #mainMenu .menu_bouton::after {
    display: none;
  }
}