/* Где купить: карта, список, сети. Mobile-first: 360 → 768 → 1024 → 1280. */

.shops__lead {
  margin: 14px 0 20px;
  max-width: 52ch;
}

.shops__tools {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.shops__geo {
  width: 100%;
}

.shops__cities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.shops__chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: none;
  font: 700 15px/1 var(--f-text);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.shops__chip.is-on,
.shops__chip[aria-checked="true"] {
  background: var(--honey);
  box-shadow: var(--shadow-sm);
}

.shops__note {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.shops__near {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px 14px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.shops__near-text {
  margin: 0;
  font-weight: 700;
}

.shops__layout {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.shops__list:not(:has(li:not([hidden]))) {
  display: none;
}

.shops__map {
  height: 320px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--cream);
  isolation: isolate;
  z-index: 0;
}

.shops__map .leaflet-bottom.leaflet-right {
  right: 10px;
  bottom: 8px;
}

.shops__map .leaflet-control-attribution {
  margin: 0 !important;
  max-width: calc(100% - 24px);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 248, 238, 0.92);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
}

.shops__map .pin-count {
  background: transparent;
  border: none;
}

.shops__map .pin-count__n {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  border: 3px solid #3a2318;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font: 800 22px/1 var(--f-text);
}

.leaflet-container img {
  max-width: none;
  max-height: none;
}

.leaflet-container {
  font-family: var(--f-text);
  background: var(--cream);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.leaflet-popup-content-wrapper {
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.leaflet-popup-tip-container {
  display: none;
}

.pin-pop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.pin-pop__place {
  font: 700 15px/1.3 var(--f-text);
}

.pin-pop__kind {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font: 700 13px/1 var(--f-text);
  letter-spacing: 0;
  text-transform: none;
}

.pin-pop__kind--firm {
  background: var(--apple);
}

.shops__list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shops__item {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font: 700 15px/1.35 var(--f-text);
}

.shops__item.is-picked,
.shops__item.is-near {
  background: var(--honey);
}

.shops__place {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-weight: 700;
  text-wrap: pretty;
}

.shops__kind {
  display: inline-flex;
  align-items: center;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
  padding: 4px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  font: 700 13px/1 var(--f-text);
  letter-spacing: 0;
  text-transform: none;
}

.shops__item[data-kind="firm"] .shops__kind {
  background: var(--apple);
}

.shops__km {
  grid-column: 1 / -1;
  grid-row: 2;
  font: 700 14px/1.2 var(--f-text);
  color: var(--ink-soft);
}

.shops__km:empty {
  display: none;
}

.shops__fail {
  margin: 12px;
}

.chains {
  margin-top: 36px;
}

.chains__label {
  margin: 0 0 14px;
}

.chains__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: start;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chains__item {
  display: grid;
  place-items: center;
  flex: none;
  width: auto;
  max-width: none;
  min-height: 56px;
  min-width: 0;
  padding: 8px 10px;
  overflow: hidden;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.chains__item img {
  max-width: 100%;
  max-height: 36px;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .shops__geo {
    width: auto;
    align-self: flex-start;
  }

  .shops__map {
    height: 420px;
  }

  .chains__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chains__item {
    min-height: 64px;
  }
}

@media (min-width: 1024px) {
  .shops__tools {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .shops__cities {
    flex: 1 1 280px;
  }

  .shops__layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.9fr);
    align-items: start;
  }

  .shops__layout:not(:has(.shops__list li:not([hidden]))) {
    grid-template-columns: 1fr;
  }

  .shops__map {
    height: 520px;
  }

  .chains__list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .shops__map {
    height: 510px;
  }
}
