:root{
  --bg: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --line: #e5e7eb;
  --brand: #0ea5e9;
  --hover: #0b3b75;
  --shadow: 0 6px 16px rgba(0,0,0,.05);
}

/* ТЕМНА ТЕМА */
html[data-theme="dark"]{
  --bg: #0f172a;
  --ink: #e2e8f0;
  --ink-2: #94a3b8;
  --line: #1e293b;
  --brand: #38bdf8;
  --hover: #bae6fd;
  --shadow: none;
}

/* ====== Меню контейнер ====== */
.menu-container{
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.menu-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Бренд */
.brand{
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.brand img{ width: 28px; height: 28px; }
.brand-title{ font-size: 0.9rem; }

/* Кнопка зміни теми */
.theme-toggle{
  border: 1px solid var(--line);
  background: none;
  border-radius: 10px;
  color: var(--ink);
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.theme-toggle:hover{
  background: var(--brand);
  color: #fff;
}

/* ====== Посилання меню ====== */
.desktop-nav{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}

.desktop-nav a,
.dropbtn{
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.8rem, 0.9vw + 0.6rem, 1rem);
  transition: background .2s ease, color .2s ease;
}

.desktop-nav a:hover,
.dropbtn:hover,
.desktop-nav a.active{
  background: var(--brand);
  color: #fff;
}
.dropbtn.active-group{
  background: var(--brand);
  color: #fff;
}


/* ====== Підменю ====== */
.dropdown{ position: relative; }
.dropdown-content{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
  padding: 6px;
}
.dropdown.open > .dropdown-content{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-content a{
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
}
.dropdown-content a:hover{
  background: var(--brand);
  color: #fff;
}

/* ====== Адаптивність ====== */
@media (max-width: 900px){
  .brand-title{ display: none; }
}
@media (max-width: 600px){
  .desktop-nav a,
  .dropbtn{
    padding: 4px 10px;
    font-size: 0.8rem;
  }
  .menu-inner{ justify-content: center; }
}
@media (max-width: 400px){
  .desktop-nav{ justify-content: center; }
  .desktop-nav a,
  .dropbtn{ padding: 3px 8px; font-size: 0.75rem; }
}
