/* ============================================================
   ОБЩИЕ СТИЛИ МЕНЮ (для всех разрешений)
   ============================================================ */
.menus a {
  color: hsl(var(--bulma-white-h), var(--bulma-white-s), var(--bulma-white-l)) !important;
  display: block;
  padding: 0.5rem 0.75rem;
}

.menus div {
  display: flex;
}

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ (<= 1023px)
   ============================================================ */
@media screen and (max-width: 1023px) {
  .menus {
    border-top: 3px dashed #8281818a;
  }

  .menus div {
    flex-direction: column;
  }

  .menus a {
    padding: 12px 0;
    border-bottom: 1px solid #8d8d8d2e;
  }

  /* --- Выезжающее меню (справа) --- */
  .offcanvas-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* корректно на мобилках с адресной строкой */
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 50;
  }

  .offcanvas-menu.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* --- Содержимое меню --- */
  .offcanvas-content {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 300px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bulma-primary);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    will-change: transform;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .offcanvas-menu.is-active .offcanvas-content {
    transform: translateX(0);
  }

  /* Скроллбар */
  .offcanvas-content::-webkit-scrollbar {
    width: 6px;
  }
  .offcanvas-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
  }
}

/* ============================================================
   ДЕСКТОП (>= 1024px)
   ============================================================ */
@media screen and (min-width: 1024px) {
  .navbar-burger {
    display: inline-flex !important;
  }

  /* --- Модальное меню по центру --- */
  .offcanvas-menu {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    background: rgba(0, 0, 0, 0);
    transition: opacity 0.3s ease, background 0.3s ease, visibility 0.3s ease;
    z-index: 999;
  }

  .offcanvas-menu.is-active {
    visibility: visible;
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
  }

  /* --- Содержимое --- */
  .offcanvas-content {
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    background: var(--bulma-body-background-color, #fff);
    border-radius: 1rem;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
  }

  .offcanvas-menu.is-active .offcanvas-content {
    transform: translateY(0);
  }
}