.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #f9f9f9;
  border-bottom: 1px solid #ccc;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.menu a {
  margin-right: 15px;
  text-decoration: none;
  color: #555;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.drop-btn {
  cursor: pointer;
  margin-right: 15px;
  color: #555;
  text-decoration: none;
}

.drop-content {
  display: none;
  position: absolute;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  padding: 6px 8px;
}

.drop-content a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #111827;
  text-decoration: none;
  margin: 4px 0;
}

.drop-content a:hover {
  background: #f4f6f8;
}

.dropdown:hover .drop-content {
  display: block;
}

/* ===== API endpoints: nested submenu (open LEFT) ===== */

.subdropdown {
  position: relative;
  white-space: nowrap;
  z-index: 10000;
}

.sub-btn {
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 600;
  border-radius: 6px;
  color: #111827;
}

.subdropdown:hover > .sub-content {
  display: block;
}

/* подменю открывается ВЛЕВО */
.sub-content {
  display: none;
  position: absolute;
  right: 100%;
  top: 0;
  margin-right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 6px 0;
  z-index: 9999;
}

.sub-btn:hover {
  background: #f4f6f8;
}

.sub-content .subdropdown .sub-content {
  right: 100%;
  left: auto;
  margin-right: 0;
  margin-left: 0;
  top: 0;
}

.subdropdown::after {
  content: "";
  position: absolute;
  top: 0;
  right: 100%;
  width: 10px;     /* ширина мостика */
  height: 100%;
}

.sub-content .subdropdown::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 10px;
  height: 100%;
}
