/* Navbar container */
.category-nav {
  position: relative;
  z-index: 1000; /* keeps it above images */
}

/* Toggle button */
.menu-toggle {
  width: 100%;
  background: #111;
  color: #fff;
  border: none;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  border-radius: 15px;
  z-index: 0;
}

/* Menu (overlay, hidden by default) */
.category-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #222;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
z-index: none;

  max-height: 0; /* hidden initially */
  overflow: hidden;
  display: flex;
  flex-direction: column;

  transition: max-height 0.4s ease;
}

/* Menu item styling */
.category-menu li {
  border-top: 1px solid #333;
}
.category-menu li a {
  display: block;
  color: #ccc;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  transition: background 0.25s, color 0.25s;
}
.category-menu li a:hover,
.category-menu li a.active {
  color: #00bcd4;
  background: #333;
}

/* When menu is visible */
.category-menu.show {
  max-height: 300px; /* enough space to slide open */
}

/* Desktop view */
@media (min-width: 768px) {
  .category-menu {
    flex-direction: row;
    position: absolute;
    justify-content: center;
  }
  .category-menu li {
    border: none;
  }
  .category-menu li a {
    padding: 14px 20px;
  }
  .category-menu.show {
    max-height: 80px; /* only one row */
  }
}