/*
 * TOV-206, stage 1: «Программа лояльности — „Заберу сам“ (опт и розница)».
 * The finder behind the shared QR code (/s), the seller's section (/profile/loyalty), the shop number on the
 * storefront and the «Добавить на экран» bar. Controls are the UI kit's (tv-input, tv-btn, tv-modal); this file only
 * lays them out. Values repeat the kit's scale (4/8/12/16/24 px, radius 12/16/20, text #0F172A/#64748B, action
 * #186AFF): the kit's custom properties are read only inside the kit (qa/ui_kit_token_usage_contract.cjs).
 */

/* ── The shop number on the storefront ── */
.shop-sidebar-number {
  margin-top: 4px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Finder (/s) ── */
.shop-qr-finder {
  display: flex;
  justify-content: center;
  padding-top: 32px;
  padding-bottom: 48px;
}

.shop-qr-finder__card {
  box-sizing: border-box;
  width: 100%;
  max-width: 560px;
  padding: 24px;
  border: 1px solid #E2E8F0;
  border-radius: 20px;
  background: #FFFFFF;
}

.shop-qr-finder__title {
  margin: 0 0 8px;
  color: #0F172A;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

.shop-qr-finder__lead {
  margin: 0 0 16px;
  color: #64748B;
  font-size: 14px;
  line-height: 1.5;
}

.shop-qr-finder__notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #FFF7ED;
  color: #9A3412;
  font-size: 14px;
  line-height: 1.5;
}

.shop-qr-finder__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.shop-qr-finder__form .tv-field {
  flex: 1 1 auto;
}

.shop-qr-finder__submit {
  flex: none;
}

/* 16 px: iOS Safari does not zoom the page into a field of this size. */
.shop-qr-finder__input {
  font-size: 16px;
}

.shop-qr-finder__suggestions,
.shop-qr-finder__results {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.shop-qr-finder__suggestions[hidden] {
  display: none;
}

.shop-qr-finder__result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #0F172A;
  text-decoration: none;
}

.shop-qr-finder__result:hover,
.shop-qr-finder__result:focus-visible {
  background: #F1F5F9;
  color: #0F172A;
}

.shop-qr-finder__result strong {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-qr-finder__result span {
  flex: none;
  color: #64748B;
  font-size: 13px;
}

.shop-qr-sheet .tv-modal__body {
  padding-bottom: 24px;
}

@media (max-width: 575px) {
  .shop-qr-finder {
    padding-top: 16px;
  }

  .shop-qr-finder__card {
    padding: 16px;
    border: 0;
    border-radius: 0;
  }
}

/* ── Seller's section (/profile/loyalty) ── */
.shop-loyalty__lead {
  margin: 8px 0 20px;
  color: #475569;
  font-size: 14px;
  line-height: 1.55;
}

.shop-loyalty__grid {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 16px;
}

.shop-loyalty__card {
  box-sizing: border-box;
  min-width: 0;
  padding: 16px;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  background: #FFFFFF;
}

.shop-loyalty__card--qr {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-loyalty__qr svg {
  display: block;
  width: 100%;
  max-width: 188px;
  height: auto;
}

.shop-loyalty__label {
  margin: 0 0 4px;
  color: #64748B;
  font-size: 13px;
}

.shop-loyalty__number {
  margin: 0;
  color: #0F172A;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.shop-loyalty__shop {
  margin: 4px 0 16px;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 14px;
}

.shop-loyalty__link {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.shop-loyalty__link .tv-input {
  flex: 1 1 auto;
  min-width: 0;
}

.shop-loyalty__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-loyalty__hint {
  margin: 12px 0 0;
  color: #64748B;
  font-size: 13px;
  line-height: 1.5;
}

.shop-loyalty__notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #FFF7ED;
  color: #9A3412;
  font-size: 14px;
}

.shop-loyalty__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0 8px;
}

.shop-loyalty__stat {
  display: flex;
  flex: 1 1 140px;
  flex-direction: column;
  min-width: 0;
  max-width: 240px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #F1F5F9;
}

.shop-loyalty__stat-value {
  color: #0F172A;
  font-size: 24px;
  font-weight: 700;
}

.shop-loyalty__stat-label {
  color: #475569;
  font-size: 13px;
}

.shop-loyalty__subtitle {
  margin: 20px 0 8px;
}

.shop-loyalty__empty {
  padding: 16px;
  border: 1px dashed #CBD5E1;
  border-radius: 16px;
  color: #475569;
  font-size: 14px;
}

.shop-loyalty__empty p {
  margin: 4px 0 12px;
}

.shop-loyalty__subscribers {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shop-loyalty__subscriber {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 14px;
}

.shop-loyalty__subscriber-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #0F172A;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-loyalty__subscriber-date {
  color: #64748B;
}

.shop-loyalty__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}

.shop-loyalty__pages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  color: #0F172A;
}

.shop-loyalty__pages a.is-current {
  background: #186AFF;
  color: #FFFFFF;
}

@media (max-width: 767px) {
  .shop-loyalty__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .shop-loyalty__link {
    flex-direction: column;
  }

  .shop-loyalty__downloads .tv-btn {
    flex: 1 1 100%;
  }
}

/* ── «Магазин добавлен в ваши подписки» on the shop page after /s/<number> ── */
.shop-loyalty-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #ECFDF3;
  color: #0F5132;
  font-size: 14px;
  font-weight: 600;
}

/* ── «Добавить на экран» (Android install button, iOS hint) ── */
.shop-loyalty-install {
  position: fixed;
  right: 12px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  left: 12px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 12px 16px;
  border-radius: 16px;
  background: #FFFFFF;
  box-shadow: 0 18px 44px rgba(21, 35, 58, .18);
  color: #0F172A;
  font-size: 14px;
  line-height: 1.4;
}

.shop-loyalty-install[hidden] {
  display: none;
}

.shop-loyalty-install__text {
  flex: 1 1 auto;
  min-width: 0;
}

.shop-loyalty-install__text strong {
  display: block;
}
