/* QR — адаптация телефон/планшет (v6). Только переопределения; база в overlays.css/public.css/dialogs-v4.css. */

/* Ручка шторки: вне телефона скрыта, desktop/планшет не меняются. */
#qrLayer .qr-handle { display: none; }

@keyframes qr-sheet-in {
  from { opacity: 0; transform: translateY(56px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Телефон (< 768px): нижняя шторка ---------- */
@media (max-width: 767px) {
  #qrLayer.dialog-layer {
    place-items: end center;
    padding: 0;
    overflow: hidden;
  }

  #qrLayer .dialog--qr {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: 0;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    animation: qr-sheet-in var(--motion-normal) ease;
  }

  #qrLayer .qr-handle {
    display: grid;
    height: 26px;
    padding-top: 6px;
    place-items: start center;
    background: var(--ink);
    cursor: grab;
    touch-action: none;
  }

  #qrLayer .qr-handle::before {
    content: "";
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 253, 250, 0.38);
  }

  #qrLayer .dialog-header {
    height: 58px;
    padding: 0 8px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
  }

  #qrLayer .dialog-header__copy {
    grid-column: 2;
    grid-row: 1;
    text-align: center;
  }

  #qrLayer .modal-close {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  #qrLayer .qr-body {
    height: auto;
    padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #qrLayer .qr-visual {
    padding-bottom: 0;
    border-right: 0;
    border-bottom: 0;
  }

  #qrLayer .qr-visual img {
    width: min(56vw, 224px);
    height: auto;
    aspect-ratio: 1;
  }

  #qrLayer .qr-visual small { margin-top: 10px; }

  #qrLayer .qr-detail { grid-template-rows: auto auto auto; gap: 14px; }

  #qrLayer .dialog-tabs button {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
  }

  #qrLayer .qr-copy { align-self: start; }
  #qrLayer .qr-copy h2 { font-size: 24px; }
  #qrLayer .qr-copy p { margin-top: 8px; }
  #qrLayer .official-address { margin-top: 12px; }

  #qrLayer .dialog-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #qrLayer .dialog-actions .dialog-button {
    min-height: 48px;
    padding: 10px 12px;
  }

  #qrLayer .dialog-actions .dialog-button:nth-child(3) { grid-column: 1 / -1; }

  /* Плашка-кнопка на странице: чуть компактнее и удобнее для пальца. */
  .contact-row { min-height: 68px; padding: 14px 18px; }
}

/* ---------- Планшет (768–1199px): компактное центрированное окно ---------- */
@media (min-width: 768px) and (max-width: 1199px) {
  #qrLayer.dialog-layer {
    place-items: center;
    padding: 24px;
    overflow: auto;
  }

  #qrLayer .dialog--qr {
    width: min(660px, calc(100vw - 48px));
    height: auto;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
  }

  #qrLayer .qr-body {
    height: auto;
    padding: 24px 26px;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 26px;
  }

  #qrLayer .qr-visual {
    padding-bottom: 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  html[dir="rtl"] #qrLayer .qr-visual {
    border-right: 0;
    border-left: 1px solid var(--line);
  }

  #qrLayer .qr-visual img {
    width: 176px;
    height: 176px;
  }

  #qrLayer .qr-copy h2 { font-size: 27px; }
  #qrLayer .dialog-tabs button { min-height: 48px; }
  #qrLayer .dialog-actions .dialog-button { min-height: 48px; }
}

/* ---------- Desktop (>= 1200px): поведение v5, не трогаем ---------- */
