@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 {
  /* Layout */
  margin: 8px 24px 14px 24px;

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

.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;
}

.openMobileMap {
  /* Font */
  @apply --marketplaceH4FontStyles;
  font-weight: var(--fontWeightSemiBold);

  /* Positioning */
  /* Positioning from top to place button just above Safari's bottom toolbar
  /* 120px = button height + toolbar height (68px) */
  position: fixed;
  top: calc(100vh - 120px);
  left: 50vw;
  width: 175px;
  transform: translateX(-50%);
  margin-top: 0;
  margin-bottom: 0;

  /* Button's layout */
  padding: 12px 36px;
  background-color: var(--matterColorLight);
  border-radius: 30px;
  border: 0;
  box-shadow: var(--boxShadow);
  cursor: pointer;
  transition: var(--transitionStyleButton);

  & .openMobileMapIcon {
    stroke: var(--matterColor);
    margin-right: 4px;
  }

  &:hover {
    color: var(--marketplaceColor);
    box-shadow: var(--boxShadowPopupLight);

    & .openMobileMapIcon {
      stroke: var(--marketplaceColor);
    }
  }

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

.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;
  }
}
