/* =========================================================
   v2.2.9 — Modern mobile dropdown / bottom-sheet navigation
   Makes the phone menu feel like a current e-commerce app: compact
   closed state, bottom-sheet drawer, clear category accordion, large
   touch targets, no blank white overlay above the hero.
   ========================================================= */

.vlg-mobile-nav-head,
.vlg-mobile-quick-links,
.vlg-submenu-toggle {
  display: none;
}

@media (max-width: 782px) {
  body.vlg-menu-open {
    overflow: hidden !important;
    touch-action: none;
  }

  body.vlg-theme .vlg-mobile-backdrop:not([hidden]) {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    background: rgba(7, 18, 36, .42) !important;
    backdrop-filter: blur(5px) saturate(120%);
    z-index: 6990 !important;
    animation: vlgMobileBackdropIn .18s ease-out both;
  }

  body.vlg-theme .vlg-nav:not(.is-open) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body.vlg-theme .vlg-nav.is-open {
    position: fixed !important;
    inset: auto 10px max(10px, env(safe-area-inset-bottom)) 10px !important;
    top: auto !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(82dvh, 680px) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 1px solid rgba(218, 228, 240, .98) !important;
    border-radius: 26px 26px 20px 20px !important;
    background: rgba(255, 255, 255, .98) !important;
    box-shadow: 0 -18px 70px rgba(7, 18, 36, .30) !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 7000 !important;
    animation: vlgMobileSheetIn .22s cubic-bezier(.2,.9,.2,1) both;
  }

  body.admin-bar.vlg-theme .vlg-nav.is-open {
    max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px) - 14px) !important;
  }

  body.vlg-theme .vlg-nav.is-open::before {
    content: "";
    display: block;
    width: 46px;
    height: 5px;
    margin: 10px auto 6px;
    border-radius: 999px;
    background: #d7e1ed;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-nav-inner {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    max-height: calc(min(82dvh, 680px) - 21px) !important;
    margin: 0 !important;
    padding: 0 12px 12px !important;
    overflow: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  body.vlg-theme .vlg-mobile-nav-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 2px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,255,255,.93) 100%);
    backdrop-filter: blur(10px);
  }

  body.vlg-theme .vlg-mobile-nav-head strong {
    display: block;
    color: #071224;
    font-size: 20px;
    line-height: 1.05;
    letter-spacing: -.035em;
  }

  body.vlg-theme .vlg-mobile-nav-head span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
  }

  body.vlg-theme .vlg-mobile-nav-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid #dbe5f1;
    border-radius: 14px;
    background: #f8fafc;
    color: #071224;
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
  }

  body.vlg-theme .vlg-mobile-nav-close:focus-visible,
  body.vlg-theme .vlg-submenu-toggle:focus-visible,
  body.vlg-theme .vlg-category-button:focus-visible,
  body.vlg-theme .vlg-primary-menu a:focus-visible,
  body.vlg-theme .vlg-mobile-quick-links a:focus-visible {
    outline: 3px solid rgba(242, 138, 0, .28) !important;
    outline-offset: 2px;
  }

  body.vlg-theme .vlg-mobile-quick-links {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  body.vlg-theme .vlg-mobile-quick-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #dbe5f1;
    border-radius: 14px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
  }

  body.vlg-theme .vlg-mobile-quick-links a:first-child {
    border-color: rgba(242, 138, 0, .32);
    background: #fff7ed;
    color: #b95d00;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: transparent !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button {
    position: relative;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 54px !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 0 46px 0 15px !important;
    border: 1px solid rgba(7, 18, 36, .10) !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #071224 0%, #0f1e35 100%) !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(7, 18, 36, .16) !important;
    font-size: 14px !important;
    letter-spacing: -.01em;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button::before {
    content: "☰";
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-right: 2px;
    border-radius: 11px;
    background: rgba(255,255,255,.11);
    color: #ffb45a;
    font-size: 15px;
    flex: 0 0 auto;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-button::after {
    content: "⌄";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffb45a;
    font-size: 21px;
    line-height: 1;
    transition: transform .18s ease;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-button::after,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(180deg);
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown {
    position: static !important;
    display: grid !important;
    grid-template-rows: 0fr;
    width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: grid-template-rows .24s ease, margin .24s ease;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown {
    grid-template-rows: 1fr;
    margin-top: 9px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > ul,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > .vlg-cat-dropdown-list {
    min-height: 0;
    max-height: min(42dvh, 360px);
    overflow: auto;
    padding: 8px !important;
    margin: 0 !important;
    border: 1px solid #dbe5f1;
    border-radius: 18px;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list {
    display: grid !important;
    gap: 6px !important;
    list-style: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list li {
    margin: 0 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list a,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown a {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 48px !important;
    gap: 12px !important;
    padding: 10px 12px 10px 14px !important;
    border: 1px solid #e4edf6;
    border-radius: 15px !important;
    background: #fff !important;
    color: #172033 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1.18 !important;
    text-decoration: none !important;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .035);
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list a::before,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown a::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--vlg-primary, #f28a00), #ffb34d);
    box-shadow: 0 0 0 4px #fff3e4;
    flex: 0 0 auto;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-cat-dropdown-list a > span,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown a > span {
    display: inline-grid !important;
    place-items: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    margin-left: auto;
    border-radius: 999px;
    background: #edf3fa;
    color: #64748b !important;
    font-size: 12px !important;
    font-weight: 900 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu {
    display: grid !important;
    width: 100% !important;
    gap: 7px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li {
    position: relative;
    margin: 0 !important;
    border: 1px solid #dfe8f3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .035);
    overflow: hidden;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li > a {
    display: flex !important;
    align-items: center !important;
    min-height: 50px !important;
    width: 100% !important;
    padding: 0 48px 0 14px !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.current-menu-item,
  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.current-menu-ancestor {
    border-color: rgba(242, 138, 0, .32);
    background: #fff8ef;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.current-menu-item > a,
  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.current-menu-ancestor > a {
    color: #b95d00 !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.menu-item-has-children > a {
    padding-right: 56px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-submenu-toggle {
    position: absolute;
    top: 7px;
    right: 7px;
    display: inline-grid !important;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid #dbe5f1;
    border-radius: 13px;
    background: #f8fafc;
    color: #071224;
    cursor: pointer;
    font-size: 0;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-submenu-toggle::before {
    content: "⌄";
    font-size: 19px;
    line-height: 1;
    color: #f28a00;
    transition: transform .18s ease;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.is-submenu-open > .vlg-submenu-toggle::before {
    transform: rotate(180deg);
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu .sub-menu {
    display: none !important;
    margin: -2px 8px 9px !important;
    padding: 6px !important;
    border: 1px solid #e6eef7 !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    list-style: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu > li.is-submenu-open > .sub-menu {
    display: grid !important;
    gap: 4px !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu .sub-menu a {
    display: flex !important;
    align-items: center !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border-radius: 11px !important;
    color: #334155 !important;
    background: transparent !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu .sub-menu a:hover,
  body.vlg-theme .vlg-nav.is-open .vlg-primary-menu .sub-menu a:focus-visible {
    background: #fff !important;
    color: #b95d00 !important;
  }
}

@media (max-width: 430px) {
  body.vlg-theme .vlg-nav.is-open {
    left: 8px !important;
    right: 8px !important;
    border-radius: 24px 24px 18px 18px !important;
  }

  body.vlg-theme .vlg-mobile-quick-links {
    grid-template-columns: 1fr 1fr;
  }

  body.vlg-theme .vlg-mobile-quick-links a:first-child {
    grid-column: 1 / -1;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > ul,
  body.vlg-theme .vlg-nav.is-open .vlg-category-dropdown > .vlg-cat-dropdown-list {
    max-height: min(38dvh, 320px);
  }
}

@keyframes vlgMobileSheetIn {
  from { opacity: 0; transform: translateY(28px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes vlgMobileBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
