/* ===== NAVBAR BASE ===== */
.navbar {
  background-color: #047857;
  padding: 0 10px;
  margin: 0;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  position: sticky;
  top: 0;
  z-index: 9999;
  gap: 5px;
}

.logo-left,
.logo-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.logo-left img,
.logo-right img {
  height: 50px;
  display: block;
}

/* ===== NAV BUTTONS (normal state) ===== */
.navbar-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  justify-content: center;
  flex-wrap: nowrap;         /* never wrap — we handle overflow via JS */
  overflow: hidden;
  min-width: 0;
}

.navbar-buttons .nav-btn {
  background-color: transparent;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}

.navbar-buttons .nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-buttons .nav-btn.active {
  background-color: #856531;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Hidden class used by JS when overflow detected */
.navbar-buttons .nav-btn.nav-hidden {
  display: none !important;
}

/* ===== HAMBURGER BUTTON ===== */
/* Hidden by default, shown by JS when overflow occurs */
.hamburger-btn {
  display: none;             /* JS sets to flex when needed */
  flex-shrink: 0;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  padding: 7px 9px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: background 0.25s, border-color 0.25s;
  margin-left: 4px;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
}

.hamburger-btn.open {
  background: rgba(255, 255, 255, 0.2);
  border-color: white;
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* Animate bars → X when open */
.hamburger-btn.open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== DROPDOWN (overflow pages) ===== */
.nav-overflow-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;                  /* anchored to right side of navbar */
  min-width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  z-index: 9998;
  overflow: hidden;
  /* collapsed state */
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity   0.25s ease;
}

.nav-overflow-dropdown.open {
  max-height: 600px;
  opacity: 1;
  pointer-events: all;
}

.nav-overflow-dropdown .nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border: none;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
  white-space: nowrap;
}

.nav-overflow-dropdown .nav-btn:last-child {
  border-bottom: none;
}

.nav-overflow-dropdown .nav-btn:hover {
  background: #f0fdf4;
  color: #047857;
  padding-left: 24px;
}

.nav-overflow-dropdown .nav-btn.active {
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
  border-left: 4px solid #047857;
}

/* Overlay to close dropdown on outside click */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9997;
}

.nav-overlay.open {
  display: block;
}

/* ===== LARGE SCREEN (1920px+) ===== */
@media (min-width: 1920px) {
  .navbar {
    min-height: 80px;
    padding: 0 20px;
  }

  .logo-left img,
  .logo-right img {
    height: 65px;
  }

  .navbar-buttons .nav-btn {
    padding: 12px 20px;
    font-size: 1.3rem;
    border-radius: 20px;
  }

  .hamburger-btn {
    padding: 11px 13px;
    gap: 7px;
  }

  .hamburger-bar {
    width: 28px;
    height: 3px;
  }

  .hamburger-btn.open .hamburger-bar:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }
  .hamburger-btn.open .hamburger-bar:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }

  .nav-overflow-dropdown .nav-btn {
    font-size: 1.3rem;
    padding: 16px 22px;
  }
}