﻿/* Icons inside menu items and submenu items */
.menu-item i,
.submenu-item i {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  padding: 2px 0;
  margin-left: -5px;
  margin-right: 7px;
}

/* Main menu bar */
.menu {
  width: 100%;
  height: 32px;
  background: linear-gradient(to right, #000, #444);
  display: flex;
  cursor: default;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 301;
}

/* Individual menu items */
.menu-item {
  flex: 1;
  text-align: center;
  position: relative;
  line-height: 32px;
  height: 32px;
  transition: background-color 0.3s ease;
  text-transform: uppercase;
  user-select: none;
}

/* Vertical separator between menu items */
.menu-item::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  display: block;
}

/* Открытое субменю по tap на мобильных */
.menu-item.touch-open .submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Растягиваем ссылку на весь пункт меню */
.menu-item > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 32px;
}

/* Remove separator after last item */
.menu-item:last-child::after {
  display: none;
}

/* Hover effect on menu item */
.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Submenu – hidden by default (visibility + opacity for smooth animation) */
.submenu {
  min-width: 150px;
  top: 100%;
  left: 0;
  padding: 0;
  background: linear-gradient(135deg, #1a1a1a, #444);
  white-space: nowrap;
  text-transform: uppercase;
  position: absolute;
  z-index: 302;           /* Increased so submenu appears above the menu bar */
  visibility: hidden;      /* Hidden but still in layout – allows smooth transitions */
  opacity: 0;
  transform: translateY(-10px);
  transition: visibility 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

/* Show submenu when hovering over parent menu item */
.menu-item:hover .submenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* Submenu items */
.submenu-item {
  display: block;
  height: 32px;
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
  transition: background-color 0.3s ease, transform 0.3s ease;
  line-height: 32px;
  text-decoration: none;   /* Ensure no underline */
}

/* Hover effect on submenu items */
.submenu-item:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateX(9px);
}

/* Left indicator bar (hidden by default) */
.submenu-item .indicator {
  width: 9px;
  height: 32px;
  top: 0;
  left: -9px;
  background: linear-gradient(to bottom, #1e90ff, #000080);
  transform: scale(0);
  transition: transform 0.3s ease;
  position: absolute;
}

/* Show indicator on hover with different color */
.submenu-item:hover .indicator {
  transform: scale(1);
  background: linear-gradient(to bottom, #ff0000, #8b0000);
}

/* Remove underline from all links inside the menu */
.menu a:link,
.menu a:visited,
.menu a:hover,
.menu a:active {
  text-decoration: none;
}