/* Примерка на участке: кнопка на странице модели, диалог с QR на компьютере,
   нижняя панель с объяснением на телефоне. Подключается на страницах моделей
   и на странице примерки /ar/. Цвета и шрифт — переменные из styles.css. */

.ar-ico { width: 20px; height: 20px; flex: 0 0 auto; }
/* hidden сильнее display у элементов ниже (в styles.css общего правила [hidden] нет) */
.ar-modal [hidden], .ar-sheet [hidden] { display: none !important; }
.ar-ico--s { width: 16px; height: 16px; }

/* ── кнопки в колонке модели: «Примерить» первой, обе в одну строку ── */
.model-split__buttons .btn { padding-left: 22px; padding-right: 22px; }
.model-split__more { margin: 22px 0 0; }

/* ── ссылка-кнопка с иконкой (3D, скопировать) ── */
.ar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.ar-link:hover { border-color: var(--ink); }

/* ── диалог с QR (компьютер) ── */
.ar-modal { position: fixed; inset: 0; z-index: 9000; display: none; }
.ar-modal.is-open { display: block; }
.ar-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 26, 22, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ar-modal__card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(840px, calc(100vw - 44px));
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  padding: 48px;
  background: var(--bg);
  box-shadow: 0 30px 80px rgba(28, 26, 22, 0.28);
}
.ar-modal__close,
.ar-sheet__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}
.ar-modal__close:hover,
.ar-sheet__close:hover { color: var(--ink); }
.ar-modal__qr {
  flex: 0 1 280px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 24px 26px;
  background: var(--bg-2);
}
.ar-modal__qr img {
  display: block;
  width: 216px;
  height: 216px;
  box-sizing: border-box;
  padding: 10px;
  background: var(--bg);
}
.ar-modal__qr-cap { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-muted); text-align: center; }
.ar-modal__body { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; }
.ar-modal__body .eyebrow { margin: 0 0 10px; }
.ar-modal__title {
  margin: 0 0 14px;
  padding-right: 32px;
  font-family: 'Inter', sans-serif;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.ar-modal__lead { margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: var(--ink-muted); }
.ar-steps { display: flex; flex-direction: column; gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; }
.ar-steps li { display: flex; gap: 14px; font-size: 15px; line-height: 1.5; }
.ar-steps li > span:first-child { flex: 0 0 24px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ar-modal__limits {
  margin: 0 0 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.ar-modal__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.ar-copied { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.ar-url {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0 0;
  padding: 12px;
  border: 1px solid #857e72;
  border-radius: 0;
  background: #f8f5ef;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
@media (max-width: 700px) {
  .ar-modal__card { gap: 24px; padding: 40px 22px 28px; }
  .ar-modal__title { font-size: 28px; }
}

/* ── нижняя панель (телефон): не тот браузер или камера не открылась ── */
.ar-sheet { position: fixed; inset: 0; z-index: 9000; }
.ar-sheet[hidden] { display: none; }
.ar-sheet__backdrop { position: absolute; inset: 0; background: rgba(28, 26, 22, 0.55); }
.ar-sheet__card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  box-shadow: 0 -12px 40px rgba(28, 26, 22, 0.22);
}
.ar-sheet__handle { width: 36px; height: 4px; margin: 0 auto 14px; background: var(--bg-3); }
.ar-sheet__close { top: 8px; right: 8px; }
.ar-sheet__head { display: flex; align-items: center; gap: 14px; margin: 0 40px 18px 0; }
.ar-sheet__head img { display: block; width: 56px; height: 56px; object-fit: contain; background: var(--bg-2); }
.ar-sheet__head .eyebrow { margin: 0 0 4px; }
.ar-sheet__name { margin: 0; font-size: 15px; }
.ar-sheet__title { margin: 0 0 10px; font-family: 'Inter', sans-serif; font-size: 22px; line-height: 1.25; font-weight: 400; letter-spacing: -0.01em; }
.ar-sheet__body { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--ink-muted); }
.ar-sheet__where { display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; padding: 14px 16px; list-style: none; background: var(--bg-2); }
.ar-sheet__where li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.4; }
.ar-sheet .btn { width: 100%; }
