/* v2.7.1 — second pass for the new mobile view
   Adds a cleaner empty/closed state, better tap targets, readable category names,
   safer small-screen spacing and stronger isolation from older mobile hotfixes. */

@media (max-width: 991.98px) {
  :root {
    --vlg-mobile-panel-radius: 30px;
  }

  html.vlg-mobile-menu-lock {
    height: 100% !important;
  }

  html.vlg-mobile-menu-lock body {
    position: fixed !important;
    width: 100% !important;
    overflow: hidden !important;
  }

  body.vlg-theme .vlg-mobile-toggle,
  body.vlg-theme .vlg-mobile-nav-close,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-link,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-subtoggle,
  body.vlg-theme .vlg-mobile-quick-links a {
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
  }

  body.vlg-theme .vlg-nav-inner,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-nav-inner {
    isolation: isolate !important;
  }

  body.vlg-theme .vlg-nav-inner::before {
    content: "" !important;
    display: block !important;
    width: 58px !important;
    height: 5px !important;
    flex: 0 0 auto !important;
    margin: -3px auto 0 !important;
    border-radius: 999px !important;
    background: #d8e4f2 !important;
  }

  body.vlg-theme .vlg-mobile-nav-head {
    padding-top: 0 !important;
  }

  body.vlg-theme .vlg-mobile-nav-close:active,
  body.vlg-theme .vlg-mobile-toggle:active,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button:active,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-link:active,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-subtoggle:active {
    transform: scale(.985) !important;
  }

  /* Closed category drawer: show a small guide instead of an empty white panel. */
  body.vlg-theme.vlg-mobile-categories-only:not(.vlg-mobile-auto-open-categories) .vlg-nav.is-open .vlg-category-menu:not(.is-open)::after {
    content: "Puuduta „Kõik kategooriad”, et avada mobiili kategooriad." !important;
    display: block !important;
    margin-top: 12px !important;
    padding: 14px 16px !important;
    border: 1px dashed #d6e3f2 !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,.72) !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open::after,
  body.vlg-theme.vlg-mobile-auto-open-categories .vlg-nav.is-open .vlg-category-menu::after {
    display: none !important;
    content: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button {
    min-height: 64px !important;
    border-radius: 23px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button span,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button span {
    font-size: clamp(16px, 4.4vw, 19px) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-dropdown {
    min-height: 0 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree {
    padding: 10px !important;
    gap: 9px !important;
    scroll-padding: 14px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-row,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-row {
    grid-template-columns: minmax(0, 1fr) 46px !important;
    gap: 8px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-link,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-link {
    grid-template-columns: 14px minmax(0, 1fr) auto !important;
    min-height: 58px !important;
    padding: 10px 11px !important;
    border-radius: 19px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-title,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    text-align: left !important;
    line-height: 1.12 !important;
    padding: 7px 10px !important;
    max-width: 100% !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-count,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-count {
    min-width: 36px !important;
    height: 34px !important;
    padding-inline: 9px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-subtoggle,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-subtoggle {
    width: 46px !important;
    min-width: 46px !important;
    height: 58px !important;
    border-radius: 18px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-submenu,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-submenu {
    margin-left: 10px !important;
    padding-left: 10px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-1 .vlg-cat-link,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-2 .vlg-cat-link,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-3 .vlg-cat-link {
    min-height: 48px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-1 .vlg-cat-title,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-2 .vlg-cat-title,
  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-3 .vlg-cat-title {
    font-size: 14px !important;
  }
}

@media (max-width: 380px) {
  body.vlg-theme .vlg-nav {
    padding: 5px !important;
  }

  body.vlg-theme .vlg-nav-inner,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-nav-inner {
    padding: 10px !important;
    border-radius: 22px !important;
    gap: 10px !important;
  }

  body.vlg-theme .vlg-mobile-nav-head {
    grid-template-columns: minmax(0, 1fr) 48px !important;
  }

  body.vlg-theme .vlg-mobile-nav-head strong {
    font-size: 22px !important;
  }

  body.vlg-theme .vlg-mobile-nav-head span {
    display: none !important;
  }

  body.vlg-theme .vlg-mobile-nav-close {
    width: 48px !important;
    height: 48px !important;
    border-radius: 18px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button {
    grid-template-columns: 40px minmax(0, 1fr) 34px !important;
    min-height: 58px !important;
    padding: 8px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button::before,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button::before {
    width: 40px !important;
    height: 40px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button::after,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button::after {
    width: 34px !important;
    height: 34px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-row,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-row {
    grid-template-columns: minmax(0, 1fr) 42px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-link,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-link {
    grid-template-columns: 12px minmax(0, 1fr) auto !important;
    min-height: 54px !important;
    padding: 9px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-count,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-count {
    min-width: 32px !important;
    height: 30px !important;
    font-size: 12px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-subtoggle,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-subtoggle {
    width: 42px !important;
    min-width: 42px !important;
    height: 54px !important;
  }
}
