/* unav-drawer v2 — unified mobile burger polish
   Sits on top of nav.min.css, brings burger drawer in line with catalog drawer v2.
*/

@media (max-width: 900px) {

  /* === Body scroll lock (iOS-safe via position:fixed) ===
     nav.min.css already uses overflow:hidden on .unav-modal-open body,
     but Safari still rubber-bands. We upgrade via JS (see unav-drawer-v2.js)
     which sets body.style.top = -scrollY on open.
     This CSS rule complements the JS lock: */
  body.unav-modal-open {
    position: fixed;
    width: 100%;
    overscroll-behavior: none;
  }

  /* === Backdrop: smooth fade, unified darkness === */
  .unav-mobile-drawer-overlay {
    background-color: rgba(15, 17, 21, 0.55) !important;
    transition: opacity 0.28s ease-out, visibility 0.28s !important;
  }

  /* === Drawer panel — consistent with catalog drawer === */
  body .unav-mobile-drawer,
  body.unav-modal-open .unav-mobile-drawer {
    background-color: #fff;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1) !important;
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    overflow: hidden;
  }

  /* === Injected header with "Меню" title === */
  .unav-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: #fff;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    z-index: 2;
  }
  .unav-drawer-header.is-scrolled {
    border-bottom-color: #eee;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  .unav-drawer-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.01em;
    font-family: inherit;
  }

  /* Neutralize the legacy floating X (anywhere inside the drawer) */
  .unav-mobile-drawer .unav-mobile-drawer-close {
    display: none !important;
  }

  /* Our close button matches catalog drawer */
  .unav-drawer-close {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f5f5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #111;
    transition: background 0.15s;
    flex-shrink: 0;
  }
  .unav-drawer-close:active { background: #e7e5e4; }
  .unav-drawer-close svg { width: 18px; height: 18px; stroke: #111; stroke-width: 2; fill: none; }

  /* Drawer body — scrollable area below header */
  .unav-mobile-drawer-inner {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 32px;
  }

  /* Search pill — portable styling for pages that don't load editorial.css */
  .unav-mobile-drawer .unav-mobile-search {
    position: relative;
    margin: 8px 20px 24px;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 999px;
    padding: 12px 16px 12px 44px;
    transition: border-color .15s, box-shadow .15s;
  }
  .unav-mobile-drawer .unav-mobile-search:focus-within {
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(200, 76, 26, 0.12);
  }
  .unav-mobile-drawer .unav-mobile-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #71717a;
    pointer-events: none;
  }
  .unav-mobile-drawer .unav-mobile-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: #111;
    padding: 0;
    min-width: 0;
  }
  .unav-mobile-drawer .unav-mobile-search-input::placeholder {
    color: #a1a1aa;
  }

  /* Menu items — portable styling */
  .unav-mobile-drawer .unav-mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .unav-mobile-drawer .unav-mobile-menu-item {
    border-bottom: 1px solid #f4f4f5;
  }
  .unav-mobile-drawer .unav-mobile-menu-item:last-child {
    border-bottom: none;
  }
  .unav-mobile-drawer .unav-mobile-menu-link,
  .unav-mobile-drawer .unav-mobile-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 14px;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
  }
  .unav-mobile-drawer .unav-mobile-menu-link.is-cta,
  .unav-mobile-drawer .unav-mobile-menu-item.unav-sale .unav-mobile-menu-link {
    color: #c84c1a;
  }

  /* Accordion "+" / "−" indicator for KATALOG / PO KOMNATAM */
  .unav-mobile-drawer .unav-mobile-menu-link[data-mobile-accordion-trigger]::after {
    content: '+';
    font-family: inherit;
    font-size: 18px;
    font-weight: 300;
    color: #a1a1aa;
    transition: transform 0.2s;
  }
  .unav-mobile-drawer .unav-mobile-menu-item[data-open="1"] .unav-mobile-menu-link[data-mobile-accordion-trigger]::after {
    content: '−';
    color: #c84c1a;
  }

  /* Nested accordion list */
  .unav-mobile-drawer .unav-mobile-accordion {
    padding: 0 0 12px 16px;
    border-left: 2px solid #e4e4e7;
    margin: 0 20px 8px;
    list-style: none;
  }
  .unav-mobile-drawer .unav-mobile-accordion-link {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: #52525b;
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 500;
  }

  /* Footer contact block */
  .unav-mobile-drawer .unav-mobile-footer {
    padding: 24px 20px;
    border-top: 1px solid #f4f4f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .unav-mobile-drawer .unav-mobile-phone {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    text-decoration: none;
    letter-spacing: -0.01em;
  }
  .unav-mobile-drawer .unav-mobile-email {
    font-size: 14px;
    color: #71717a;
    text-decoration: none;
  }

  /* Safe-area padding for iOS home indicator */
  .unav-mobile-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (min-width: 901px) {
  /* Don't affect desktop nav */
  .unav-drawer-header { display: none; }
}
