.location-wrapper {
  flex: 1;
}

.header-wrapper .header .location-wrapper .location {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 32px;
  padding: var(--spacing-xsmall) var(--spacing-none);

  @media (width >=1024px) {
    background: unset;
    padding: var(--spacing-none);
    height: unset;
    justify-content: left;
  }
}

.location .location-btn {
  font-size: var(--body-font-size-xxxs);
  font-weight: var(--fw-400);
  line-height: 16px;
  color: var(--text-black);
  background: none;
  border: none;
  padding: var(--spacing-none);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 1;

  .geo-location.hidden {
    display: none;
  }

  @media (width >=1024px) {
    font-size: var(--fs-xxsmall);
    line-height: 12px;
    color: var(--color-neutral-50);
  }

  @media (width >=1024px) {
    font-size: var(--body-font-size-xs);
    line-height: var(--lh-medium);
  }

  &::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    background: center / contain no-repeat url('/genuine-accessories/icons/down-arrow_dark.svg');

    @media (width >=1024px) {
      background-image: url('/genuine-accessories/icons/dropdown.svg');
      width: 16px;
      height: 16px;
    }
  }

  &.rotate {
    &::after {
      transform: rotate(180deg);
    }
  }

  span {
    overflow: hidden;
    white-space: nowrap;
    text-align: center;

    @media (width >=1024px) {
      text-align: right;
    }

    @media (width >= 1366px) {
      max-width: none;
    }
  }
}

.geo-location .close__icon {
  content: '';
  display: inline-block;
  cursor: pointer;
  width: 24px;
  height: 24px;
  background-image: url('/genuine-accessories/icons/close__icon.svg');
  background-size: contain;
  background-repeat: no-repeat;
}

.location .geo-location .detect-location .separator {
  display: none;
  justify-content: center;
  font-size: var(--body-font-size-xxxs);
  font-weight: var(--fw-500);
  line-height: 16px;
  color: var(--nexa-primary-main);
  border: none;

  @media (width >=1024px) {
    font-size: var(--body-font-size-xxs);
    line-height: var(--lh-medium);
    margin-block: var(--spacing-l);
  }
}

.geo-location {
  z-index: 1;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  width: 100%;
  background-color: #fff;

  @media (width >=768px) and (width < 1024px) {
    width: 50%;
  }

  @media (width >=1024px) {
    width: 402px;
    top: 64px;
    left: 275px;
  }

  .geo-location_heading {
    background-color: var(--nexa-tertiary-light-grey);
    padding: 18px var(--spacing-l);
    display: flex;
    justify-content: space-between;

    @media (width >=768px) and (width < 1024px) {
      padding: var(--sizing-m) 19px 21px;
    }

    .geo-location__text {
      font-size: var(--fs-medium);
      font-weight: var(--fw-500);
      line-height: var(--lh-medium);
      color: var(--neutrals-sub-texts-paragraphs);
      width: 60%;

      @media (width >=768px) and (width < 1024px) {
        font-size: var(--fs-small);
      }

      @media (width >=1024px) {
        font-size: var(--fs-medium);
      }
    }
  }

  .location-grid {
    padding: var(--spacing-l) 0;

    @media (width >=1024px) {
      padding: var(--spacing-l);
    }

    .detect-location {
      display: flex;
      flex-direction: column;
      gap: var(--sizing-s);
      justify-content: center;

      .search-location {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 2px;
        font-size: var(--body-font-size-xxs);
        font-weight: var(--fw-400);
        line-height: var(--lh-medium);
        padding: var(--spacing-none) var(--sizing-m);

        @media (width >=1024px) {
          padding: var(--spacing-none);
        }

        .search-box {
          display: flex;
          align-items: center;
          border-bottom: 1px solid var(--footer-subtext-light-color);
        }

        .search {
          color: var(--nexa-primary-main);
          border: none;
          outline: none;
          width: calc(100% - 24px);
          padding: 6px var(--spacing-none);
          box-sizing: border-box;
          font-size: var(--fs-small);
          font-weight: var(--fw-400);
          line-height: var(--lh-medium);

          &::placeholder {
            color: var(--subtext-grey);
          }

          @media (width >=1024px) {
            padding: 10px var(--spacing-none);
            font-size: var(--fs-medium);
          }
        }

        .search-box::after {
          content: '';
          display: inline-block;
          width: 24px;
          height: 24px;
          background-image: url('/genuine-accessories/icons/location_search.svg');
          background-size: contain;
          background-repeat: no-repeat;
        }

        .suggested-places {
          display: none;
          max-height: 176px;
          overflow-y: auto;
          flex-direction: column;
          align-items: left;
          padding: var(--spacing-none);
          position: relative;
          box-shadow: 0 2px 8px 0 rgba(0 0 0 / 6%);

          .suggested__city {
            padding: var(--sizing-s) var(--sizing-m);
            color: var(--subtext-grey);
            text-transform: capitalize;
            font-size: var(--fs-small);
            font-weight: var(--fw-400);
            line-height: var(--lh-medium);

            strong {
              color: var(--nexa-primary-main);
              font-weight: var(--fw-500);
            }
          }

          .suggested__city:hover {
            background-color: var(--secondary-color);
            cursor: pointer;
          }

          .suggested__city.active-city {
            background: var(--nexa-tertiary-light-grey);

            &::after {
              content: '';
              display: inline-flex;
              position: absolute;
              right: 16px;
              width: 24px;
              height: 24px;
              background-image: url('/genuine-accessories/icons/tick.svg');
              background-size: contain;
              background-repeat: no-repeat;
            }
          }
        }

        .error-message {
          display: flex;
          gap: var(--sizing-m);
          align-items: center;
          box-shadow: 0 2px 8px 0 rgba(0 0 0 / 6%);
          padding: var(--sizing-s) 36px var(--sizing-s) var(--sizing-m);

          div {
            display: flex;
            flex-direction: column;
            gap: var(--sizing-2xs);

            p {
              font-size: var(--fs-small);
              color: var(--subtext-grey);
              font-weight: var(--fw-400);
              line-height: var(--lh-medium);
            }

            p:first-child {
              color: var(--nexa-primary-main);
              font-size: var(--fs-medium);
              margin-bottom: var(--sizing-2xs);
            }
          }
        }

        .error-message::before {
          content: '';
          width: 12px;
          height: 45px;
          background: url('/genuine-accessories/icons/exclamation.svg') no-repeat center;
        }
      }

      .detect-location__box {
        display: flex;
        flex-direction: column;
        gap: var(--sizing-s);
        overflow: hidden;
        width: 100%;

        .detect-location__cta {
          order: 2;
          padding: var(--spacing-none) var(--spacing-l);

          @media (width >=1024px) {
            padding: var(--spacing-none);
          }
        }

        .detect-location__text {
          width: fit-content;
          font-size: var(--fs-small);
          font-weight: var(--fw-500);
          line-height: var(--lh-medium);
          color: var(--primary-color);
          display: flex;
          align-items: center;
          gap: var(--spacing-xsmall);
          cursor: pointer;
          letter-spacing: 0.14px;
          padding: var(--spacing-2xs) var(--spacing-none);
        }

        .detect-location__text::before {
          content: '';
          display: inline-block;
          width: 18px;
          height: 18px;
          background-image: url('/genuine-accessories/icons/location_searching.svg');
          background-size: contain;
          background-repeat: no-repeat;
        }

        .top__cities {
          cursor: grab;
          display: flex;
          gap: var(--sizing-s);
          overflow-x: auto;
          scroll-behavior: smooth;
          -webkit-overflow-scrolling: touch;
          scrollbar-width: none;
          align-items: center;
          order: 1;
          padding: var(--spacing-none) var(--spacing-l);

          @media (width >=1024px) {
            padding: var(--spacing-none);
          }

          &::-webkit-scrollbar {
            display: none;
          }

          .selected__top__city {
            border: 1px solid var(--footer-subtext-light-color);
            padding: var(--sizing-2xs) var(--sizing-s);
            color: var(--tertiary-deep-grey);
            font-size: var(--fs-small);
            font-weight: var(--fw-400);
            line-height: var(--lh-medium);
            text-align: center;
            cursor: pointer;
            min-width: 68px;
            flex: none;

            @media (width >=1024px) {
              min-width: 60px;
            }
          }

          .selected__top__city.active {
            border: none;
            color: var(--tertiary-color);
            background-color: var(--primary-color);
          }
        }

        .top__cities.dragging {
          cursor: grabbing;
          user-select: none;
        }
      }
    }
  }
}
