@import '../../marketplace.css';

:root {
  --containerHeight: calc(100vh - var(--topbarHeightDesktop));
}

.topbar {
  @media (--viewportMedium) {
    position: fixed;
    top: 0;
    left: 0;
    /* We need to raise Topbar above .container */
    z-index: 1;
  }
}

.container {
  /* Layout */
  width: 100%;
  flex-grow: 1;
  display: flex;

  @media (--viewportMedium) {
    position: relative;
    padding-top: var(--topbarHeightDesktop);
    min-height: var(--containerHeight);
  }
}

.searchResultContainer {
  flex-grow: 1;
  display: flex;
  flex-direction: column;

  @media (--viewportMedium) {
    /**
     * .container is using flexbox,
     * This specifies that searchResultContainer is taking 60% from the viewport width
     */
    flex-basis: 50%;
  }

  @media (--viewportLarge) {
    flex-basis: 62.5%;
  }
}

.searchResultSummary {
  display: none;

  @media (--viewportMedium) {
    display: block;
    margin: 8px 24px 14px 24px;
  }

  @media (--viewportLarge) {
    margin: 8px 36px 14px 36px;
  }
}

.searchResultSummaryMobile {
  display: flex;
  justify-content: space-between;

  background-color: var(--matterColorBright);
  width: 100vw;
  padding: 1px 24px 14px 24px;

  /* sticky result summary in mobile */
  position: sticky;
  top: 0;
  z-index: 9;

  @media (--viewportMedium) {
    display: none;
  }
}

.mapIcon {
  /* Font */
  @apply --marketplaceTinyFontStyles;
  font-weight: var(--fontWeightBold);

  /* background map image */
  background-image: url(./images/map_icon@2x.png);
  background-size: cover;

  border-radius: 3px;
  width: 72px;
  height: 35px;
  margin-top: 23px;
  padding: 9px 22px;
}

.error {
  color: var(--failColor);
}

.searchString {
  /* Search string should not break on white spaces - i.e. line-break should happen before. */
  white-space: nowrap;
}

.listings {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.newSearchInProgress {
  opacity: 0.1;
  transition: opacity var(--transitionStyleButton);
}

.searchListingsPanel {
  flex-grow: 1;
}

.mapPanel {
  @media (--viewportMedium) {
    /**
     * .container is using flexbox,
     * This specifies that mapPanel is taking 34% from the viewport width
     */
    flex-basis: 50%;

    /* Own layout settings */
    display: flex;
    height: 100%;
  }

  @media (--viewportLarge) {
    flex-basis: 37.5%;
  }
}

.map {
  width: 100vw;
  height: 100vh;

  @media (--viewportMedium) {
    /* Map is fixed so that it doesn't scroll along search results */
    position: fixed;
    top: var(--topbarHeightDesktop);
    right: 0;

    /* Fixed content needs width relative to viewport */
    width: 50vw;
    height: var(--containerHeight);
  }

  @media (--viewportLarge) {
    width: 37.5vw;
  }
}
