/* ========================================
FLORA CITY POPUP
======================================== */

.city-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}

.city-popup.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.city-popup__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(25, 16, 14, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.city-popup__dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: auto;
  padding: 48px;
  color: var(--black);
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(189, 64, 52, 0.08),
      transparent 37%
    ),
    var(--white);
  border: 1px solid rgba(189, 64, 52, 0.15);
  box-shadow: 0 28px 80px rgba(31, 15, 11, 0.22);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.24s ease;
}

.city-popup.is-active .city-popup__dialog {
  transform: translateY(0) scale(1);
}

.city-popup__close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.city-popup__close:hover {
  border-color: rgba(189, 64, 52, 0.35);
  background: var(--white);
}

.city-popup__close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 1px;
  background: var(--black);
}

.city-popup__close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.city-popup__close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.city-popup__view[hidden] {
  display: none;
}

.city-popup__eyebrow {
  margin: 0 0 13px;
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.city-popup__title {
  max-width: 500px;
  margin: 0;
  padding-right: 26px;
  color: var(--black);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 400;
  line-height: 1.06;
}

.city-popup__text {
  max-width: 510px;
  margin: 18px 0 0;
  color: rgba(17, 17, 17, 0.62);
  font-size: 16px;
  line-height: 1.55;
}

.city-popup__loader {
  width: 34px;
  height: 34px;
  margin-top: 30px;
  border: 2px solid rgba(189, 64, 52, 0.14);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: flora-city-loader 0.8s linear infinite;
}

@keyframes flora-city-loader {
  to {
    transform: rotate(360deg);
  }
}

.city-popup__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 30px;
}

.city-popup__button {
  min-height: 52px;
  padding: 13px 20px;
  border: 1px solid var(--red);
  font: inherit;
  font-size: 16px;
  line-height: 1.15;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.city-popup__button--primary {
  color: var(--white);
  background: var(--red);
}

.city-popup__button--primary:hover {
  background: var(--red-dark);
}

.city-popup__button--secondary {
  color: var(--red);
  background: var(--white);
}

.city-popup__button--secondary:hover {
  color: var(--white);
  background: var(--red);
}

.city-popup__search {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 26px;
}

.city-popup__search svg {
  position: absolute;
  left: 17px;
  width: 20px;
  height: 20px;
  color: rgba(17, 17, 17, 0.42);
  pointer-events: none;
}

.city-popup__search input {
  width: 100%;
  height: 54px;
  padding: 0 18px 0 48px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  outline: 0;
  color: var(--black);
  background: #fffaf8;
  font: inherit;
  font-size: 16px;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.city-popup__search input:focus {
  border-color: rgba(189, 64, 52, 0.55);
  background: var(--white);
}

.city-popup__search input::placeholder {
  color: rgba(17, 17, 17, 0.38);
}

.city-popup__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 290px;
  margin-top: 14px;
  overflow-y: auto;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.city-popup__city {
  display: flex;
  align-items: center;
  min-height: 49px;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--black);
  text-align: left;
  font: inherit;
  font-size: 15px;
  transition:
    color 0.2s ease,
    padding-left 0.2s ease;
}

.city-popup__city:nth-child(odd) {
  margin-right: 13px;
}

.city-popup__city:hover,
.city-popup__city.is-current {
  padding-left: 5px;
  color: var(--red);
}

.city-popup__empty {
  margin: 15px 0 0;
  padding: 14px 16px;
  color: rgba(17, 17, 17, 0.58);
  background: #fff8f5;
  border: 1px solid rgba(189, 64, 52, 0.12);
  font-size: 14px;
  line-height: 1.5;
}

.city-popup__location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--red);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
}

.city-popup__location:hover {
  text-decoration: underline;
}

.city-popup__location svg {
  width: 19px;
  height: 19px;
}

.city-popup__location[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.city-popup__status {
  min-height: 20px;
  margin: 11px 0 0;
  color: rgba(17, 17, 17, 0.55);
  font-size: 13px;
  line-height: 1.45;
}

body.is-city-popup-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .city-popup {
    align-items: flex-end;
    padding: 0;
  }

  .city-popup__dialog {
    width: 100%;
    max-height: min(86dvh, 760px);
    padding: 38px 20px 26px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    transform: translateY(100%);
  }

  .city-popup.is-active .city-popup__dialog {
    transform: translateY(0);
  }

  .city-popup__close {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
  }

  .city-popup__eyebrow {
    margin-bottom: 10px;
    font-size: 11px;
  }

  .city-popup__title {
    padding-right: 38px;
    font-size: 31px;
  }

  .city-popup__text {
    margin-top: 14px;
    font-size: 15px;
  }

  .city-popup__actions {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .city-popup__button {
    min-height: 50px;
  }

  .city-popup__list {
    grid-template-columns: 1fr;
    max-height: 250px;
  }

  .city-popup__city:nth-child(odd) {
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .city-popup,
  .city-popup__dialog,
  .city-popup__loader {
    transition: none;
    animation: none;
  }
}
