.sub-header {
  margin-bottom: 3rem;
}

.sub-header {
  --height: var(--height);

  display: flex;
  height: var(--height);
  line-height: var(--height);

  & .sub-header__item {
    flex: 1;
  }
}

.sub-header__item {
  & h1 {
    margin-bottom: 0;
    line-height: var(--height);
  }
}

.sub-header__item--no-flex {
  flex: 0;
}

.sub-header__item--back--arrow {
  z-index: 2048;
  display: flex;
  align-items: center;

  & a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--height);
    height: var(--height);
  }

  & svg {
    height: 20px;
    width: auto;
    fill: var(--primary-text-color);
    transform: rotate(180deg);
  }
}

.sub-header__item--back--arrow-with-text {
  z-index: 2048;

  & a {
    display: block;
    height: var(--height);
    line-height: var(--height);
    text-align: center;
  }

  & svg {
    height: 20px;
    margin: 15px 0;
    fill: var(--primary-text-color);
  }
}

.sub-header__item-delete-icon {
  & a {
    display: inline-block;
    width: var(--height);
    height: var(--height);
    line-height: var(--height);
    text-align: center;
  }

  & svg {
    height: 20px;
    margin: 15px 0;
    fill: var(--primary-text-color);
  }
}

.sub-header__item--bold {
  font-weight: bold;
  text-align: center;
}

.sub-header__item--right-aligned {
  text-align: right;
  justify-content: flex-end;
}

.sub-header--dark {
  background-color: #212121;
  color: white;

  & .sub-header__item--back--arrow,
  & .sub-header__item-delete-icon {
    color: white;

    & a {
      color: white;
    }

    & svg {
      fill: white;
    }

    & a:hover {
      background-color: rgba(255,255,255,.1);
    }
  }
}

.sub-header__item--center {
  text-align: center;
}

.sub-header--with-timeline-height-margin {
  margin-bottom: 201px;
}

.sub-header__item--min-width {
  min-width: var(--height);
}

.sub-header__item--no-flex {
  flex: unset;
}

.sub-header--no-flex {
  display: block;
}

.sub-header--large {
  --height: 50px;
  --padding: 1rem;

  padding: var(--padding);

  & .sub-header__item {
    height: var(--height);
    line-height: var(--height);
  }
}

.sub-header__item--flex-2 {
  flex: 2;
}

.sub-header--app-bar {
  --height: 50px;
  height: var(--height);
  padding: 0 0.25rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;

  & .sub-header__item--back--arrow,
  & .sub-header__item--right-aligned {
    display: flex;
    align-items: center;
  }

  & .sub-header__item--right-aligned {
    justify-content: flex-end;
  }
}

.sub-header--mobile.sub-header--3-columns {
  height: var(--height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  width: 100%;
  overflow: visible;

  & .sub-header__col--left {
    display: flex;
    align-items: center;
  }

  & .sub-header__col--center {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  & .sub-header__col--right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}

.sub-header--mobile.sub-header--2-columns {
  /* --height: 50px; */
  height: var(--height);
  /* padding: 0 0.5rem; */
  /* margin-bottom: 0; */
  /* border-bottom: 1px solid var(--border-color, #e2e8f0); */
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;

  /* New design */
  /* grid-template-columns: 50px 1fr auto; */
  /* grid-template-areas: "logo search user"; */
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  box-sizing: border-box;
  width: 100%;
  overflow: visible;


  & .sub-header__col--left {
    display: flex;
    align-items: center;
    overflow: hidden;

    & a {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      color: var(--primary-text-color);
      text-decoration: none;
      font-weight: 600;
      overflow: hidden;

      & svg {
        flex-shrink: 0;
        height: 20px;
        width: auto;
        fill: var(--primary-text-color);
        transform: rotate(180deg);
      }

      & span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }

  & .sub-header__col--right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
}

.sub-header--spot-show {
  margin-bottom: 1rem;
  display: grid;

  grid-template-columns: 1fr;
  grid-template-areas:
    "name"
    "models"
    "create-alert";

  @media (min-width: 640px) {
    grid-template-columns: 1fr 300px;
    grid-template-areas:
      "name create-alert"
      "models create-alert";
  }

  & .spot__name-row {
    grid-area: name;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  & .spot__name {
    font-weight: 800;
    margin-bottom: 0;
    text-align: left;
    font-family: "Graphik", sans-serif;
  }

  & .spot__models {
    grid-area: models;
    align-self: center;
  }

  & .spot__create-alert {
    grid-area: create-alert;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;

    @media (min-width: 640px) {
      justify-content: flex-end;
      align-items: flex-start;
      padding-top: 0.25rem;
    }
  }
}

.sub-header__item--actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}