/* =========================================
   NAVBAR H2SI — navbar.css
   Include dans chaque page: <link rel="stylesheet" href="css/navbar.css">
   ========================================= */

:root {
  --green: #7ebb40;
  --red: #e8321f;
  --blue: #1aaeee;
  --dark: #0d1b2a;
  --white: #ffffff;
  --grey: #f4f7f5;
  --nav-h: 75px;
}

/* Reset minimal */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---- Navbar wrapper ---- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--green);
  height: var(--nav-h);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}

.navbar.scrolled {
  background: rgba(13, 27, 42, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* ---- Logo ---- */
.nav-logo img {
  display: block;
  height: 55px;
  width: auto;
  transition: transform 0.3s;
}
.nav-logo:hover img {
  transform: scale(1.04);
}

/* ---- Desktop menu ---- */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: #000;
  text-decoration: none;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 8px;
  transition:
    color 0.25s,
    background 0.25s;
  white-space: nowrap;
}

.navbar.scrolled .nav-link {
  color: #fff;
}

.nav-link i {
  font-size: 14px;
}
.nav-link .arrow {
  font-size: 11px;
  margin-left: 2px;
  transition: transform 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--red);
  background: rgba(126, 187, 64, 0.18);
}

.nav-link.active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
  border-radius: 8px 8px 0 0;
}

/* Contact button */
.btn-contact {
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  padding: 8px 18px;
  transition:
    background 0.3s,
    transform 0.2s !important;
}
.btn-contact:hover {
  background: #c4291a;
  transform: translateY(-1px);
}

/* ---- Dropdown ---- */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(126, 187, 64, 0.25);
  border-radius: 12px;
  list-style: none;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown:hover .arrow {
  transform: rotate(180deg);
}

.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #000;
  text-decoration: none;
  font-family: "Nunito", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  transition:
    background 0.2s,
    color 0.2s;
}
.dropdown-menu li a:hover {
  background: rgba(126, 187, 64, 0.15);
  color: var(--green);
}

/* Colored dots */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot.green {
  background: var(--green);
}
.dot.blue {
  background: var(--blue);
}
.dot.red {
  background: var(--red);
}

/* ---- Hamburger ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--red);
  border-radius: 2px;
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---- Overlay mobile ---- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-overlay.show {
  opacity: 1;
  display: block;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }
}

@media (max-width: 880px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 90px 20px 30px;
    gap: 4px;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    border-left: 2px solid var(--green);
  }

  .navbar.scrolled .nav-link {
    color: #000;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 10px;
  }
  .nav-link.active {
    border-bottom: none;
    border-left: 3px solid var(--green);
    border-radius: 0 10px 10px 0;
  }

  /* Mobile dropdown */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(126, 187, 64, 0.3);
    background: #fff;
    margin: 4px 0 4px 20px;
    border-radius: 0;
    display: none;
    padding: 4px;
  }

  .dropdown.open .dropdown-menu {
    display: block;
  }
  .dropdown:hover .dropdown-menu {
    display: none;
  }
  .dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu li a {
    font-size: 14px;
    padding: 10px 12px;
  }
  .arrow {
    margin-left: auto;
  }

  .btn-contact {
    margin-top: 10px;
  }
}
