/* =========================================================
   v2.6.5 — Mobile menu admin visibility + visual redesign
   ---------------------------------------------------------
   - Admin can choose which categories are visible in the phone drawer.
   - Parent categories open cleanly on tap; hidden mobile rows do not appear.
   - Mobile category drawer gets a cleaner app-like visual treatment.
   ========================================================= */

/* If the desktop header category list is manually curated, terms that were
   added only for the phone drawer stay hidden on desktop/tablet menus. */
@media (min-width: 901px) {
  body.vlg-theme .vlg-cat-item.vlg-desktop-cat-hidden {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.vlg-theme .vlg-nav.is-open .vlg-cat-item.vlg-mobile-cat-hidden,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-item.vlg-mobile-cat-hidden {
    display: none !important;
  }

  body.vlg-theme .vlg-nav.is-open,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open {
    border: 1px solid rgba(223, 231, 242, .96) !important;
    border-radius: 30px 30px 24px 24px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    box-shadow: 0 28px 90px rgba(7, 18, 36, .34) !important;
  }

  body.vlg-theme .vlg-nav.is-open::before,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open::before {
    width: 54px !important;
    height: 5px !important;
    margin: 11px auto 7px !important;
    border-radius: 999px !important;
    background: #d8e3f1 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-mobile-nav-head {
    min-height: 54px !important;
    max-height: 64px !important;
    padding: 0 4px 10px !important;
    border-bottom: 1px solid #e6edf6 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head strong::before,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-mobile-nav-head strong::before {
    content: "Tootekategooriad" !important;
    color: #101a2b !important;
    font-size: 20px !important;
    font-weight: 950 !important;
    letter-spacing: -.02em !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-close,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-mobile-nav-close {
    width: 48px !important;
    height: 48px !important;
    border: 1px solid #d8e4f2 !important;
    border-radius: 16px !important;
    background: #f8fbff !important;
    color: #071224 !important;
    font-size: 34px !important;
    line-height: 1 !important;
    box-shadow: 0 10px 24px rgba(7, 18, 36, .07) !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: 56px !important;
    max-height: none !important;
    padding: 14px 16px !important;
    border: 0 !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #071224 0%, #10213b 100%) !important;
    color: #fff !important;
    box-shadow: 0 16px 34px rgba(7, 18, 36, .24) !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 {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: inherit !important;
    font-size: 16px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    letter-spacing: -.01em !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button span::before,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-button span::before {
    content: "☰" !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .14) !important;
    color: #ffb34d !important;
    font-size: 20px !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 {
    flex: 0 0 34px !important;
    width: 34px !important;
    height: 34px !important;
    background: rgba(255, 255, 255, .18) !important;
    color: #fff !important;
    font-weight: 950 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-cat-tree,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown .vlg-cat-tree,
  body.vlg-theme.vlg-mobile-auto-open-categories .vlg-nav.is-open .vlg-cat-tree,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-category-menu.is-open .vlg-cat-tree {
    gap: 9px !important;
    padding: 10px !important;
    border: 1px solid #dbe6f3 !important;
    border-radius: 22px !important;
    background: linear-gradient(180deg, #f5f8fc 0%, #eef4fb 100%) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-item,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-item {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-row,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    gap: 9px !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    padding: 9px 12px !important;
    border: 1px solid #dce7f4 !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(31, 42, 68, .05) !important;
    text-decoration: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link::before,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link::before {
    content: "" !important;
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    border: 4px solid #fff2db !important;
    border-radius: 999px !important;
    background: var(--vlg-primary, #f28a00) !important;
    box-shadow: 0 0 0 1px rgba(242, 138, 0, .22) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-title,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-title {
    display: block !important;
    justify-self: start !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: #172033 !important;
    font-size: 14px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    white-space: normal !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-count,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 34px !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    background: #edf4fc !important;
    color: #697589 !important;
    font-size: 13px !important;
    font-weight: 950 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-subtoggle,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-subtoggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 54px !important;
    border: 1px solid #fde6c1 !important;
    border-radius: 16px !important;
    background: #fff8ee !important;
    color: #324055 !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    box-shadow: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-item.is-sub-open > .vlg-cat-row .vlg-cat-subtoggle,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-item.is-sub-open > .vlg-cat-row .vlg-cat-subtoggle {
    background: var(--vlg-primary, #f28a00) !important;
    border-color: var(--vlg-primary, #f28a00) !important;
    color: #fff !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-submenu,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-submenu {
    display: none !important;
    gap: 7px !important;
    margin: 8px 0 0 16px !important;
    padding: 0 0 0 10px !important;
    border-left: 2px solid #f5cf95 !important;
    list-style: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-item.is-sub-open > .vlg-cat-submenu,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-item.is-sub-open > .vlg-cat-submenu {
    display: grid !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-depth-1 .vlg-cat-link,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-depth-1 .vlg-cat-link {
    min-height: 48px !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .82) !important;
  }
}

@media (max-width: 390px) {
  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-link {
    grid-template-columns: 18px minmax(0, 1fr) auto !important;
    gap: 8px !important;
    padding-left: 10px !important;
    padding-right: 9px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-tree .vlg-cat-title,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-tree .vlg-cat-title {
    font-size: 13px !important;
  }

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

@media (min-width: 901px) {
  body.vlg-theme .vlg-cat-item.vlg-desktop-no-visible-children > .vlg-cat-row .vlg-cat-subtoggle {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.vlg-theme .vlg-nav.is-open .vlg-cat-item.vlg-mobile-no-visible-children > .vlg-cat-row .vlg-cat-subtoggle,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-item.vlg-mobile-no-visible-children > .vlg-cat-row .vlg-cat-subtoggle {
    display: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-item.vlg-mobile-no-visible-children > .vlg-cat-submenu,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-cat-item.vlg-mobile-no-visible-children > .vlg-cat-submenu {
    display: none !important;
  }
}
