/* static/css/pwa_install.css */
/* PWA install (iOS A2HS) — ORIGINAL layout port */

/* hidden атрибут сам прячет через UA-стили, но на всякий */
.install-modal[hidden]{ display:none !important; }

/* overlay */
.install-modal{
  position: fixed;
  inset: 0;
  display: flex;
  background-color: var(--overlay, rgba(0,0,0,.62));
  justify-content: center;
  align-items: center;
  z-index: 20000 !important;
  isolation: isolate;
  color: var(--text, #0b1a2b);

  padding: max(12px, env(safe-area-inset-top)) 12px
           max(12px, env(safe-area-inset-bottom));

  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

/* твой JS добавляет is-open */
.install-modal.is-open{
  opacity: 1;
  pointer-events: auto;
}

.install-modal .modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(4, 14, 29, .72);
}

/* окно */
.install-modal .modal-window{
  position: relative;
  background-color: var(--panel, #fff);
  padding: 1.4rem;
  border-radius: 12px;
  width: 100%;
  font-size: 15px;

  border: 1px solid var(--border-1, rgba(11,26,43,.14));
  box-shadow: var(--shadow-panel, 0 18px 45px rgba(0,0,0,.20));

  transform: translateY(10px) scale(.98);
  opacity: .98;
  transition: transform .18s ease;
}

.install-modal.is-open .modal-window{
  transform: translateY(0) scale(1);
}

/* крестик */
.install-modal .modal-close{
  position: absolute;
  top: 6px;
  right: 10px;
  border: none;
  color: var(--muted, rgba(11,26,43,.65));
  background: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* ===================================================================== */
/* NEW: Header row (icon + title) вместо background-image на h2           */
/* ===================================================================== */
.install-modal .install-head{
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .9rem;
  padding-right: 2.2rem; /* чтобы текст не залезал под крестик справа */
}

.install-modal .install-head__icon{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  background-image: url("/static/hints/ios_safari.webp");
  filter: drop-shadow(0 0 10px rgba(0,0,0,.25));
}

.install-modal .install-head__title{
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
  text-align: left; /* теперь заголовок не "правым" блоком */
}

/* старое правило на h2 оставляем нейтральным (на случай если где-то ещё h2) */
.install-modal .modal-window h2{
  margin: 0;
  padding: 0;
  background: none;
}

/* ===== List layout (в твоей разметке span + div) ===== */
.install-modal ol{
  margin: 0;
  padding-left: 1.2rem;
}

.install-modal li{
  margin: .45rem 0;
}

/* первая строка: span + иконка share */
.install-modal li:first-child{
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: .6rem;
}

/* share icon */
.install-modal .ios-share-pic{
  width: 35px;
  height: 35px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;

  /* iOS Share icon (data-uri) */
  background-image: url("/static/hints/ios_share.svg");
}

/* ===== Bottom hint block (твой <p> ok) ===== */
.install-modal .modal-window p{
  margin-top: 1rem;
  padding: .5rem 1.2rem;
  border-radius: 8px;
  background-color: var(--field-bg, #f5f7fa);

  background-repeat: no-repeat;
  background-position: right center;
  background-size: 20% 80%;

  /* plus icon (data-uri) */
  background-image: url("/static/hints/ios_plus.svg");
}

/* ===== Optional blocks (показываются/скрываются через hidden в JS) ===== */
.install-modal .notcompleteios,
.install-modal .completeios{
  width: 80%;
  height: auto;
  position: absolute;
  bottom: 2vh;
  left: 10%;
}

.install-modal .notcompleteios p,
.install-modal .completeios p{
  position: relative;
  text-align: center;
}

/* arrow down */
.install-modal .notcompleteios .arrow,
.install-modal .completeios .arrow{
  display: block;
  width: 30px;
  height: 50px;
  position: relative;
  bottom: 0;
  margin: 0 auto;

  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;

  /* arrow icon (data-uri) */
  background-image: url("/static/hints/arrow_down.svg");
  animation: PWA_shake_arrow 1s ease-in-out infinite;
}

/* right float like original */
.install-modal .notcompleteios .arrow{
  float: right;
  margin-right: -7vw;
}

.install-modal .notcompleteios .safari-pic{
  display: block;
  float: right;
  position: relative;
  width: 25px;
  height: 25px;

  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  /* small Safari icon (data-uri) */
  background-image: url("/static/hints/Safari.svg");
}

@keyframes PWA_shake_arrow{
  0%   { transform: translateY(-10%); }
  50%  { transform: translateY(10%); }
  100% { transform: translateY(-10%); }
}
