/* Мобільне drawer-меню ≤899px (design.md §2 п.3). */

.mobile-drawer {
  display: none;
}

@media (max-width: 899px) {
  .mobile-drawer:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    pointer-events: none;
  }

  .mobile-drawer.is-open {
    pointer-events: auto;
  }

  .mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: color-mix(in srgb, var(--color-ink) 42%, transparent);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.32s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-drawer.is-open .mobile-drawer__backdrop {
    opacity: 1;
  }

  .mobile-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(22rem, 88vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
  }

  .mobile-drawer.is-open .mobile-drawer__panel {
    transform: translate3d(0, 0, 0);
  }

  .mobile-drawer__head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-accent-start) 18%, transparent);
  }

  .mobile-drawer__fav {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.25rem 0.55rem 0.25rem 0.35rem;
    margin: 0;
    border: 0;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--color-accent-start) 10%, #fff);
    color: var(--color-accent-end);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-drawer__fav-badge {
    position: static;
    margin-left: 0.15rem;
  }


  .mobile-drawer__fav-icon {
    display: grid;
    place-items: center;
  }

  .mobile-drawer__close {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-bg) 80%, #fff);
    color: var(--color-ink);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.85rem calc(1rem + var(--safe-bottom));
  }

  .mobile-drawer__section-title {
    margin: 0 0 0.65rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: none;
    color: var(--color-muted);
  }

  .mobile-drawer__cats {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .mobile-drawer__cat {
    border-bottom: 1px solid color-mix(in srgb, var(--color-accent-start) 14%, transparent);
  }

  .mobile-drawer__cat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 0.25rem;
  }

  .mobile-drawer__cat-link {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    align-items: center;
    gap: 0.65rem;
    min-height: 3rem;
    padding: 0.45rem 0.2rem;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .mobile-drawer__cat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    object-fit: cover;
    background: var(--color-bg);
  }

  .mobile-drawer__cat-icon--empty {
    display: block;
    background: color-mix(in srgb, var(--color-accent-start) 12%, #fff);
  }

  .mobile-drawer__acc-btn {
    display: grid;
    place-items: center;
    width: 2.5rem;
    min-height: 3rem;
    margin: 0.25rem 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-accent-start) 14%, #fff);
    color: var(--color-accent-end);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--ease);
  }

  .mobile-drawer__cat.is-open > .mobile-drawer__cat-row > .mobile-drawer__acc-btn,
  .mobile-drawer__sub.is-open > .mobile-drawer__cat-row > .mobile-drawer__acc-btn {
    transform: rotate(90deg);
  }

  .mobile-drawer__subs {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0 0 0.35rem 2.9rem;
  }

  .mobile-drawer__subs--nested {
    margin: 0 0 0.35rem;
    padding: 0 0 0.25rem 1.35rem;
  }

  .mobile-drawer__sub .mobile-drawer__cat-row {
    padding-right: 0.1rem;
  }

  .mobile-drawer__subs[hidden] {
    display: none;
  }

  .mobile-drawer__sub-link {
    display: grid;
    grid-template-columns: 1.85rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.3rem 0.2rem;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 0.9rem;
  }

  .mobile-drawer__sub-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-drawer__sub-link .mobile-drawer__cat-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.5rem;
  }

  .mobile-drawer__empty {
    padding: 0.75rem 0.2rem;
  }

  .mobile-drawer__empty a,
  .mobile-drawer__all {
    color: var(--color-accent-end);
    text-decoration: none;
    font-weight: 500;
  }

  .mobile-drawer__all {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: 0.35rem 0 1rem;
    padding: 0.2rem;
  }

  .mobile-drawer__info {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-top: 1px solid color-mix(in srgb, var(--color-accent-start) 16%, transparent);
  }

  .mobile-drawer__info a {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--color-bg) 75%, #fff);
    color: var(--color-ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .mobile-drawer__contacts {
    margin-top: 1rem;
    padding: 0.85rem 0.75rem 0.35rem;
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--color-bg) 88%, #fff);
  }

  .mobile-drawer__contact-block {
    padding: 0.75rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-accent-start) 14%, transparent);
  }

  .mobile-drawer__contact-block--last,
  .mobile-drawer__contact-block:last-child {
    border-bottom: 0;
  }

  .mobile-drawer__contact-title {
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-ink);
  }

  .mobile-drawer__phones {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .mobile-drawer__phones a {
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
  }

  .mobile-drawer__messengers {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .mobile-drawer__msg {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.5rem;
    color: var(--color-ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
  }

  .mobile-drawer__msg-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: var(--color-accent-end);
    flex-shrink: 0;
  }

  .mobile-drawer__msg--vb .mobile-drawer__msg-dot {
    background: #7360f2;
  }

  .mobile-drawer__msg--tg .mobile-drawer__msg-dot {
    background: #2aabee;
  }

  .mobile-drawer__msg--wa .mobile-drawer__msg-dot {
    background: #25d366;
  }

  .mobile-drawer__email {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    color: var(--color-accent-end);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    word-break: break-word;
  }

  .mobile-drawer__email-icon {
    display: grid;
    place-items: center;
    color: var(--color-accent-end);
    flex-shrink: 0;
  }

  .mobile-drawer__stores {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .mobile-drawer__stores strong {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
  }

  .mobile-drawer__stores a,
  .mobile-drawer__stores span {
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .mobile-drawer__hours {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-ink);
  }
}

@media (min-width: 900px) {
  .mobile-drawer {
    display: none;
  }
}

body.is-mobile-nav-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .mobile-drawer__backdrop,
  .mobile-drawer__panel {
    transition-duration: 0.01ms;
  }
}
