/* ===== NAVBAR ===== */

.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.navbar {
  background-color: #fff;
  padding: 0 24px;
}

.container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  height: 72px;
}

/* --- Logo --- */
.navbar-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#logo {
  display: flex;
  align-items: center;
}

#logo img {
  width: 60px;
  height: auto;
  max-height: 56px;
  display: block;
  object-fit: contain;
}

/* --- Nav menu --- */
.nav-menu {
  display: flex;
  align-items: center;
}

.navbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Nav items (links & dropdown triggers) --- */
.nav-item-wrapper {
  position: relative;
}

.nav-item {
  text-decoration: none;
  color: #333;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.25s ease, background-color 0.25s ease;
  line-height: 1.4;
  margin: 0;
}

a.nav-item {
  display: flex;
}

.nav-item:hover {
  color: #d32f2f;
  background-color: #fef2f2;
}

/* --- Dropdown arrow --- */
.arrow {
  border: solid #666;
  border-width: 0 2px 2px 0;
  display: inline-block;
  padding: 2.5px;
  margin-left: 2px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.down {
  transform: rotate(45deg);
  position: relative;
  top: -1px;
}

.nav-item-wrapper:hover .arrow {
  border-color: #d32f2f;
}

/* --- Dropdown menu --- */
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  min-width: 260px;
  z-index: 1000;
  border: 1px solid #f0f0f0;
}

/* Bridge the 4px gap so hover is not lost between trigger and dropdown */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 4px;
}

.nav-item-wrapper:hover > .dropdown-menu {
  display: block;
}

.dropdown-menu .menu-item {
  padding: 0;
}

.dropdown-menu .menu-item a {
  text-decoration: none;
  color: #444;
  font-size: 0.9rem;
  display: block;
  padding: 10px 20px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.dropdown-menu .menu-item a:hover {
  color: #d32f2f;
  background-color: #fef2f2;
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #333;
  z-index: 1100;
  position: relative;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.hamburger:hover {
  background-color: #f5f5f5;
}

.hamburger.open::before {
  content: "✕";
  font-size: 1.4rem;
  color: #333;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hamburger.open i {
  display: none;
}

/* ===== MOBILE (≤ 768px) ===== */
@media (max-width: 768px) {
  body.menu-open {
    overflow: hidden;
  }

  .navbar {
    padding: 0 16px;
  }

  .container {
    height: 60px;
    padding: 0;
  }

  .navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  #logo {
    z-index: 1100;
  }

  #logo img {
    width: 50px;
    max-height: 46px;
  }

  .hamburger {
    display: flex;
  }

  /* Off-canvas nav */
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 8px 0;
  }

  .nav-menu.active {
    display: flex;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .nav-item-wrapper {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-item-wrapper:last-child {
    border-bottom: none;
  }

  .nav-item {
    padding: 14px 20px;
    font-size: 0.95rem;
    border-radius: 0;
  }

  /* Mobile dropdown */
  .dropdown-menu {
    display: none;
    position: static;
    background-color: #fafafa;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0;
  }

  .nav-item-wrapper:hover > .dropdown-menu {
    display: none;
  }

  .nav-item-wrapper.active > .dropdown-menu {
    display: block;
  }

  .dropdown-menu .menu-item a {
    padding: 12px 20px 12px 40px;
    font-size: 0.9rem;
  }

  .nav-item-wrapper.active .arrow {
    transform: rotate(-135deg);
    top: 2px;
  }
}
