/* V2ASHCHUK 0.17 — stable mobile overlay navigation, no header reflow. */
@media (max-width:1199px) {
  /* The header remains exactly the same height whether panels are open or not. */
  .site-header-shell { height:var(--header-height); overflow:visible; }
  .site-header {
    position:relative; z-index:2;
    height:var(--header-height); min-height:var(--header-height);
    max-height:var(--header-height);
    align-content:stretch;
  }
  .v2-mobile-category, .v2-mobile-toggle { height:100%; }
  .v2-mobile-category button, .v2-mobile-toggle { touch-action:manipulation; }
  .v2-mobile-category button { min-height:44px; }
  .v2-mobile-menu:not([hidden]), .v2-category-dropdown:not([hidden]) {
    position:absolute;
    top:100%; left:0; right:0;
    grid-column:auto; grid-row:auto;
    display:block;
    width:100%;
    padding:22px var(--gutter) 30px;
    max-height:calc(100vh - var(--header-height) - var(--wp-bar, 0px));
    max-height:calc(100dvh - var(--header-height) - var(--wp-bar, 0px));
    overflow-x:hidden; overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-width:thin;
    background:#000; color:#fff;
    border-top:1px solid rgba(255,255,255,.22);
    box-shadow:0 24px 48px rgba(0,0,0,.25);
    opacity:0; visibility:hidden; pointer-events:none;
    transform:translate3d(0,-14px,0);
    transform-origin:top center;
    transition:transform .28s cubic-bezier(.22,1,.36,1), opacity .23s ease, visibility .28s;
    will-change:transform, opacity;
  }
  .v2-mobile-menu.is-open:not([hidden]), .v2-category-dropdown.is-open:not([hidden]) {
    opacity:1; visibility:visible; pointer-events:auto;
    transform:translate3d(0,0,0);
  }
  .v2-nav-backdrop:not([hidden]) {
    display:block;
    position:fixed;
    inset:calc(var(--wp-bar, 0px) + var(--header-height)) 0 0;
    z-index:1;
    background:rgba(0,0,0,.48);
    opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity .28s ease, visibility .28s;
  }
  .v2-nav-backdrop.is-open:not([hidden]) {
    opacity:1; visibility:visible; pointer-events:auto;
  }
  .v2-mobile-list a, .v2-category-dropdown a {
    display:block; width:100%;
    transition:color .2s ease, padding-left .25s ease, background-color .2s ease;
  }
  .v2-mobile-list a:hover, .v2-mobile-list a:focus-visible,
  .v2-category-dropdown a:hover, .v2-category-dropdown a:focus-visible {
    color:#bbb; padding-left:8px;
  }
  .v2-mobile-menu.is-open .v2-mobile-list li,
  .v2-category-dropdown.is-open a {
    animation:v2-mobile-link-enter .38s both cubic-bezier(.22,1,.36,1);
  }
  .v2-mobile-list li:nth-child(2), .v2-category-dropdown a:nth-child(2) { animation-delay:35ms; }
  .v2-mobile-list li:nth-child(3), .v2-category-dropdown a:nth-child(3) { animation-delay:70ms; }
  .v2-mobile-list li:nth-child(4), .v2-category-dropdown a:nth-child(4) { animation-delay:105ms; }
  .v2-mobile-list li:nth-child(5), .v2-category-dropdown a:nth-child(5) { animation-delay:140ms; }
  .v2-mobile-list li:nth-child(6), .v2-category-dropdown a:nth-child(6) { animation-delay:175ms; }
  .v2-mobile-list li:nth-child(n+7), .v2-category-dropdown a:nth-child(n+7) { animation-delay:210ms; }
  .v2-mobile-toggle .v2-hamburger i {
    transform-origin:center;
    transition:transform .28s cubic-bezier(.22,1,.36,1);
  }
  .v2-mobile-toggle[aria-expanded='true'] .v2-hamburger i:first-child { transform:translateY(3.5px) rotate(45deg); }
  .v2-mobile-toggle[aria-expanded='true'] .v2-hamburger i:last-child { transform:translateY(-3.5px) rotate(-45deg); }
  .v2-mobile-category .v2-category-chevron { transition:transform .28s cubic-bezier(.22,1,.36,1); }
}
@keyframes v2-mobile-link-enter { from {opacity:0;transform:translateY(7px);} to {opacity:1;transform:translateY(0);} }
@media (max-width:767px) {
  .site-header { grid-template-rows:minmax(0,calc(var(--header-height) - 44px)) 44px; }
  .v2-mobile-menu:not([hidden]), .v2-category-dropdown:not([hidden]) { padding-bottom:24px; }
  .v2-mobile-list a, .v2-category-dropdown a { font-size:clamp(22px,7.2vw,28px); }
}
@media (prefers-reduced-motion:reduce) {
  .v2-mobile-menu:not([hidden]), .v2-category-dropdown:not([hidden]),
  .v2-nav-backdrop:not([hidden]), .v2-mobile-toggle .v2-hamburger i,
  .v2-mobile-category .v2-category-chevron, .v2-mobile-list a,
  .v2-category-dropdown a { animation:none; transition:none; }
}

/* WordPress admin toolbar is 46px on phone viewports (32px elsewhere). */
@media (max-width:782px) { body.admin-bar { --wp-bar:46px; } }
