@import url('/styles/subscribe.css');

.subscribe-location-popup.block {
  button {
    background-color: transparent;
    border: none;
    cursor: pointer;
  }

  .location-title {
    font-size: 1rem;
    color: var(--color-grey);
    position: relative;
    padding: 0;
    border-bottom: 1px solid var(--primary-black);
    line-height: 1;

    @media (width >= 992px) {
      border: none;
      font-size: 0.875rem;
      padding-right: 16px;
    }

    &::after {
      content: none;
      position: absolute;
      top: 50%;
      right: 0;
      transform: translateY(-50%);

      @media (width >= 992px) {
        content: url('/icons/down-arrow.svg');
        margin-left: 8px;
      }
    }
  }

  .subscribe-location-dialog {
    border: none;
    background: none;
    .modal-wrapper {
      position: fixed;
      top: 0;
      left: 0;
      z-index: 3;
      width: 100vw;
      height: 100vh;
      outline: 0;
      border: none;
      padding: 0;
      background-color: var(--modal-backdrop-color);
      display: flex;
      align-items: flex-end;
      justify-content: center;

      @media (width >= 992px) {
        align-items: flex-start;
      }
    }

    .modal-header {
      text-align: right;
      justify-content: end;
      padding: 0;
      border: none;

      .close-button {
        color: var(--secondary-gray-10);
      }
    }

    .modal-content {
      width: 100%;
      max-width: 800px;
      margin: 0 auto;
      position: relative;
      background-color: transparent;
      border: none;

      @media (width >= 992px) {
        width: 90%;
        top: 50%;
        transform: translateY(-50%);
      }

      .modal-body {
        background-color: var(--secondary-gray-10);
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      }

      .modal-title {
        font-size: var(--subscription-font-h5);
        font-weight: 300;
        line-height: 1.3;

        @media (width >= 992px) {
          font-size: var(--subscription-lh-4-mob-display);
        }
      }

      .modal-description {
        margin-bottom: 14px;
        color: var(--color-grey);
        font-size: 14px;
      }

      .modal-top {
        display: flex;

        .modal-top__left {
          width: 60%;
        }
        .modal-top__right {
          width: 40%;

          .modal-image {
            img {
              width: 100%;
              display: block;
            }
          }
        }
      }

      .location-select {
        position: relative;
        width: 100%;
        margin-bottom: 16px;

        @media (width >= 992px) {
          width: 350px;
        }

        &.mobile-only {
          @media (width >= 992px) {
            display: none;
          }
        }

        &.desktop-only {
          @media (width < 992px) {
            display: none;
          }
        }

        input {
          width: 100%;
          border: 0px;
          padding: 12px 35px 12px 40px;
          font-size: 0.875rem;
          color: var(--color-grey);
          border-radius: 12px;
          background: var(--nav-background-color) url(/icons/search_icon_grey.svg) 10px center no-repeat;
          outline: none;
        }

        .detect-location {
          position: absolute;
          top: 8px;
          right: 4px;
          cursor: pointer;
          opacity: 0.6;
        }

        ul {
          max-height: 150px;
          margin: 8px 12px;
          border: 1px solid var(--surface-light);
          margin: 0;
          background-color: var(--secondary-gray-10);
          width: 100%;
          border-radius: 12px;
          height: 0;
          overflow: hidden;
          transition: all 0.5s ease;

          @media (width >= 992px) {
            position: absolute;
            transition: none;
          }

          &.active {
            height: 150px;
            overflow-y: auto;
          }

          li {
            padding: 8px 12px;
            cursor: pointer;
            color: var(--color-grey);
            display: block;
            border-bottom: 1px solid var(--surface-light);
            font-size: 12px;

            &:hover {
              text-decoration: underline;
            }

            &:last-child {
              border-bottom: none;
            }

            &.no-location-result {
              cursor: default;

              &:hover {
                text-decoration: none;
              }
            }
          }
        }
      }

      .popular-locations {
        display: none;

        @media (width >= 992px) {
          display: block;
        }

        ul {
          display: flex;
          flex-wrap: wrap;
          row-gap: 16px;
          margin-top: 14px;

          li {
            display: inline-block;
            font-size: 13px;
            text-decoration: underline;
            color: var(--darker-color);
            width: 20%;
            cursor: pointer;

            &:hover {
              text-decoration: none;
            }
          }
        }

        .popular-locations-text {
          font-size: var(--heading-font-17-des);
          font-weight: var(--fw-500);
        }
      }
    }
  }
}

.subscribe-journey-confirm {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subscribe-journey-confirm__overlay {
  position: absolute;
  inset: 0;
  background: var(--sub-black-50);
}

.subscribe-journey-confirm__content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: calc(100% - var(--space-40px));
  background: var(--white);
  border-radius: 8px;
  padding: var(--space-50px) var(--space-30px) var(--space-30px);
  box-shadow: 0 10px 30px var(--sub-black-20);
  text-align: center;
}

.subscribe-journey-confirm__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.subscribe-journey-confirm__close::before,
.subscribe-journey-confirm__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: var(--sub-dark-gray);
}

.subscribe-journey-confirm__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.subscribe-journey-confirm__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.subscribe-journey-confirm__text {
  margin: 0 0 var(--space-30px);
  font-size: var(--subscription-font-h6);
  line-height: var(--subscription-lh-2-desc-display);
  color: var(--sub-dark-gray);
}

.subscribe-journey-confirm__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-20px);
}
