/* ============================================================
   IRRIGATION BOJET — menu_haut.css
   #menuhaut wraps everything. On desktop it's a flex row.
   On mobile (<= 900px) it shows a hamburger and collapses #menu.
   ============================================================ */

/* ── OUTER WRAPPER ── */
#menuhaut {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100vw;
  background: rgba(245,248,253,.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(61,84,136,.1);
  box-sizing: border-box;
  /* Cap inner content at 1200px and centre it */
  padding: 0;
}

/* Centre the menu links within the full-width bar */
#menu {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── NAV LOGO (desktop: hidden, mobile: SVG logo) ── */
#nav-site-name {
  display: none;
  padding: 0 0 0 14px;
  flex: 1;
}

#nav-site-name img {
  height: 36px;
  width: auto;
  display: block;
}

/* ── HAMBURGER — hidden on desktop ── */
#nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid rgba(61,84,136,.12);
  border-radius: 8px;
  cursor: pointer;
  margin: 6px 12px 6px auto;
  flex-shrink: 0;
  transition: background .18s;
}

#nav-hamburger:hover { background: #eef3fa; }

#nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #3d5488;
  border-radius: 2px;
  position: relative;
  transition: all .25s;
}

#nav-hamburger span::before,
#nav-hamburger span::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: #3d5488;
  border-radius: 2px;
  position: absolute;
  transition: all .25s;
}
#nav-hamburger span::before { top: -5px; }
#nav-hamburger span::after  { top:  5px; }

#nav-hamburger.open span          { background: transparent; }
#nav-hamburger.open span::before  { transform: rotate(45deg);  top: 0; }
#nav-hamburger.open span::after   { transform: rotate(-45deg); top: 0; }

/* ── DESKTOP MENU ── */
#menu,
#menu ul {
  padding: 0; margin: 0;
  list-style: none;
  line-height: 1;
}

/* The <ul id="menu"> fills the nav bar on desktop */
#menu {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 20px;
  gap: 2px;
  font-family: 'DM Sans', Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Top-level items */
#menu > li { position: relative; }

#menu > li > a {
  display: block;
  padding: 8px 16px;
  color: #4a566e;
  background: transparent;
  text-decoration: none;
  border-radius: 999px;
  transition: background .18s, color .18s;
  white-space: nowrap;
}

#menu > li > a:hover,
#menu > li:hover > a,
#menu li.active > a {
  background: #eef3fa;
  color: #3d5488;
}

#menu li.active > a { font-weight: 600; }

/* Last item: red CTA pill */
#menu > li:last-child > a {
  background: #ae0000;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 20px;
}
#menu > li:last-child > a:hover { background: #8a0000; }

/* ── DROPDOWNS ── */
#menu li ul {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(61,84,136,.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(26,36,64,.12);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 1000;
}

#menu li:hover > ul,
#menu li.sfhover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#menu li ul li { border: none; }

#menu li ul li a {
  display: block;
  padding: 9px 14px;
  color: #4a566e;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
}
#menu li ul li a:hover { background: #eef3fa; color: #3d5488; }

/* Sub-sub menus */
#menu li ul ul {
  top: -6px;
  left: calc(100% + 4px);
  margin: 0;
  border-left: none;
}

#menu li:hover ul ul,
#menu li.sfhover ul ul {
  opacity: 0; visibility: hidden; transform: translateY(-6px);
}
#menu li li:hover > ul,
#menu li li.sfhover > ul {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* ── MOBILE (≤ 900px) ── */
@media (max-width: 900px) {

  /* Nav bar: logo row */
  #menuhaut {
    flex-wrap: wrap;
    padding: 0;
    min-height: 52px;
  }

  #nav-site-name { display: block; }
  #nav-hamburger { display: flex; }

  /* #menu collapses into a full-width dropdown panel */
  #menu {
    display: none;
    flex-direction: column;
    height: auto;
    width: 100%;
    padding: 8px 12px 14px;
    gap: 2px;
    background: #fff;
    border-top: 1px solid rgba(61,84,136,.08);
    box-shadow: 0 8px 20px rgba(26,36,64,.1);
    /* reset desktop horizontal height */
    align-items: flex-start;
  }

  #menu.open { display: flex; }

  #menu > li {
    width: 100%;
    position: static;
  }

  #menu > li > a {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
  }

  /* Red CTA: keep colour, go full-width block */
  #menu > li:last-child > a {
    border-radius: 8px;
    text-align: left;
    padding: 11px 14px;
    width: 100%;
  }

  /* Dropdowns: always open inline on mobile */
  #menu li ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 2px 0 4px 16px;
    background: transparent;
    transition: none;
    min-width: 0;
  }

  #menu li ul li a {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    white-space: normal;
  }

  #menu li ul ul { padding-left: 12px; }

  /* Disable the hover-show on mobile (always visible) */
  #menu li:hover > ul,
  #menu li.sfhover > ul,
  #menu li li:hover > ul,
  #menu li li.sfhover > ul {
    opacity: 1; visibility: visible; transform: none;
  }
}

@media (max-width: 640px) {
  #nav-site-name { font-size: 15px; }
  #menu > li > a { font-size: 13px; padding: 10px 12px; }
}

/* ── UTILITY ── */
.centre { text-align: center; }


/* ── LANGUAGE SWITCHER ── */
#nav-lang-switch {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 16px;
    flex-shrink: 0;
}

.nav-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    border-radius: 5px;
    font-family: 'Syne', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.15);
    background: transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.nav-lang-btn:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.3);
    text-decoration: none;
}

.nav-lang-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 24px;
    border-radius: 5px;
    font-family: 'Syne', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
    background: rgba(174,0,0,.6);
    border: 1px solid rgba(174,0,0,.8);
}

@media (max-width: 900px) {
    #nav-lang-switch {
        margin-left: 8px;
    }
}
